From efcc66532635dc1c88496b7427a4f896d55ce59c Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Fri, 5 Sep 2014 13:52:27 -0700 Subject: [PATCH 01/60] Bug 1057631 - Use real locale when pulling search engine out of the jar. r=rnewman --- .../search/providers/SearchEngineManager.java | 45 +++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/mobile/android/search/java/org/mozilla/search/providers/SearchEngineManager.java b/mobile/android/search/java/org/mozilla/search/providers/SearchEngineManager.java index 900bdc9a957..145f4c993fc 100644 --- a/mobile/android/search/java/org/mozilla/search/providers/SearchEngineManager.java +++ b/mobile/android/search/java/org/mozilla/search/providers/SearchEngineManager.java @@ -11,6 +11,7 @@ import android.text.TextUtils; import android.util.Log; import org.mozilla.gecko.AppConstants; +import org.mozilla.gecko.BrowserLocaleManager; import org.mozilla.gecko.GeckoSharedPrefs; import org.mozilla.gecko.util.GeckoJarReader; import org.mozilla.search.R; @@ -23,6 +24,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; +import java.util.Locale; public class SearchEngineManager implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String LOG_TAG = "SearchEngineManager"; @@ -118,8 +120,7 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference */ public List getAllEngines() { // First try to read the engine list from the jar. - final String url = getSearchPluginsJarUrl("list.txt"); - InputStream in = GeckoJarReader.getStream(url); + InputStream in = getInputStreamFromJar("list.txt"); // Fallback for standalone search activity. if (in == null) { @@ -167,7 +168,7 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference * @return SearchEngine instance for identifier */ private SearchEngine createEngine(String identifier) { - InputStream in = getEngineFromJar(identifier); + InputStream in = getInputStreamFromJar(identifier + ".xml"); // Fallback for standalone search activity. if (in == null) { @@ -210,27 +211,43 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference } /** - * Reads open search plugin XML file from the gecko jar. This will only work + * Reads a file from the searchplugins directory in the Gecko jar. This will only work * if the search activity is built as part of mozilla-central. * - * @param identifier search engine identifier (e.g. "google") - * @return InputStream for open search plugin XML + * @param fileName name of the file to read + * @return InputStream for file */ - private InputStream getEngineFromJar(String identifier) { - final String url = getSearchPluginsJarUrl(identifier + ".xml"); + private InputStream getInputStreamFromJar(String fileName) { + final Locale locale = Locale.getDefault(); + + // First, try a file path for the full locale. + final String languageTag = BrowserLocaleManager.getLanguageTag(locale); + String url = getSearchPluginsJarURL(languageTag, fileName); + + final InputStream in = GeckoJarReader.getStream(url); + if (in != null) { + return in; + } + + // If that doesn't work, try a file path for just the language. + final String language = BrowserLocaleManager.getLanguage(locale); + if (languageTag.equals(language)) { + // We already tried this, so just return null. + return null; + } + + url = getSearchPluginsJarURL(language, fileName); return GeckoJarReader.getStream(url); } /** * Gets the jar URL for a file in the searchplugins directory * - * @param fileName - * @return + * @param locale String representing the Gecko locale (e.g. "en-US") + * @param fileName name of the file to read + * @return URL for jar file */ - private String getSearchPluginsJarUrl(String fileName) { - // TODO: Get the real value for this - final String locale = "en-US"; - + private String getSearchPluginsJarURL(String locale, String fileName) { final String path = "!/chrome/" + locale + "/locale/" + locale + "/browser/searchplugins/" + fileName; return "jar:jar:file://" + context.getPackageResourcePath() + "!/" + AppConstants.OMNIJAR_NAME + path; } From c4579ee017eab0664c46461c074de42d86531b8e Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Fri, 5 Sep 2014 13:52:29 -0700 Subject: [PATCH 02/60] Bug 1063177 - Don't let plus button overlap search suggestion text. r=bnicholson --- .../android/search/res/layout/search_suggestions_row.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mobile/android/search/res/layout/search_suggestions_row.xml b/mobile/android/search/res/layout/search_suggestions_row.xml index 10dbe7f1c8a..34d865ae0e0 100644 --- a/mobile/android/search/res/layout/search_suggestions_row.xml +++ b/mobile/android/search/res/layout/search_suggestions_row.xml @@ -2,7 +2,7 @@ - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - - + From 3e278561cbd1588819a30be09c7c84efb8a73f17 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Fri, 5 Sep 2014 15:39:49 -0700 Subject: [PATCH 03/60] Bug 1058813 - Add telemetry probe for clicking sync preference. r=liuche --- mobile/android/base/preferences/SyncPreference.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mobile/android/base/preferences/SyncPreference.java b/mobile/android/base/preferences/SyncPreference.java index d26ff9eb761..2adfb369c8f 100644 --- a/mobile/android/base/preferences/SyncPreference.java +++ b/mobile/android/base/preferences/SyncPreference.java @@ -5,6 +5,9 @@ package org.mozilla.gecko.preferences; +import org.mozilla.gecko.Telemetry; +import org.mozilla.gecko.TelemetryContract; +import org.mozilla.gecko.TelemetryContract.Method; import org.mozilla.gecko.fxa.activities.FxAccountGetStartedActivity; import org.mozilla.gecko.sync.setup.SyncAccounts; import org.mozilla.gecko.sync.setup.activities.SetupSyncActivity; @@ -60,6 +63,7 @@ class SyncPreference extends Preference { // open the settings page. if (SyncAccounts.syncAccountsExist(mContext)) { if (SyncAccounts.openSyncSettings(mContext) != null) { + Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, Method.SETTINGS, "sync_settings"); return; } } @@ -67,5 +71,6 @@ class SyncPreference extends Preference { // Otherwise, launch the FxA "Get started" activity, which will // dispatch to the right location. launchFxASetup(); + Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, Method.SETTINGS, "sync_setup"); } } From fb45afa1f1415cc804432b7b00fdb097e43cc4cf Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Fri, 5 Sep 2014 15:39:52 -0700 Subject: [PATCH 04/60] Bug 1063128 - Make sure all preferences have keys. r=liuche --- .../base/resources/xml/preferences_devtools.xml | 4 +++- .../base/resources/xml/preferences_vendor.xml | 14 +++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mobile/android/base/resources/xml/preferences_devtools.xml b/mobile/android/base/resources/xml/preferences_devtools.xml index d9308d997b4..c4db6dae8e3 100644 --- a/mobile/android/base/resources/xml/preferences_devtools.xml +++ b/mobile/android/base/resources/xml/preferences_devtools.xml @@ -15,7 +15,9 @@ - diff --git a/mobile/android/base/resources/xml/preferences_vendor.xml b/mobile/android/base/resources/xml/preferences_vendor.xml index 6a73fdc1f8f..c200de3e3f3 100644 --- a/mobile/android/base/resources/xml/preferences_vendor.xml +++ b/mobile/android/base/resources/xml/preferences_vendor.xml @@ -8,13 +8,19 @@ android:title="@string/pref_category_vendor" android:enabled="false"> - - - From 3a4955888eff04814b07e6cc2b4a638f64df18a4 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Fri, 5 Sep 2014 15:39:55 -0700 Subject: [PATCH 05/60] Bug 1017903 - Remove synchronous search service initialization. r=liuche --- mobile/android/chrome/content/browser.js | 74 ++++++++++++------------ 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 69cdc962465..4c887e393e7 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -3922,50 +3922,52 @@ Tab.prototype = { // Check that type matches opensearch. let isOpenSearch = (type == "application/opensearchdescription+xml"); if (isOpenSearch && target.title && /^(?:https?|ftp):/i.test(target.href)) { - let visibleEngines = Services.search.getVisibleEngines(); - // NOTE: Engines are currently identified by name, but this can be changed - // when Engines are identified by URL (see bug 335102). - if (visibleEngines.some(function(e) { - return e.name == target.title; - })) { - // This engine is already present, do nothing. - return; - } - - if (this.browser.engines) { - // This engine has already been handled, do nothing. - if (this.browser.engines.some(function(e) { - return e.url == target.href; + Services.search.init(() => { + let visibleEngines = Services.search.getVisibleEngines(); + // NOTE: Engines are currently identified by name, but this can be changed + // when Engines are identified by URL (see bug 335102). + if (visibleEngines.some(function(e) { + return e.name == target.title; })) { - return; + // This engine is already present, do nothing. + return; } - } else { - this.browser.engines = []; - } - // Get favicon. - let iconURL = target.ownerDocument.documentURIObject.prePath + "/favicon.ico"; + if (this.browser.engines) { + // This engine has already been handled, do nothing. + if (this.browser.engines.some(function(e) { + return e.url == target.href; + })) { + return; + } + } else { + this.browser.engines = []; + } - let newEngine = { - title: target.title, - url: target.href, - iconURL: iconURL - }; + // Get favicon. + let iconURL = target.ownerDocument.documentURIObject.prePath + "/favicon.ico"; - this.browser.engines.push(newEngine); + let newEngine = { + title: target.title, + url: target.href, + iconURL: iconURL + }; - // Don't send a message to display engines if we've already handled an engine. - if (this.browser.engines.length > 1) - return; + this.browser.engines.push(newEngine); - // Broadcast message that this tab contains search engines that should be visible. - let newEngineMessage = { - type: "Link:OpenSearch", - tabID: this.id, - visible: true - }; + // Don't send a message to display engines if we've already handled an engine. + if (this.browser.engines.length > 1) + return; - Messaging.sendRequest(newEngineMessage); + // Broadcast message that this tab contains search engines that should be visible. + let newEngineMessage = { + type: "Link:OpenSearch", + tabID: this.id, + visible: true + }; + + Messaging.sendRequest(newEngineMessage); + }); } } break; From aaeab482f4ba75fd704d3025269530c8da81edf5 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Fri, 5 Sep 2014 17:13:20 -0700 Subject: [PATCH 06/60] Backed out changeset 279d7f0290da (bug 1017903) --- mobile/android/chrome/content/browser.js | 74 ++++++++++++------------ 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 4c887e393e7..69cdc962465 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -3922,52 +3922,50 @@ Tab.prototype = { // Check that type matches opensearch. let isOpenSearch = (type == "application/opensearchdescription+xml"); if (isOpenSearch && target.title && /^(?:https?|ftp):/i.test(target.href)) { - Services.search.init(() => { - let visibleEngines = Services.search.getVisibleEngines(); - // NOTE: Engines are currently identified by name, but this can be changed - // when Engines are identified by URL (see bug 335102). - if (visibleEngines.some(function(e) { - return e.name == target.title; + let visibleEngines = Services.search.getVisibleEngines(); + // NOTE: Engines are currently identified by name, but this can be changed + // when Engines are identified by URL (see bug 335102). + if (visibleEngines.some(function(e) { + return e.name == target.title; + })) { + // This engine is already present, do nothing. + return; + } + + if (this.browser.engines) { + // This engine has already been handled, do nothing. + if (this.browser.engines.some(function(e) { + return e.url == target.href; })) { - // This engine is already present, do nothing. - return; + return; } + } else { + this.browser.engines = []; + } - if (this.browser.engines) { - // This engine has already been handled, do nothing. - if (this.browser.engines.some(function(e) { - return e.url == target.href; - })) { - return; - } - } else { - this.browser.engines = []; - } + // Get favicon. + let iconURL = target.ownerDocument.documentURIObject.prePath + "/favicon.ico"; - // Get favicon. - let iconURL = target.ownerDocument.documentURIObject.prePath + "/favicon.ico"; + let newEngine = { + title: target.title, + url: target.href, + iconURL: iconURL + }; - let newEngine = { - title: target.title, - url: target.href, - iconURL: iconURL - }; + this.browser.engines.push(newEngine); - this.browser.engines.push(newEngine); + // Don't send a message to display engines if we've already handled an engine. + if (this.browser.engines.length > 1) + return; - // Don't send a message to display engines if we've already handled an engine. - if (this.browser.engines.length > 1) - return; + // Broadcast message that this tab contains search engines that should be visible. + let newEngineMessage = { + type: "Link:OpenSearch", + tabID: this.id, + visible: true + }; - // Broadcast message that this tab contains search engines that should be visible. - let newEngineMessage = { - type: "Link:OpenSearch", - tabID: this.id, - visible: true - }; - - Messaging.sendRequest(newEngineMessage); - }); + Messaging.sendRequest(newEngineMessage); } } break; From 93685a1fb348304fd35a863ed2a88c32410cf898 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Fri, 5 Sep 2014 21:10:23 -0700 Subject: [PATCH 07/60] Bug 1063109 - Allow for aapt to be invoked with max-res-version argument. r=nalexander --- build/autoconf/android.m4 | 2 ++ mobile/android/base/Makefile.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build/autoconf/android.m4 b/build/autoconf/android.m4 index 26a36275584..1eabff65000 100644 --- a/build/autoconf/android.m4 +++ b/build/autoconf/android.m4 @@ -433,10 +433,12 @@ if test -n "$MOZ_ANDROID_MIN_SDK_VERSION"; then fi AC_DEFINE_UNQUOTED(MOZ_ANDROID_MIN_SDK_VERSION, $MOZ_ANDROID_MIN_SDK_VERSION) + AC_SUBST(MOZ_ANDROID_MIN_SDK_VERSION) fi if test -n "$MOZ_ANDROID_MAX_SDK_VERSION"; then AC_DEFINE_UNQUOTED(MOZ_ANDROID_MAX_SDK_VERSION, $MOZ_ANDROID_MAX_SDK_VERSION) + AC_SUBST(MOZ_ANDROID_MAX_SDK_VERSION) fi ]) diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index b9ffeabd4b6..88e28f07e3c 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -353,12 +353,14 @@ extra_packages := $(subst $(NULL) ,:,$(strip $(extra_packages))) # are fresher than the target, preventing a subsequent invocation from # thinking aapt's outputs are stale. This is safe because Make # removes the target file if any recipe command fails. + define aapt_command $(1): $$(call mkdir_deps,$(filter-out ./,$(dir $(3) $(4) $(5)))) $(2) @$$(TOUCH) $$@ $$(AAPT) package -f -m \ -M AndroidManifest.xml \ -I $(ANDROID_SDK)/android.jar \ + $(if $(MOZ_ANDROID_MAX_SDK_VERSION),--max-res-version $(MOZ_ANDROID_MAX_SDK_VERSION),) \ --auto-add-overlay \ $$(addprefix -S ,$$(ANDROID_RES_DIRS)) \ $(if $(extra_res_dirs),$$(addprefix -S ,$$(extra_res_dirs)),) \ From 8fc19d1b50b77b6ab7f99160ab3cbb8afa2b6f46 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Sat, 6 Sep 2014 08:25:19 -0700 Subject: [PATCH 08/60] Bug 1063893 - Enable casting on beta and release. r=rnewman --- mobile/android/app/mobile.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index 3c7ec96c745..a50b747fde8 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -281,11 +281,7 @@ pref("browser.search.official", true); #endif // Control media casting feature -#ifdef RELEASE_BUILD -pref("browser.casting.enabled", false); -#else pref("browser.casting.enabled", true); -#endif // Enable sparse localization by setting a few package locale overrides pref("chrome.override_package.global", "browser"); From 24259b0a9e924f63bd5e54d6f63402056247b9b3 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Sat, 6 Sep 2014 08:25:20 -0700 Subject: [PATCH 09/60] Bug 1063643 - Allow for building Fennec with a limited set of resources. r=nalexander --- build/autoconf/android.m4 | 10 ++++++++++ mobile/android/base/AppConstants.java.in | 11 +++++++++++ mobile/android/base/Makefile.in | 1 + 3 files changed, 22 insertions(+) diff --git a/build/autoconf/android.m4 b/build/autoconf/android.m4 index 1eabff65000..8862a73b5c0 100644 --- a/build/autoconf/android.m4 +++ b/build/autoconf/android.m4 @@ -413,6 +413,16 @@ case "$target" in ;; esac +MOZ_ARG_ENABLE_BOOL(android-resource-constrained, +[ --enable-android-resource-constrained + exclude hi-res images and similar from the final APK], + MOZ_ANDROID_RESOURCE_CONSTRAINED=1) + +if test -n "$MOZ_ANDROID_RESOURCE_CONSTRAINED"; then + AC_DEFINE(MOZ_ANDROID_RESOURCE_CONSTRAINED, $MOZ_ANDROID_RESOURCE_CONSTRAINED) + AC_SUBST(MOZ_ANDROID_RESOURCE_CONSTRAINED) +fi + MOZ_ARG_WITH_STRING(android-min-sdk, [ --with-android-min-sdk=[VER] Impose a minimum Firefox for Android SDK version], [ MOZ_ANDROID_MIN_SDK_VERSION=$withval ]) diff --git a/mobile/android/base/AppConstants.java.in b/mobile/android/base/AppConstants.java.in index 8ab98aadc20..ffea6474f67 100644 --- a/mobile/android/base/AppConstants.java.in +++ b/mobile/android/base/AppConstants.java.in @@ -137,6 +137,17 @@ public class AppConstants { null; #endif + /** + * Whether this APK was built with constrained resources -- + * no xhdpi+ images, for example. + */ + public static final boolean MOZ_ANDROID_RESOURCE_CONSTRAINED = +#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED + true; +#else + false; +#endif + public static final boolean MOZ_SERVICES_HEALTHREPORT = #ifdef MOZ_SERVICES_HEALTHREPORT true; diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index 88e28f07e3c..d9807b389ff 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -370,6 +370,7 @@ $(1): $$(call mkdir_deps,$(filter-out ./,$(dir $(3) $(4) $(5)))) $(2) -F $(3) \ -J $(4) \ --output-text-symbols $(5) \ + $(if $(MOZ_ANDROID_RESOURCE_CONSTRAINED),-c hdpi,) \ --ignore-assets "$$(ANDROID_AAPT_IGNORE)" endef From 348718b48a734c63855936074b4cd8963e89dc4c Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Thu, 4 Sep 2014 15:17:47 -0400 Subject: [PATCH 10/60] Bug 927424 - Allow findbar binding to cancel content focusing when using RemoteFinder in an e10s window. r=evilpie. --HG-- extra : source : 2f6420722723035b1ed11e5de8e1829e827552fa --- toolkit/modules/Finder.jsm | 7 +++++-- toolkit/modules/RemoteFinder.jsm | 17 +++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/toolkit/modules/Finder.jsm b/toolkit/modules/Finder.jsm index 3abbf62fa2e..59286d47d1b 100644 --- a/toolkit/modules/Finder.jsm +++ b/toolkit/modules/Finder.jsm @@ -197,9 +197,12 @@ Finder.prototype = { // Allow Finder listeners to cancel focusing the content. for (let l of this._listeners) { try { - if (!l.shouldFocusContent()) + if ("shouldFocusContent" in l && + !l.shouldFocusContent()) return; - } catch (ex) {} + } catch (ex) { + Cu.reportError(ex); + } } let fastFind = this._fastFind; diff --git a/toolkit/modules/RemoteFinder.jsm b/toolkit/modules/RemoteFinder.jsm index 9899160e0df..768b120a6c4 100644 --- a/toolkit/modules/RemoteFinder.jsm +++ b/toolkit/modules/RemoteFinder.jsm @@ -83,6 +83,17 @@ RemoteFinder.prototype = { }, focusContent: function () { + // Allow Finder listeners to cancel focusing the content. + for (let l of this._listeners) { + try { + if ("shouldFocusContent" in l && + !l.shouldFocusContent()) + return; + } catch (ex) { + Cu.reportError(ex); + } + } + this._browser.messageManager.sendAsyncMessage("Finder:FocusContent"); }, @@ -134,12 +145,6 @@ RemoteFinderListener.prototype = { this._global.sendAsyncMessage("Finder:MatchesResult", aData); }, - //XXXmikedeboer-20131016: implement |shouldFocusContent| here to mitigate - // issues like bug 921338 and bug 921308. - shouldFocusContent: function () { - return true; - }, - receiveMessage: function (aMessage) { let data = aMessage.data; From 6758d5c1f9a6a3a50eee2058d87e05121acb46bd Mon Sep 17 00:00:00 2001 From: Chris Kitching Date: Sat, 6 Sep 2014 18:39:38 -0700 Subject: [PATCH 11/60] Bug 1063991 - Lift inner class to avoid javac optimization failure. r=rnewman --- .../base/animation/PropertyAnimator.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/mobile/android/base/animation/PropertyAnimator.java b/mobile/android/base/animation/PropertyAnimator.java index 03d3b65bbb2..e35b6aacb26 100644 --- a/mobile/android/base/animation/PropertyAnimator.java +++ b/mobile/android/base/animation/PropertyAnimator.java @@ -159,22 +159,24 @@ public class PropertyAnimator implements Runnable { treeObserver = null; } + final ViewTreeObserver.OnPreDrawListener preDrawListener = new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + if (treeObserver.isAlive()) { + treeObserver.removeOnPreDrawListener(this); + } + + mFramePoster.postFirstAnimationFrame(); + return true; + } + }; + // Try to start animation after any on-going layout round // in the current view tree. OnPreDrawListener seems broken // on pre-Honeycomb devices, start animation immediatelly // in this case. if (Versions.feature11Plus && treeObserver != null && treeObserver.isAlive()) { - treeObserver.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { - @Override - public boolean onPreDraw() { - if (treeObserver.isAlive()) { - treeObserver.removeOnPreDrawListener(this); - } - - mFramePoster.postFirstAnimationFrame(); - return true; - } - }); + treeObserver.addOnPreDrawListener(preDrawListener); } else { mFramePoster.postFirstAnimationFrame(); } From d641de1dcadd219165064f8eb79cc5769b0c9c27 Mon Sep 17 00:00:00 2001 From: Blair McBride Date: Fri, 29 Aug 2014 15:25:02 +1200 Subject: [PATCH 12/60] Bug 1057186 - Add a way to specify that nsDefaultURIFixup should obey the domain whitelist when not using keyword searches. r=smaug --HG-- extra : transplant_source : %D5%AC%02%CE34%F8%D8.%7E%87%9AZ%C0%B5%21%16%F5H%D3 --- docshell/base/nsDefaultURIFixup.cpp | 71 +++-- docshell/base/nsDefaultURIFixup.h | 2 + docshell/base/nsIURIFixup.idl | 12 +- .../test/unit/test_nsDefaultURIFixup_info.js | 260 +++++++++++++++--- 4 files changed, 282 insertions(+), 63 deletions(-) diff --git a/docshell/base/nsDefaultURIFixup.cpp b/docshell/base/nsDefaultURIFixup.cpp index 0061f3ea886..f233c03d621 100644 --- a/docshell/base/nsDefaultURIFixup.cpp +++ b/docshell/base/nsDefaultURIFixup.cpp @@ -386,14 +386,35 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup info->mFixupCreatedAlternateURI = MakeAlternateURI(info->mFixedURI); } + // If there is no relevent dot in the host, do we require the domain to + // be whitelisted? + if (info->mFixedURI) { + if (aFixupFlags & FIXUP_FLAG_REQUIRE_WHITELISTED_HOST) { + + nsAutoCString asciiHost; + if (NS_SUCCEEDED(info->mFixedURI->GetAsciiHost(asciiHost)) && + !asciiHost.IsEmpty()) { + + uint32_t dotLoc = uint32_t(asciiHost.FindChar('.')); + + if ((dotLoc == uint32_t(kNotFound) || dotLoc == asciiHost.Length() - 1)) { + if (IsDomainWhitelisted(asciiHost, dotLoc)) { + info->mPreferredURI = info->mFixedURI; + } + } else { + info->mPreferredURI = info->mFixedURI; + } + } + } else { + info->mPreferredURI = info->mFixedURI; + } + + return NS_OK; + } + // If we still haven't been able to construct a valid URI, try to force a // keyword match. This catches search strings with '.' or ':' in them. - if (info->mFixedURI) - { - info->mPreferredURI = info->mFixedURI; - } - else if (sFixupKeywords && (aFixupFlags & FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP)) - { + if (sFixupKeywords && (aFixupFlags & FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP)) { rv = KeywordToURI(aStringURI, aPostData, getter_AddRefs(info->mPreferredURI)); if (NS_SUCCEEDED(rv) && info->mPreferredURI) { @@ -964,26 +985,17 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString, (dotLoc == lastDotLoc && (dotLoc == 0 || dotLoc == aURIString.Length() - 1))) && colonLoc == uint32_t(kNotFound) && qMarkLoc == uint32_t(kNotFound)) { + nsAutoCString asciiHost; if (aFixupInfo->mFixedURI && NS_SUCCEEDED(aFixupInfo->mFixedURI->GetAsciiHost(asciiHost)) && - !asciiHost.IsEmpty()) - { - // Check if this domain is whitelisted as an actual - // domain (which will prevent a keyword query) - // NB: any processing of the host here should stay in sync with - // code in the front-end(s) that set the pref. - nsAutoCString pref("browser.fixup.domainwhitelist."); - if (dotLoc == aURIString.Length() - 1) { - pref.Append(Substring(asciiHost, 0, asciiHost.Length() - 1)); - } else { - pref.Append(asciiHost); - } - if (Preferences::GetBool(pref.get(), false)) - { + !asciiHost.IsEmpty()) { + + if (IsDomainWhitelisted(asciiHost, dotLoc)) { return; } } + // If we get here, we don't have a valid URI, or we did but the // host is not whitelisted, so we do a keyword search *anyway*: rv = KeywordToURI(aFixupInfo->mOriginalInput, aPostData, @@ -995,6 +1007,25 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString, } } +bool nsDefaultURIFixup::IsDomainWhitelisted(const nsAutoCString aAsciiHost, + const uint32_t aDotLoc) +{ + // Check if this domain is whitelisted as an actual + // domain (which will prevent a keyword query) + // NB: any processing of the host here should stay in sync with + // code in the front-end(s) that set the pref. + + nsAutoCString pref("browser.fixup.domainwhitelist."); + + if (aDotLoc == aAsciiHost.Length() - 1) { + pref.Append(Substring(aAsciiHost, 0, aAsciiHost.Length() - 1)); + } else { + pref.Append(aAsciiHost); + } + + return Preferences::GetBool(pref.get(), false); +} + nsresult NS_NewURIFixup(nsIURIFixup **aURIFixup) { diff --git a/docshell/base/nsDefaultURIFixup.h b/docshell/base/nsDefaultURIFixup.h index ab92e242bcd..1088349ff59 100644 --- a/docshell/base/nsDefaultURIFixup.h +++ b/docshell/base/nsDefaultURIFixup.h @@ -37,6 +37,8 @@ private: bool PossiblyHostPortUrl(const nsACString& aUrl); bool MakeAlternateURI(nsIURI *aURI); bool IsLikelyFTP(const nsCString& aHostSpec); + bool IsDomainWhitelisted(const nsAutoCString aAsciiHost, + const uint32_t aDotLoc); }; class nsDefaultURIFixupInfo : public nsIURIFixupInfo diff --git a/docshell/base/nsIURIFixup.idl b/docshell/base/nsIURIFixup.idl index 71a24d37a12..7384f8c99d8 100644 --- a/docshell/base/nsIURIFixup.idl +++ b/docshell/base/nsIURIFixup.idl @@ -63,7 +63,7 @@ interface nsIURIFixupInfo : nsISupports /** * Interface implemented by objects capable of fixing up strings into URIs */ -[scriptable, uuid(80d4932e-bb2e-4afb-98e0-de9cc9ea7d82)] +[scriptable, uuid(49298f2b-3630-4874-aecc-522300a7fead)] interface nsIURIFixup : nsISupports { /** No fixup flags. */ @@ -83,12 +83,18 @@ interface nsIURIFixup : nsISupports const unsigned long FIXUP_FLAGS_MAKE_ALTERNATE_URI = 2; /** + * For an input that may be just a domain with only 1 level (eg, "mozilla"), + * require that the host be whitelisted. + * + * Overridden by FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP. + */ + const unsigned long FIXUP_FLAG_REQUIRE_WHITELISTED_HOST = 4; + + /* * Fix common scheme typos. */ const unsigned long FIXUP_FLAG_FIX_SCHEME_TYPOS = 8; - /* Note that flag 4 is available. */ - /** * Converts an internal URI (e.g. a wyciwyg URI) into one which we can * expose to the user, for example on the URL bar. diff --git a/docshell/test/unit/test_nsDefaultURIFixup_info.js b/docshell/test/unit/test_nsDefaultURIFixup_info.js index c63f5cb2207..47c833d1265 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_info.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js @@ -3,7 +3,8 @@ let urifixup = Cc["@mozilla.org/docshell/urifixup;1"]. Components.utils.import("resource://gre/modules/Services.jsm"); -let prefList = ["browser.fixup.typo.scheme", "keyword.enabled"]; +let prefList = ["browser.fixup.typo.scheme", "keyword.enabled", + "browser.fixup.domainwhitelist.whitelisted"]; for (let pref of prefList) { Services.prefs.setBoolPref(pref, true); } @@ -34,7 +35,8 @@ do_register_cleanup(function() { let flagInputs = [ urifixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP, urifixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI, - urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS + urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS, + urifixup.FIXUP_FLAG_REQUIRE_WHITELISTED_HOST, ]; flagInputs.concat([ @@ -44,42 +46,191 @@ flagInputs.concat([ flagInputs[0] | flagInputs[1] | flagInputs[2] ]); -let testcases = [ - ["http://www.mozilla.org", "http://www.mozilla.org/", null, false, false], - ["http://127.0.0.1/", "http://127.0.0.1/", null, false, false], - ["file:///foo/bar", "file:///foo/bar", null, false, false], - ["://www.mozilla.org", "http://www.mozilla.org/", null, false, true], - ["www.mozilla.org", "http://www.mozilla.org/", null, false, true], - ["http://mozilla/", "http://mozilla/", "http://www.mozilla.com/", false, false], - ["http://test./", "http://test./", "http://www.test./", false, false], - ["127.0.0.1", "http://127.0.0.1/", null, false, true], - ["1234", "http://1234/", "http://www.1234.com/", true, true], - ["host/foo.txt", "http://host/foo.txt", "http://www.host.com/foo.txt", false, true], - ["mozilla", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["test.", "http://test./", "http://www.test./", true, true], - [".test", "http://.test/", "http://www..test/", true, true], - ["mozilla is amazing", null, null, true, true], - ["mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], - [" mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["mozilla \\", null, null, true, true], - ["mozilla \\ foo.txt", null, null, true, true], - ["mozilla \\\r foo.txt", null, null, true, true], - ["mozilla\n", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["mozilla \r\n", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["moz\r\nfirefox\nos\r", "http://mozfirefoxos/", "http://www.mozfirefoxos.com/", true, true], - ["moz\r\n firefox\n", null, null, true, true], - ["", null, null, true, true], - ["[]", null, null, true, true] -]; +/* + The following properties are supported for these test cases: + { + input: "", // Input string, required + fixedURI: "", // Expected fixedURI + alternateURI: "", // Expected alternateURI + keywordLookup: false, // Whether a keyword lookup is expected + protocolChange: false, // Whether a protocol change is expected + affectedByWhitelist: false, // Whether the input host is affected by the whitelist + inWhitelist: false, // Whether the input host is in the whitelist + } +*/ +let testcases = [ { + input: "http://www.mozilla.org", + fixedURI: "http://www.mozilla.org/", + }, { + input: "http://127.0.0.1/", + fixedURI: "http://127.0.0.1/", + }, { + input: "file:///foo/bar", + fixedURI: "file:///foo/bar", + }, { + input: "://www.mozilla.org", + fixedURI: "http://www.mozilla.org/", + protocolChange: true, + }, { + input: "www.mozilla.org", + fixedURI: "http://www.mozilla.org/", + protocolChange: true, + }, { + input: "http://mozilla/", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + }, { + input: "http://test./", + fixedURI: "http://test./", + alternateURI: "http://www.test./", + }, { + input: "127.0.0.1", + fixedURI: "http://127.0.0.1/", + protocolChange: true, + }, { + input: "1234", + fixedURI: "http://1234/", + alternateURI: "http://www.1234.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "host/foo.txt", + fixedURI: "http://host/foo.txt", + alternateURI: "http://www.host.com/foo.txt", + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "test.", + fixedURI: "http://test./", + alternateURI: "http://www.test./", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: ".test", + fixedURI: "http://.test/", + alternateURI: "http://www..test/", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla is amazing", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla ", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: " mozilla ", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla \\", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla \\ foo.txt", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla \\\r foo.txt", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla\n", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla \r\n", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "moz\r\nfirefox\nos\r", + fixedURI: "http://mozfirefoxos/", + alternateURI: "http://www.mozfirefoxos.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "moz\r\n firefox\n", + keywordLookup: true, + protocolChange: true, + }, { + input: "", + keywordLookup: true, + protocolChange: true, + }, { + input: "[]", + keywordLookup: true, + protocolChange: true, + }, { + input: "http://whitelisted/", + fixedURI: "http://whitelisted/", + alternateURI: "http://www.whitelisted.com/", + affectedByWhitelist: true, + inWhitelist: true, + }]; if (Services.appinfo.OS.toLowerCase().startsWith("win")) { - testcases.push(["C:\\some\\file.txt", "file:///C:/some/file.txt", null, false, true]); - testcases.push(["//mozilla", "http://mozilla/", "http://www.mozilla.com/", false, true]); - testcases.push(["mozilla\\", "http://mozilla/", "http://www.mozilla.com/", true, true]); + testcases.push({ + input: "C:\\some\\file.txt", + fixedURI: "file:///C:/some/file.txt", + protocolChange: true, + }); + testcases.push({ + input: "//mozilla", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + protocolChange: true, + affectedByWhitelist: true, + }); + testcases.push({ + input: "mozilla\\", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }); } else { - testcases.push(["/some/file.txt", "file:///some/file.txt", null, false, true]); - testcases.push(["//mozilla", "file:////mozilla", null, false, true]); - testcases.push(["mozilla\\", "http://mozilla\\/", "http://www.mozilla/", true, true]); + testcases.push({ + input: "/some/file.txt", + fixedURI: "file:///some/file.txt", + protocolChange: true, + }); + testcases.push({ + input: "//mozilla", + fixedURI: "file:////mozilla", + protocolChange: true, + }); + testcases.push({ + input: "mozilla\\", + fixedURI: "http://mozilla\\/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + }); } function sanitize(input) { @@ -87,8 +238,20 @@ function sanitize(input) { } function run_test() { - for (let [testInput, expectedFixedURI, alternativeURI, - expectKeywordLookup, expectProtocolChange] of testcases) { + for (let { input: testInput, + fixedURI: expectedFixedURI, + alternateURI: alternativeURI, + keywordLookup: expectKeywordLookup, + protocolChange: expectProtocolChange, + affectedByWhitelist: affectedByWhitelist, + inWhitelist: inWhitelist } of testcases) { + + // Explicitly force these into a boolean + expectKeywordLookup = !!expectKeywordLookup; + expectProtocolChange = !!expectProtocolChange; + affectedByWhitelist = !!affectedByWhitelist; + inWhitelist = !!inWhitelist; + for (let flags of flagInputs) { let info; let fixupURIOnly = null; @@ -109,10 +272,12 @@ function run_test() { continue; } - do_print("Checking " + testInput + " with flags " + flags); + do_print("Checking \"" + testInput + "\" with flags " + flags); // Both APIs should then also be using the same spec. - do_check_eq(fixupURIOnly.spec, info.preferredURI.spec); + do_check_eq(!!fixupURIOnly, !!info.preferredURI); + if (fixupURIOnly) + do_check_eq(fixupURIOnly.spec, info.preferredURI.spec); let isFileURL = expectedFixedURI && expectedFixedURI.startsWith("file"); @@ -131,10 +296,25 @@ function run_test() { do_check_eq(info.fixupCreatedAlternateURI, makeAlternativeURI && alternativeURI != null); // Check the preferred URI - if (couldDoKeywordLookup && expectKeywordLookup) { + let requiresWhitelistedDomain = flags & urifixup.FIXUP_FLAG_REQUIRE_WHITELISTED_HOST + if (couldDoKeywordLookup) { + if (expectKeywordLookup) { + if (!affectedByWhitelist || (affectedByWhitelist && !inWhitelist)) { let urlparamInput = encodeURIComponent(sanitize(testInput)).replace("%20", "+", "g"); let searchURL = kSearchEngineURL.replace("{searchTerms}", urlparamInput); do_check_eq(info.preferredURI.spec, searchURL); + } else { + do_check_eq(info.preferredURI, null); + } + } else { + do_check_eq(info.preferredURI.spec, info.fixedURI.spec); + } + } else if (requiresWhitelistedDomain) { + // Not a keyword search, but we want to enforce the host whitelist + if (!affectedByWhitelist || (affectedByWhitelist && inWhitelist)) + do_check_eq(info.preferredURI.spec, info.fixedURI.spec); + else + do_check_eq(info.preferredURI, null); } else { // In these cases, we should never be doing a keyword lookup and // the fixed URI should be preferred: From 3dc03ef4b4fe35e7ed540900f86bbe2b96ffe64a Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Sun, 7 Sep 2014 21:00:33 +0530 Subject: [PATCH 13/60] Backed out changeset 7f58c77bb165 (bug 1057186) for xpshell bustage --- docshell/base/nsDefaultURIFixup.cpp | 71 ++--- docshell/base/nsDefaultURIFixup.h | 2 - docshell/base/nsIURIFixup.idl | 12 +- .../test/unit/test_nsDefaultURIFixup_info.js | 260 +++--------------- 4 files changed, 63 insertions(+), 282 deletions(-) diff --git a/docshell/base/nsDefaultURIFixup.cpp b/docshell/base/nsDefaultURIFixup.cpp index f233c03d621..0061f3ea886 100644 --- a/docshell/base/nsDefaultURIFixup.cpp +++ b/docshell/base/nsDefaultURIFixup.cpp @@ -386,35 +386,14 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup info->mFixupCreatedAlternateURI = MakeAlternateURI(info->mFixedURI); } - // If there is no relevent dot in the host, do we require the domain to - // be whitelisted? - if (info->mFixedURI) { - if (aFixupFlags & FIXUP_FLAG_REQUIRE_WHITELISTED_HOST) { - - nsAutoCString asciiHost; - if (NS_SUCCEEDED(info->mFixedURI->GetAsciiHost(asciiHost)) && - !asciiHost.IsEmpty()) { - - uint32_t dotLoc = uint32_t(asciiHost.FindChar('.')); - - if ((dotLoc == uint32_t(kNotFound) || dotLoc == asciiHost.Length() - 1)) { - if (IsDomainWhitelisted(asciiHost, dotLoc)) { - info->mPreferredURI = info->mFixedURI; - } - } else { - info->mPreferredURI = info->mFixedURI; - } - } - } else { - info->mPreferredURI = info->mFixedURI; - } - - return NS_OK; - } - // If we still haven't been able to construct a valid URI, try to force a // keyword match. This catches search strings with '.' or ':' in them. - if (sFixupKeywords && (aFixupFlags & FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP)) { + if (info->mFixedURI) + { + info->mPreferredURI = info->mFixedURI; + } + else if (sFixupKeywords && (aFixupFlags & FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP)) + { rv = KeywordToURI(aStringURI, aPostData, getter_AddRefs(info->mPreferredURI)); if (NS_SUCCEEDED(rv) && info->mPreferredURI) { @@ -985,17 +964,26 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString, (dotLoc == lastDotLoc && (dotLoc == 0 || dotLoc == aURIString.Length() - 1))) && colonLoc == uint32_t(kNotFound) && qMarkLoc == uint32_t(kNotFound)) { - nsAutoCString asciiHost; if (aFixupInfo->mFixedURI && NS_SUCCEEDED(aFixupInfo->mFixedURI->GetAsciiHost(asciiHost)) && - !asciiHost.IsEmpty()) { - - if (IsDomainWhitelisted(asciiHost, dotLoc)) { + !asciiHost.IsEmpty()) + { + // Check if this domain is whitelisted as an actual + // domain (which will prevent a keyword query) + // NB: any processing of the host here should stay in sync with + // code in the front-end(s) that set the pref. + nsAutoCString pref("browser.fixup.domainwhitelist."); + if (dotLoc == aURIString.Length() - 1) { + pref.Append(Substring(asciiHost, 0, asciiHost.Length() - 1)); + } else { + pref.Append(asciiHost); + } + if (Preferences::GetBool(pref.get(), false)) + { return; } } - // If we get here, we don't have a valid URI, or we did but the // host is not whitelisted, so we do a keyword search *anyway*: rv = KeywordToURI(aFixupInfo->mOriginalInput, aPostData, @@ -1007,25 +995,6 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString, } } -bool nsDefaultURIFixup::IsDomainWhitelisted(const nsAutoCString aAsciiHost, - const uint32_t aDotLoc) -{ - // Check if this domain is whitelisted as an actual - // domain (which will prevent a keyword query) - // NB: any processing of the host here should stay in sync with - // code in the front-end(s) that set the pref. - - nsAutoCString pref("browser.fixup.domainwhitelist."); - - if (aDotLoc == aAsciiHost.Length() - 1) { - pref.Append(Substring(aAsciiHost, 0, aAsciiHost.Length() - 1)); - } else { - pref.Append(aAsciiHost); - } - - return Preferences::GetBool(pref.get(), false); -} - nsresult NS_NewURIFixup(nsIURIFixup **aURIFixup) { diff --git a/docshell/base/nsDefaultURIFixup.h b/docshell/base/nsDefaultURIFixup.h index 1088349ff59..ab92e242bcd 100644 --- a/docshell/base/nsDefaultURIFixup.h +++ b/docshell/base/nsDefaultURIFixup.h @@ -37,8 +37,6 @@ private: bool PossiblyHostPortUrl(const nsACString& aUrl); bool MakeAlternateURI(nsIURI *aURI); bool IsLikelyFTP(const nsCString& aHostSpec); - bool IsDomainWhitelisted(const nsAutoCString aAsciiHost, - const uint32_t aDotLoc); }; class nsDefaultURIFixupInfo : public nsIURIFixupInfo diff --git a/docshell/base/nsIURIFixup.idl b/docshell/base/nsIURIFixup.idl index 7384f8c99d8..71a24d37a12 100644 --- a/docshell/base/nsIURIFixup.idl +++ b/docshell/base/nsIURIFixup.idl @@ -63,7 +63,7 @@ interface nsIURIFixupInfo : nsISupports /** * Interface implemented by objects capable of fixing up strings into URIs */ -[scriptable, uuid(49298f2b-3630-4874-aecc-522300a7fead)] +[scriptable, uuid(80d4932e-bb2e-4afb-98e0-de9cc9ea7d82)] interface nsIURIFixup : nsISupports { /** No fixup flags. */ @@ -83,18 +83,12 @@ interface nsIURIFixup : nsISupports const unsigned long FIXUP_FLAGS_MAKE_ALTERNATE_URI = 2; /** - * For an input that may be just a domain with only 1 level (eg, "mozilla"), - * require that the host be whitelisted. - * - * Overridden by FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP. - */ - const unsigned long FIXUP_FLAG_REQUIRE_WHITELISTED_HOST = 4; - - /* * Fix common scheme typos. */ const unsigned long FIXUP_FLAG_FIX_SCHEME_TYPOS = 8; + /* Note that flag 4 is available. */ + /** * Converts an internal URI (e.g. a wyciwyg URI) into one which we can * expose to the user, for example on the URL bar. diff --git a/docshell/test/unit/test_nsDefaultURIFixup_info.js b/docshell/test/unit/test_nsDefaultURIFixup_info.js index 47c833d1265..c63f5cb2207 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_info.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js @@ -3,8 +3,7 @@ let urifixup = Cc["@mozilla.org/docshell/urifixup;1"]. Components.utils.import("resource://gre/modules/Services.jsm"); -let prefList = ["browser.fixup.typo.scheme", "keyword.enabled", - "browser.fixup.domainwhitelist.whitelisted"]; +let prefList = ["browser.fixup.typo.scheme", "keyword.enabled"]; for (let pref of prefList) { Services.prefs.setBoolPref(pref, true); } @@ -35,8 +34,7 @@ do_register_cleanup(function() { let flagInputs = [ urifixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP, urifixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI, - urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS, - urifixup.FIXUP_FLAG_REQUIRE_WHITELISTED_HOST, + urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS ]; flagInputs.concat([ @@ -46,191 +44,42 @@ flagInputs.concat([ flagInputs[0] | flagInputs[1] | flagInputs[2] ]); -/* - The following properties are supported for these test cases: - { - input: "", // Input string, required - fixedURI: "", // Expected fixedURI - alternateURI: "", // Expected alternateURI - keywordLookup: false, // Whether a keyword lookup is expected - protocolChange: false, // Whether a protocol change is expected - affectedByWhitelist: false, // Whether the input host is affected by the whitelist - inWhitelist: false, // Whether the input host is in the whitelist - } -*/ -let testcases = [ { - input: "http://www.mozilla.org", - fixedURI: "http://www.mozilla.org/", - }, { - input: "http://127.0.0.1/", - fixedURI: "http://127.0.0.1/", - }, { - input: "file:///foo/bar", - fixedURI: "file:///foo/bar", - }, { - input: "://www.mozilla.org", - fixedURI: "http://www.mozilla.org/", - protocolChange: true, - }, { - input: "www.mozilla.org", - fixedURI: "http://www.mozilla.org/", - protocolChange: true, - }, { - input: "http://mozilla/", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - }, { - input: "http://test./", - fixedURI: "http://test./", - alternateURI: "http://www.test./", - }, { - input: "127.0.0.1", - fixedURI: "http://127.0.0.1/", - protocolChange: true, - }, { - input: "1234", - fixedURI: "http://1234/", - alternateURI: "http://www.1234.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "host/foo.txt", - fixedURI: "http://host/foo.txt", - alternateURI: "http://www.host.com/foo.txt", - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "mozilla", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "test.", - fixedURI: "http://test./", - alternateURI: "http://www.test./", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: ".test", - fixedURI: "http://.test/", - alternateURI: "http://www..test/", - keywordLookup: true, - protocolChange: true, - }, { - input: "mozilla is amazing", - keywordLookup: true, - protocolChange: true, - }, { - input: "mozilla ", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: " mozilla ", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "mozilla \\", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "mozilla \\ foo.txt", - keywordLookup: true, - protocolChange: true, - }, { - input: "mozilla \\\r foo.txt", - keywordLookup: true, - protocolChange: true, - }, { - input: "mozilla\n", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "mozilla \r\n", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "moz\r\nfirefox\nos\r", - fixedURI: "http://mozfirefoxos/", - alternateURI: "http://www.mozfirefoxos.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }, { - input: "moz\r\n firefox\n", - keywordLookup: true, - protocolChange: true, - }, { - input: "", - keywordLookup: true, - protocolChange: true, - }, { - input: "[]", - keywordLookup: true, - protocolChange: true, - }, { - input: "http://whitelisted/", - fixedURI: "http://whitelisted/", - alternateURI: "http://www.whitelisted.com/", - affectedByWhitelist: true, - inWhitelist: true, - }]; +let testcases = [ + ["http://www.mozilla.org", "http://www.mozilla.org/", null, false, false], + ["http://127.0.0.1/", "http://127.0.0.1/", null, false, false], + ["file:///foo/bar", "file:///foo/bar", null, false, false], + ["://www.mozilla.org", "http://www.mozilla.org/", null, false, true], + ["www.mozilla.org", "http://www.mozilla.org/", null, false, true], + ["http://mozilla/", "http://mozilla/", "http://www.mozilla.com/", false, false], + ["http://test./", "http://test./", "http://www.test./", false, false], + ["127.0.0.1", "http://127.0.0.1/", null, false, true], + ["1234", "http://1234/", "http://www.1234.com/", true, true], + ["host/foo.txt", "http://host/foo.txt", "http://www.host.com/foo.txt", false, true], + ["mozilla", "http://mozilla/", "http://www.mozilla.com/", true, true], + ["test.", "http://test./", "http://www.test./", true, true], + [".test", "http://.test/", "http://www..test/", true, true], + ["mozilla is amazing", null, null, true, true], + ["mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], + [" mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], + ["mozilla \\", null, null, true, true], + ["mozilla \\ foo.txt", null, null, true, true], + ["mozilla \\\r foo.txt", null, null, true, true], + ["mozilla\n", "http://mozilla/", "http://www.mozilla.com/", true, true], + ["mozilla \r\n", "http://mozilla/", "http://www.mozilla.com/", true, true], + ["moz\r\nfirefox\nos\r", "http://mozfirefoxos/", "http://www.mozfirefoxos.com/", true, true], + ["moz\r\n firefox\n", null, null, true, true], + ["", null, null, true, true], + ["[]", null, null, true, true] +]; if (Services.appinfo.OS.toLowerCase().startsWith("win")) { - testcases.push({ - input: "C:\\some\\file.txt", - fixedURI: "file:///C:/some/file.txt", - protocolChange: true, - }); - testcases.push({ - input: "//mozilla", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - protocolChange: true, - affectedByWhitelist: true, - }); - testcases.push({ - input: "mozilla\\", - fixedURI: "http://mozilla/", - alternateURI: "http://www.mozilla.com/", - keywordLookup: true, - protocolChange: true, - affectedByWhitelist: true, - }); + testcases.push(["C:\\some\\file.txt", "file:///C:/some/file.txt", null, false, true]); + testcases.push(["//mozilla", "http://mozilla/", "http://www.mozilla.com/", false, true]); + testcases.push(["mozilla\\", "http://mozilla/", "http://www.mozilla.com/", true, true]); } else { - testcases.push({ - input: "/some/file.txt", - fixedURI: "file:///some/file.txt", - protocolChange: true, - }); - testcases.push({ - input: "//mozilla", - fixedURI: "file:////mozilla", - protocolChange: true, - }); - testcases.push({ - input: "mozilla\\", - fixedURI: "http://mozilla\\/", - alternateURI: "http://www.mozilla.com/", - keywordLookup: true, - protocolChange: true, - }); + testcases.push(["/some/file.txt", "file:///some/file.txt", null, false, true]); + testcases.push(["//mozilla", "file:////mozilla", null, false, true]); + testcases.push(["mozilla\\", "http://mozilla\\/", "http://www.mozilla/", true, true]); } function sanitize(input) { @@ -238,20 +87,8 @@ function sanitize(input) { } function run_test() { - for (let { input: testInput, - fixedURI: expectedFixedURI, - alternateURI: alternativeURI, - keywordLookup: expectKeywordLookup, - protocolChange: expectProtocolChange, - affectedByWhitelist: affectedByWhitelist, - inWhitelist: inWhitelist } of testcases) { - - // Explicitly force these into a boolean - expectKeywordLookup = !!expectKeywordLookup; - expectProtocolChange = !!expectProtocolChange; - affectedByWhitelist = !!affectedByWhitelist; - inWhitelist = !!inWhitelist; - + for (let [testInput, expectedFixedURI, alternativeURI, + expectKeywordLookup, expectProtocolChange] of testcases) { for (let flags of flagInputs) { let info; let fixupURIOnly = null; @@ -272,12 +109,10 @@ function run_test() { continue; } - do_print("Checking \"" + testInput + "\" with flags " + flags); + do_print("Checking " + testInput + " with flags " + flags); // Both APIs should then also be using the same spec. - do_check_eq(!!fixupURIOnly, !!info.preferredURI); - if (fixupURIOnly) - do_check_eq(fixupURIOnly.spec, info.preferredURI.spec); + do_check_eq(fixupURIOnly.spec, info.preferredURI.spec); let isFileURL = expectedFixedURI && expectedFixedURI.startsWith("file"); @@ -296,25 +131,10 @@ function run_test() { do_check_eq(info.fixupCreatedAlternateURI, makeAlternativeURI && alternativeURI != null); // Check the preferred URI - let requiresWhitelistedDomain = flags & urifixup.FIXUP_FLAG_REQUIRE_WHITELISTED_HOST - if (couldDoKeywordLookup) { - if (expectKeywordLookup) { - if (!affectedByWhitelist || (affectedByWhitelist && !inWhitelist)) { + if (couldDoKeywordLookup && expectKeywordLookup) { let urlparamInput = encodeURIComponent(sanitize(testInput)).replace("%20", "+", "g"); let searchURL = kSearchEngineURL.replace("{searchTerms}", urlparamInput); do_check_eq(info.preferredURI.spec, searchURL); - } else { - do_check_eq(info.preferredURI, null); - } - } else { - do_check_eq(info.preferredURI.spec, info.fixedURI.spec); - } - } else if (requiresWhitelistedDomain) { - // Not a keyword search, but we want to enforce the host whitelist - if (!affectedByWhitelist || (affectedByWhitelist && inWhitelist)) - do_check_eq(info.preferredURI.spec, info.fixedURI.spec); - else - do_check_eq(info.preferredURI, null); } else { // In these cases, we should never be doing a keyword lookup and // the fixed URI should be preferred: From 08350ab349800a9c36a9a34588bf559410fa34b0 Mon Sep 17 00:00:00 2001 From: Blair McBride Date: Fri, 29 Aug 2014 15:25:02 +1200 Subject: [PATCH 14/60] Bug 1057186 - Add a way to specify that nsDefaultURIFixup should obey the domain whitelist when not using keyword searches. r=smaug --HG-- extra : transplant_source : %92E.%2CV%E0%80%A4%B6%1B%E8D%91%0Ft%F3%5D%13%88%96 --- docshell/base/nsDefaultURIFixup.cpp | 71 +++-- docshell/base/nsDefaultURIFixup.h | 2 + docshell/base/nsIURIFixup.idl | 12 +- .../test/unit/test_nsDefaultURIFixup_info.js | 261 +++++++++++++++--- 4 files changed, 283 insertions(+), 63 deletions(-) diff --git a/docshell/base/nsDefaultURIFixup.cpp b/docshell/base/nsDefaultURIFixup.cpp index 0061f3ea886..f233c03d621 100644 --- a/docshell/base/nsDefaultURIFixup.cpp +++ b/docshell/base/nsDefaultURIFixup.cpp @@ -386,14 +386,35 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup info->mFixupCreatedAlternateURI = MakeAlternateURI(info->mFixedURI); } + // If there is no relevent dot in the host, do we require the domain to + // be whitelisted? + if (info->mFixedURI) { + if (aFixupFlags & FIXUP_FLAG_REQUIRE_WHITELISTED_HOST) { + + nsAutoCString asciiHost; + if (NS_SUCCEEDED(info->mFixedURI->GetAsciiHost(asciiHost)) && + !asciiHost.IsEmpty()) { + + uint32_t dotLoc = uint32_t(asciiHost.FindChar('.')); + + if ((dotLoc == uint32_t(kNotFound) || dotLoc == asciiHost.Length() - 1)) { + if (IsDomainWhitelisted(asciiHost, dotLoc)) { + info->mPreferredURI = info->mFixedURI; + } + } else { + info->mPreferredURI = info->mFixedURI; + } + } + } else { + info->mPreferredURI = info->mFixedURI; + } + + return NS_OK; + } + // If we still haven't been able to construct a valid URI, try to force a // keyword match. This catches search strings with '.' or ':' in them. - if (info->mFixedURI) - { - info->mPreferredURI = info->mFixedURI; - } - else if (sFixupKeywords && (aFixupFlags & FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP)) - { + if (sFixupKeywords && (aFixupFlags & FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP)) { rv = KeywordToURI(aStringURI, aPostData, getter_AddRefs(info->mPreferredURI)); if (NS_SUCCEEDED(rv) && info->mPreferredURI) { @@ -964,26 +985,17 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString, (dotLoc == lastDotLoc && (dotLoc == 0 || dotLoc == aURIString.Length() - 1))) && colonLoc == uint32_t(kNotFound) && qMarkLoc == uint32_t(kNotFound)) { + nsAutoCString asciiHost; if (aFixupInfo->mFixedURI && NS_SUCCEEDED(aFixupInfo->mFixedURI->GetAsciiHost(asciiHost)) && - !asciiHost.IsEmpty()) - { - // Check if this domain is whitelisted as an actual - // domain (which will prevent a keyword query) - // NB: any processing of the host here should stay in sync with - // code in the front-end(s) that set the pref. - nsAutoCString pref("browser.fixup.domainwhitelist."); - if (dotLoc == aURIString.Length() - 1) { - pref.Append(Substring(asciiHost, 0, asciiHost.Length() - 1)); - } else { - pref.Append(asciiHost); - } - if (Preferences::GetBool(pref.get(), false)) - { + !asciiHost.IsEmpty()) { + + if (IsDomainWhitelisted(asciiHost, dotLoc)) { return; } } + // If we get here, we don't have a valid URI, or we did but the // host is not whitelisted, so we do a keyword search *anyway*: rv = KeywordToURI(aFixupInfo->mOriginalInput, aPostData, @@ -995,6 +1007,25 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString, } } +bool nsDefaultURIFixup::IsDomainWhitelisted(const nsAutoCString aAsciiHost, + const uint32_t aDotLoc) +{ + // Check if this domain is whitelisted as an actual + // domain (which will prevent a keyword query) + // NB: any processing of the host here should stay in sync with + // code in the front-end(s) that set the pref. + + nsAutoCString pref("browser.fixup.domainwhitelist."); + + if (aDotLoc == aAsciiHost.Length() - 1) { + pref.Append(Substring(aAsciiHost, 0, aAsciiHost.Length() - 1)); + } else { + pref.Append(aAsciiHost); + } + + return Preferences::GetBool(pref.get(), false); +} + nsresult NS_NewURIFixup(nsIURIFixup **aURIFixup) { diff --git a/docshell/base/nsDefaultURIFixup.h b/docshell/base/nsDefaultURIFixup.h index ab92e242bcd..1088349ff59 100644 --- a/docshell/base/nsDefaultURIFixup.h +++ b/docshell/base/nsDefaultURIFixup.h @@ -37,6 +37,8 @@ private: bool PossiblyHostPortUrl(const nsACString& aUrl); bool MakeAlternateURI(nsIURI *aURI); bool IsLikelyFTP(const nsCString& aHostSpec); + bool IsDomainWhitelisted(const nsAutoCString aAsciiHost, + const uint32_t aDotLoc); }; class nsDefaultURIFixupInfo : public nsIURIFixupInfo diff --git a/docshell/base/nsIURIFixup.idl b/docshell/base/nsIURIFixup.idl index 71a24d37a12..7384f8c99d8 100644 --- a/docshell/base/nsIURIFixup.idl +++ b/docshell/base/nsIURIFixup.idl @@ -63,7 +63,7 @@ interface nsIURIFixupInfo : nsISupports /** * Interface implemented by objects capable of fixing up strings into URIs */ -[scriptable, uuid(80d4932e-bb2e-4afb-98e0-de9cc9ea7d82)] +[scriptable, uuid(49298f2b-3630-4874-aecc-522300a7fead)] interface nsIURIFixup : nsISupports { /** No fixup flags. */ @@ -83,12 +83,18 @@ interface nsIURIFixup : nsISupports const unsigned long FIXUP_FLAGS_MAKE_ALTERNATE_URI = 2; /** + * For an input that may be just a domain with only 1 level (eg, "mozilla"), + * require that the host be whitelisted. + * + * Overridden by FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP. + */ + const unsigned long FIXUP_FLAG_REQUIRE_WHITELISTED_HOST = 4; + + /* * Fix common scheme typos. */ const unsigned long FIXUP_FLAG_FIX_SCHEME_TYPOS = 8; - /* Note that flag 4 is available. */ - /** * Converts an internal URI (e.g. a wyciwyg URI) into one which we can * expose to the user, for example on the URL bar. diff --git a/docshell/test/unit/test_nsDefaultURIFixup_info.js b/docshell/test/unit/test_nsDefaultURIFixup_info.js index c63f5cb2207..fb1b7ddb67b 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_info.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js @@ -3,7 +3,8 @@ let urifixup = Cc["@mozilla.org/docshell/urifixup;1"]. Components.utils.import("resource://gre/modules/Services.jsm"); -let prefList = ["browser.fixup.typo.scheme", "keyword.enabled"]; +let prefList = ["browser.fixup.typo.scheme", "keyword.enabled", + "browser.fixup.domainwhitelist.whitelisted"]; for (let pref of prefList) { Services.prefs.setBoolPref(pref, true); } @@ -34,7 +35,8 @@ do_register_cleanup(function() { let flagInputs = [ urifixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP, urifixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI, - urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS + urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS, + urifixup.FIXUP_FLAG_REQUIRE_WHITELISTED_HOST, ]; flagInputs.concat([ @@ -44,42 +46,192 @@ flagInputs.concat([ flagInputs[0] | flagInputs[1] | flagInputs[2] ]); -let testcases = [ - ["http://www.mozilla.org", "http://www.mozilla.org/", null, false, false], - ["http://127.0.0.1/", "http://127.0.0.1/", null, false, false], - ["file:///foo/bar", "file:///foo/bar", null, false, false], - ["://www.mozilla.org", "http://www.mozilla.org/", null, false, true], - ["www.mozilla.org", "http://www.mozilla.org/", null, false, true], - ["http://mozilla/", "http://mozilla/", "http://www.mozilla.com/", false, false], - ["http://test./", "http://test./", "http://www.test./", false, false], - ["127.0.0.1", "http://127.0.0.1/", null, false, true], - ["1234", "http://1234/", "http://www.1234.com/", true, true], - ["host/foo.txt", "http://host/foo.txt", "http://www.host.com/foo.txt", false, true], - ["mozilla", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["test.", "http://test./", "http://www.test./", true, true], - [".test", "http://.test/", "http://www..test/", true, true], - ["mozilla is amazing", null, null, true, true], - ["mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], - [" mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["mozilla \\", null, null, true, true], - ["mozilla \\ foo.txt", null, null, true, true], - ["mozilla \\\r foo.txt", null, null, true, true], - ["mozilla\n", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["mozilla \r\n", "http://mozilla/", "http://www.mozilla.com/", true, true], - ["moz\r\nfirefox\nos\r", "http://mozfirefoxos/", "http://www.mozfirefoxos.com/", true, true], - ["moz\r\n firefox\n", null, null, true, true], - ["", null, null, true, true], - ["[]", null, null, true, true] -]; +/* + The following properties are supported for these test cases: + { + input: "", // Input string, required + fixedURI: "", // Expected fixedURI + alternateURI: "", // Expected alternateURI + keywordLookup: false, // Whether a keyword lookup is expected + protocolChange: false, // Whether a protocol change is expected + affectedByWhitelist: false, // Whether the input host is affected by the whitelist + inWhitelist: false, // Whether the input host is in the whitelist + } +*/ +let testcases = [ { + input: "http://www.mozilla.org", + fixedURI: "http://www.mozilla.org/", + }, { + input: "http://127.0.0.1/", + fixedURI: "http://127.0.0.1/", + }, { + input: "file:///foo/bar", + fixedURI: "file:///foo/bar", + }, { + input: "://www.mozilla.org", + fixedURI: "http://www.mozilla.org/", + protocolChange: true, + }, { + input: "www.mozilla.org", + fixedURI: "http://www.mozilla.org/", + protocolChange: true, + }, { + input: "http://mozilla/", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + }, { + input: "http://test./", + fixedURI: "http://test./", + alternateURI: "http://www.test./", + }, { + input: "127.0.0.1", + fixedURI: "http://127.0.0.1/", + protocolChange: true, + }, { + input: "1234", + fixedURI: "http://1234/", + alternateURI: "http://www.1234.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "host/foo.txt", + fixedURI: "http://host/foo.txt", + alternateURI: "http://www.host.com/foo.txt", + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "test.", + fixedURI: "http://test./", + alternateURI: "http://www.test./", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: ".test", + fixedURI: "http://.test/", + alternateURI: "http://www..test/", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla is amazing", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla ", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: " mozilla ", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla \\", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla \\ foo.txt", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla \\\r foo.txt", + keywordLookup: true, + protocolChange: true, + }, { + input: "mozilla\n", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "mozilla \r\n", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "moz\r\nfirefox\nos\r", + fixedURI: "http://mozfirefoxos/", + alternateURI: "http://www.mozfirefoxos.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }, { + input: "moz\r\n firefox\n", + keywordLookup: true, + protocolChange: true, + }, { + input: "", + keywordLookup: true, + protocolChange: true, + }, { + input: "[]", + keywordLookup: true, + protocolChange: true, + }, { + input: "http://whitelisted/", + fixedURI: "http://whitelisted/", + alternateURI: "http://www.whitelisted.com/", + affectedByWhitelist: true, + inWhitelist: true, + }]; if (Services.appinfo.OS.toLowerCase().startsWith("win")) { - testcases.push(["C:\\some\\file.txt", "file:///C:/some/file.txt", null, false, true]); - testcases.push(["//mozilla", "http://mozilla/", "http://www.mozilla.com/", false, true]); - testcases.push(["mozilla\\", "http://mozilla/", "http://www.mozilla.com/", true, true]); + testcases.push({ + input: "C:\\some\\file.txt", + fixedURI: "file:///C:/some/file.txt", + protocolChange: true, + }); + testcases.push({ + input: "//mozilla", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + protocolChange: true, + affectedByWhitelist: true, + }); + testcases.push({ + input: "mozilla\\", + fixedURI: "http://mozilla/", + alternateURI: "http://www.mozilla.com/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }); } else { - testcases.push(["/some/file.txt", "file:///some/file.txt", null, false, true]); - testcases.push(["//mozilla", "file:////mozilla", null, false, true]); - testcases.push(["mozilla\\", "http://mozilla\\/", "http://www.mozilla/", true, true]); + testcases.push({ + input: "/some/file.txt", + fixedURI: "file:///some/file.txt", + protocolChange: true, + }); + testcases.push({ + input: "//mozilla", + fixedURI: "file:////mozilla", + protocolChange: true, + }); + testcases.push({ + input: "mozilla\\", + fixedURI: "http://mozilla\\/", + alternateURI: "http://www.mozilla/", + keywordLookup: true, + protocolChange: true, + affectedByWhitelist: true, + }); } function sanitize(input) { @@ -87,8 +239,20 @@ function sanitize(input) { } function run_test() { - for (let [testInput, expectedFixedURI, alternativeURI, - expectKeywordLookup, expectProtocolChange] of testcases) { + for (let { input: testInput, + fixedURI: expectedFixedURI, + alternateURI: alternativeURI, + keywordLookup: expectKeywordLookup, + protocolChange: expectProtocolChange, + affectedByWhitelist: affectedByWhitelist, + inWhitelist: inWhitelist } of testcases) { + + // Explicitly force these into a boolean + expectKeywordLookup = !!expectKeywordLookup; + expectProtocolChange = !!expectProtocolChange; + affectedByWhitelist = !!affectedByWhitelist; + inWhitelist = !!inWhitelist; + for (let flags of flagInputs) { let info; let fixupURIOnly = null; @@ -109,10 +273,12 @@ function run_test() { continue; } - do_print("Checking " + testInput + " with flags " + flags); + do_print("Checking \"" + testInput + "\" with flags " + flags); // Both APIs should then also be using the same spec. - do_check_eq(fixupURIOnly.spec, info.preferredURI.spec); + do_check_eq(!!fixupURIOnly, !!info.preferredURI); + if (fixupURIOnly) + do_check_eq(fixupURIOnly.spec, info.preferredURI.spec); let isFileURL = expectedFixedURI && expectedFixedURI.startsWith("file"); @@ -131,10 +297,25 @@ function run_test() { do_check_eq(info.fixupCreatedAlternateURI, makeAlternativeURI && alternativeURI != null); // Check the preferred URI - if (couldDoKeywordLookup && expectKeywordLookup) { + let requiresWhitelistedDomain = flags & urifixup.FIXUP_FLAG_REQUIRE_WHITELISTED_HOST + if (couldDoKeywordLookup) { + if (expectKeywordLookup) { + if (!affectedByWhitelist || (affectedByWhitelist && !inWhitelist)) { let urlparamInput = encodeURIComponent(sanitize(testInput)).replace("%20", "+", "g"); let searchURL = kSearchEngineURL.replace("{searchTerms}", urlparamInput); do_check_eq(info.preferredURI.spec, searchURL); + } else { + do_check_eq(info.preferredURI, null); + } + } else { + do_check_eq(info.preferredURI.spec, info.fixedURI.spec); + } + } else if (requiresWhitelistedDomain) { + // Not a keyword search, but we want to enforce the host whitelist + if (!affectedByWhitelist || (affectedByWhitelist && inWhitelist)) + do_check_eq(info.preferredURI.spec, info.fixedURI.spec); + else + do_check_eq(info.preferredURI, null); } else { // In these cases, we should never be doing a keyword lookup and // the fixed URI should be preferred: From 1f43d27f2a8f24da450f224605f1549abfd36480 Mon Sep 17 00:00:00 2001 From: Willian Gustavo Veiga Date: Fri, 5 Sep 2014 15:50:00 +0200 Subject: [PATCH 15/60] Bug 992679 - Context item to open split console and log element. r=harth --- browser/devtools/inspector/inspector-panel.js | 13 ++++++++++ browser/devtools/inspector/inspector.xul | 3 +++ .../inspector/test/browser_inspector_menu.js | 24 ++++++++++++++++++- .../chrome/browser/devtools/inspector.dtd | 2 ++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/browser/devtools/inspector/inspector-panel.js b/browser/devtools/inspector/inspector-panel.js index db742577381..b3e343ce01c 100644 --- a/browser/devtools/inspector/inspector-panel.js +++ b/browser/devtools/inspector/inspector-panel.js @@ -736,6 +736,19 @@ InspectorPanel.prototype = { } }, + /** + * Show DOM properties + */ + showDOMProperties: function InspectorPanel_showDOMProperties() { + this._toolbox.openSplitConsole().then(() => { + let panel = this._toolbox.getPanel("webconsole"); + let jsterm = panel.hud.jsterm; + + jsterm.execute("inspect($0)"); + jsterm.focusInput(); + }); + }, + /** * Clear any pseudo-class locks applied to the current hierarchy. */ diff --git a/browser/devtools/inspector/inspector.xul b/browser/devtools/inspector/inspector.xul index dfae344d029..f4be54f26ea 100644 --- a/browser/devtools/inspector/inspector.xul +++ b/browser/devtools/inspector/inspector.xul @@ -55,6 +55,9 @@ + { }); let test = asyncTest(function* () { - let { inspector } = yield openInspectorForURL(TEST_URL); + let { inspector, toolbox } = yield openInspectorForURL(TEST_URL); yield testMenuItemSensitivity(); yield testPasteOuterHTMLMenuItemSensitivity(); yield testCopyMenuItems(); + yield testShowDOMProperties(); yield testPasteOuterHTMLMenu(); yield testDeleteNode(); yield testDeleteRootNode(); @@ -154,6 +155,27 @@ let test = asyncTest(function* () { } } + function* testShowDOMProperties() { + info("Testing 'Show DOM Properties' menu item."); + let showDOMPropertiesNode = inspector.panelDoc.getElementById("node-menu-showdomproperties"); + ok(showDOMPropertiesNode, "the popup menu has a show dom properties item"); + + let consoleOpened = toolbox.once("webconsole-ready"); + + info("Triggering 'Show DOM Properties' and waiting for inspector open"); + dispatchCommandEvent(showDOMPropertiesNode); + yield consoleOpened; + + let webconsoleUI = toolbox.getPanel("webconsole").hud.ui; + let messagesAdded = webconsoleUI.once("messages-added"); + yield messagesAdded; + + info("Checking if 'inspect($0)' was evaluated"); + ok(webconsoleUI.jsterm.history[0] === 'inspect($0)'); + + yield toolbox.toggleSplitConsole(); + } + function* testPasteOuterHTMLMenu() { info("Testing that 'Paste Outer HTML' menu item works."); clipboard.set("this was pasted"); diff --git a/browser/locales/en-US/chrome/browser/devtools/inspector.dtd b/browser/locales/en-US/chrome/browser/devtools/inspector.dtd index 27efa3718c8..b05ffa52b5d 100644 --- a/browser/locales/en-US/chrome/browser/devtools/inspector.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/inspector.dtd @@ -22,3 +22,5 @@ + + From 82cac652403764854dc963a1e7bf54cff34389cd Mon Sep 17 00:00:00 2001 From: Blake Winton Date: Fri, 5 Sep 2014 16:43:28 -0400 Subject: [PATCH 16/60] Bug 1036908 - Log search suggestion selections from about:home. r=mak --- browser/base/content/abouthome/aboutHome.js | 18 +++++++++++++++--- browser/base/content/browser.js | 8 ++++++-- browser/base/content/searchSuggestionUI.js | 9 +++++++++ browser/docs/UITelemetry.rst | 11 +++++++++++ browser/modules/AboutHome.jsm | 2 +- browser/modules/BrowserUITelemetry.jsm | 5 ++++- browser/modules/ContentSearch.jsm | 2 +- 7 files changed, 47 insertions(+), 8 deletions(-) diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/abouthome/aboutHome.js index 1b9e76b428e..d9ef6c16692 100644 --- a/browser/base/content/abouthome/aboutHome.js +++ b/browser/base/content/abouthome/aboutHome.js @@ -298,16 +298,28 @@ function ensureSnippetsMapThen(aCallback) function onSearchSubmit(aEvent) { - let searchTerms = document.getElementById("searchText").value; + let searchText = document.getElementById("searchText"); + let searchTerms = searchText.value; let engineName = document.documentElement.getAttribute("searchEngineName"); if (engineName && searchTerms.length > 0) { // Send an event that will perform a search and Firefox Health Report will // record that a search from about:home has occurred. - let eventData = JSON.stringify({ + + let eventData = { engineName: engineName, searchTerms: searchTerms - }); + }; + + if (searchText.hasAttribute("selection-index")) { + eventData.selection = { + index: searchText.getAttribute("selection-index"), + kind: searchText.getAttribute("selection-kind") + }; + } + + eventData = JSON.stringify(eventData); + let event = new CustomEvent("AboutHomeSearchEvent", {detail: eventData}); document.dispatchEvent(event); } diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index d07579831e0..acfb57f5230 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3122,9 +3122,13 @@ const BrowserSearch = { * @param source * (string) Where the search originated from. See the FHR * SearchesProvider for allowed values. + * @param selection [optional] + * ({index: The selected index, kind: "key" or "mouse"}) If + * the search was a suggested search, this indicates where the + * item was in the suggestion list and how the user selected it. */ - recordSearchInHealthReport: function (engine, source) { - BrowserUITelemetry.countSearchEvent(source); + recordSearchInHealthReport: function (engine, source, selection) { + BrowserUITelemetry.countSearchEvent(source, null, selection); #ifdef MOZ_SERVICES_HEALTHREPORT let reporter = Cc["@mozilla.org/datareporting/service;1"] .getService() diff --git a/browser/base/content/searchSuggestionUI.js b/browser/base/content/searchSuggestionUI.js index f5594c24cfb..5b3fa59963e 100644 --- a/browser/base/content/searchSuggestionUI.js +++ b/browser/base/content/searchSuggestionUI.js @@ -179,6 +179,13 @@ SearchSuggestionUIController.prototype = { case event.DOM_VK_RETURN: if (this.selectedIndex >= 0) { this.input.value = this.suggestionAtIndex(this.selectedIndex); + this.input.setAttribute("selection-index", this.selectedIndex); + this.input.setAttribute("selection-kind", "key"); + } else { + // If we didn't select anything, make sure to remove the attributes + // in case they were populated last time. + this.input.removeAttribute("selection-index"); + this.input.removeAttribute("selection-kind"); } this._stickyInputValue = this.input.value; this._hideSuggestions(); @@ -228,6 +235,8 @@ SearchSuggestionUIController.prototype = { let suggestion = this.suggestionAtIndex(idx); this._stickyInputValue = suggestion; this.input.value = suggestion; + this.input.setAttribute("selection-index", idx); + this.input.setAttribute("selection-kind", "mouse"); this._hideSuggestions(); if (this.onClick) { this.onClick.call(null); diff --git a/browser/docs/UITelemetry.rst b/browser/docs/UITelemetry.rst index 45f91984930..2c6dcb6df82 100644 --- a/browser/docs/UITelemetry.rst +++ b/browser/docs/UITelemetry.rst @@ -71,6 +71,17 @@ object with the following properties: - ``move`` counts the number of times an item is moved somewhere else (but not to the palette); - ``remove`` counts the number of times an item is removed to the palette; - ``reset`` counts the number of times the 'restore defaults' button is used; +- ``search`` is an object tracking searches of various types, keyed off the search + location, storing a number indicating how often the respective type of search + has happened. + - There are also two special keys that mean slightly different things. + - ``urlbar-keyword`` records searches that would have been an invalid-protocol + error, but are now keyword searches. They are also counted in the ``urlbar`` + keyword (along with all the other urlbar searches). + - ``selection`` searches records selections of search suggestions. They include + the source, the index of the selection, and the kind of selection (mouse or + enter key). Selection searches are also counted in their sources. + ``UITour`` diff --git a/browser/modules/AboutHome.jsm b/browser/modules/AboutHome.jsm index ea00029ab54..3c0d480eee6 100644 --- a/browser/modules/AboutHome.jsm +++ b/browser/modules/AboutHome.jsm @@ -191,7 +191,7 @@ let AboutHome = { let engine = Services.search.currentEngine; #ifdef MOZ_SERVICES_HEALTHREPORT - window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome"); + window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome", data.selection); #endif // Trigger a search through nsISearchEngine.getSubmission() let submission = engine.getSubmission(data.searchTerms, null, "homepage"); diff --git a/browser/modules/BrowserUITelemetry.jsm b/browser/modules/BrowserUITelemetry.jsm index 3ace39ce768..e7e5de3f281 100644 --- a/browser/modules/BrowserUITelemetry.jsm +++ b/browser/modules/BrowserUITelemetry.jsm @@ -554,11 +554,14 @@ this.BrowserUITelemetry = { this._countEvent(["customize", aEventType]); }, - countSearchEvent: function(source, query) { + countSearchEvent: function(source, query, selection) { this._countEvent(["search", source]); if ((/^[a-zA-Z]+:[^\/\\]/).test(query)) { this._countEvent(["search", "urlbar-keyword"]); } + if (selection) { + this._countEvent(["search", "selection", source, selection.index, selection.kind]); + } }, _durations: { diff --git a/browser/modules/ContentSearch.jsm b/browser/modules/ContentSearch.jsm index 02a1a8616ce..6acc6e14b6d 100644 --- a/browser/modules/ContentSearch.jsm +++ b/browser/modules/ContentSearch.jsm @@ -206,7 +206,7 @@ this.ContentSearch = { ]); let browserWin = msg.target.ownerDocument.defaultView; let engine = Services.search.getEngineByName(data.engineName); - browserWin.BrowserSearch.recordSearchInHealthReport(engine, data.whence); + browserWin.BrowserSearch.recordSearchInHealthReport(engine, data.whence, data.selection); let submission = engine.getSubmission(data.searchString, "", data.whence); browserWin.loadURI(submission.uri.spec, null, submission.postData); return Promise.resolve(); From 0cf99398bee521304d8c5d3e712591a5318cce27 Mon Sep 17 00:00:00 2001 From: Blake Winton Date: Thu, 4 Sep 2014 11:03:57 -0400 Subject: [PATCH 17/60] Bug 1036912 - Log selections of searchSuggestTable in newtab. r=mak --- browser/base/content/newtab/search.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/browser/base/content/newtab/search.js b/browser/base/content/newtab/search.js index 5038b633009..251c236ede8 100644 --- a/browser/base/content/newtab/search.js +++ b/browser/base/content/newtab/search.js @@ -35,11 +35,21 @@ let gSearch = { } let searchStr = this._nodes.text.value; if (this.currentEngineName && searchStr.length) { - this._send("Search", { + + let eventData = { engineName: this.currentEngineName, searchString: searchStr, whence: "newtab", - }); + } + + if (searchText.hasAttribute("selection-index")) { + eventData.selection = { + index: searchText.getAttribute("selection-index"), + kind: searchText.getAttribute("selection-kind") + }; + } + + this._send("Search", eventData); } this._suggestionController.addInputValueToFormHistory(); }, From 2f40ba33b20e623714eccc73c00157f49d7f6826 Mon Sep 17 00:00:00 2001 From: Blake Winton Date: Thu, 4 Sep 2014 13:41:30 -0400 Subject: [PATCH 18/60] Bug 1036914 - Log autocomplete selections which are like searches. r=mconley, r=mak --- browser/modules/BrowserUITelemetry.jsm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/browser/modules/BrowserUITelemetry.jsm b/browser/modules/BrowserUITelemetry.jsm index e7e5de3f281..c4375f4a3ea 100644 --- a/browser/modules/BrowserUITelemetry.jsm +++ b/browser/modules/BrowserUITelemetry.jsm @@ -179,6 +179,7 @@ this.BrowserUITelemetry = { Services.obs.addObserver(this, "sessionstore-windows-restored", false); Services.obs.addObserver(this, "browser-delayed-startup-finished", false); + Services.obs.addObserver(this, "autocomplete-did-enter-text", false); CustomizableUI.addListener(this); }, @@ -190,6 +191,13 @@ this.BrowserUITelemetry = { case "browser-delayed-startup-finished": this._registerWindow(aSubject); break; + case "autocomplete-did-enter-text": + let input = aSubject.QueryInterface(Ci.nsIAutoCompleteInput); + if (input && input.id == "urlbar" && !input.inPrivateContext && + input.popup.selectedIndex != -1) { + this._logAwesomeBarSearchResult(input.textValue); + } + break; } }, @@ -564,6 +572,17 @@ this.BrowserUITelemetry = { } }, + _logAwesomeBarSearchResult: function (url) { + let spec = Services.search.parseSubmissionURL(url); + if (spec.engine) { + let matchedEngine = "default"; + if (spec.engine.name !== Services.search.currentEngine.name) { + matchedEngine = "other"; + } + this.countSearchEvent("autocomplete-" + matchedEngine); + } + }, + _durations: { customization: [], }, From 5fa2f8102dd8de30b139012c6f0588f623928932 Mon Sep 17 00:00:00 2001 From: Arnaud Sourioux Date: Fri, 5 Sep 2014 00:19:00 +0200 Subject: [PATCH 19/60] Bug 1049812 - Part 1 : Removes static_cast introduced by bug 922727 and set a bool property in DEBUG to ensure PlaceHashKey properties are set. r=mak --- toolkit/components/places/History.cpp | 68 ++++++++++++++++++++------- 1 file changed, 50 insertions(+), 18 deletions(-) diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index f0aa0ebbee0..7fac8cbae86 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -188,15 +188,21 @@ class PlaceHashKey : public nsCStringHashKey public: explicit PlaceHashKey(const nsACString& aSpec) : nsCStringHashKey(&aSpec) - , visitCount(-1) - , bookmarked(-1) + , visitCount(0) + , bookmarked(false) +#ifdef DEBUG + , isInitialized(false) +#endif { } explicit PlaceHashKey(const nsACString* aSpec) : nsCStringHashKey(aSpec) - , visitCount(-1) - , bookmarked(-1) + , visitCount(0) + , bookmarked(false) +#ifdef DEBUG + , isInitialized(false) +#endif { } @@ -206,12 +212,42 @@ class PlaceHashKey : public nsCStringHashKey MOZ_ASSERT(false, "Do not call me!"); } - // Visit count for this place. - int32_t visitCount; - // Whether this place is bookmarked. - int32_t bookmarked; + void SetProperties(uint32_t aVisitCount, bool aBookmarked) + { + visitCount = aVisitCount; + bookmarked = aBookmarked; +#ifdef DEBUG + isInitialized = true; +#endif + } + + uint32_t VisitCount() const + { +#ifdef DEBUG + MOZ_ASSERT(isInitialized, "PlaceHashKey::visitCount not set"); +#endif + return visitCount; + } + + bool IsBookmarked() const + { +#ifdef DEBUG + MOZ_ASSERT(isInitialized, "PlaceHashKey::bookmarked not set"); +#endif + return bookmarked; + } + // Array of VisitData objects. nsTArray visits; +private: + // Visit count for this place. + uint32_t visitCount; + // Whether this place is bookmarked. + bool bookmarked; +#ifdef DEBUG + // Whether previous attributes are set. + bool isInitialized; +#endif }; //////////////////////////////////////////////////////////////////////////////// @@ -1568,8 +1604,7 @@ static PLDHashOperator TransferHashEntries(PlaceHashKey* aEntry, nsTHashtable* hash = static_cast *>(aHash); PlaceHashKey* copy = hash->PutEntry(aEntry->GetKey()); - copy->visitCount = aEntry->visitCount; - copy->bookmarked = aEntry->bookmarked; + copy->SetProperties(aEntry->VisitCount(), aEntry->IsBookmarked()); aEntry->visits.SwapElements(copy->visits); return PL_DHASH_NEXT; } @@ -1584,10 +1619,9 @@ static PLDHashOperator NotifyVisitRemoval(PlaceHashKey* aEntry, const nsTArray& visits = aEntry->visits; nsCOMPtr uri; (void)NS_NewURI(getter_AddRefs(uri), visits[0].spec); - // XXX visitCount should really just be unsigned (bug 1049812) bool removingPage = - visits.Length() == static_cast(aEntry->visitCount) && - !aEntry->bookmarked; + visits.Length() == aEntry->VisitCount() && + !aEntry->IsBookmarked(); // FindRemovableVisits only sets the transition type on the VisitData objects // it collects if the visits were filtered by transition type. // RemoveVisitsFilter currently only supports filtering by transition type, so @@ -1664,9 +1698,8 @@ static PLDHashOperator ListToBeRemovedPlaceIds(PlaceHashKey* aEntry, { const nsTArray& visits = aEntry->visits; // Only orphan ids should be listed. - // XXX visitCount should really just be unsigned (bug 1049812) - if (visits.Length() == static_cast(aEntry->visitCount) && - !aEntry->bookmarked) { + if (visits.Length() == aEntry->VisitCount() && + !aEntry->IsBookmarked()) { nsCString* list = static_cast(aIdsList); if (!list->IsEmpty()) list->Append(','); @@ -1815,8 +1848,7 @@ private: if (!entry) { entry = aPlaces.PutEntry(visit.spec); } - entry->visitCount = visitCount; - entry->bookmarked = bookmarked; + entry->SetProperties(static_cast(visitCount), static_cast(bookmarked)); entry->visits.AppendElement(visit); } NS_ENSURE_SUCCESS(rv, rv); From 2eb805f6364caad8014e81768ee16320ed4a622d Mon Sep 17 00:00:00 2001 From: Arnaud Sourioux Date: Fri, 5 Sep 2014 00:20:00 +0200 Subject: [PATCH 20/60] Bug 1049812 - Part2: fix indentaion in toolkit/components/places/History.cpp for class PlaceHashKey. r=mak --- toolkit/components/places/History.cpp | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index 7fac8cbae86..4fd5fe22865 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -185,32 +185,32 @@ struct RemoveVisitsFilter { class PlaceHashKey : public nsCStringHashKey { - public: - explicit PlaceHashKey(const nsACString& aSpec) +public: + explicit PlaceHashKey(const nsACString& aSpec) : nsCStringHashKey(&aSpec) , visitCount(0) , bookmarked(false) #ifdef DEBUG , isInitialized(false) #endif - { - } + { + } - explicit PlaceHashKey(const nsACString* aSpec) + explicit PlaceHashKey(const nsACString* aSpec) : nsCStringHashKey(aSpec) , visitCount(0) , bookmarked(false) #ifdef DEBUG , isInitialized(false) #endif - { - } + { + } - PlaceHashKey(const PlaceHashKey& aOther) + PlaceHashKey(const PlaceHashKey& aOther) : nsCStringHashKey(&aOther.GetKey()) - { - MOZ_ASSERT(false, "Do not call me!"); - } + { + MOZ_ASSERT(false, "Do not call me!"); + } void SetProperties(uint32_t aVisitCount, bool aBookmarked) { @@ -237,13 +237,13 @@ class PlaceHashKey : public nsCStringHashKey return bookmarked; } - // Array of VisitData objects. - nsTArray visits; + // Array of VisitData objects. + nsTArray visits; private: - // Visit count for this place. - uint32_t visitCount; - // Whether this place is bookmarked. - bool bookmarked; + // Visit count for this place. + uint32_t visitCount; + // Whether this place is bookmarked. + bool bookmarked; #ifdef DEBUG // Whether previous attributes are set. bool isInitialized; From ec0af5d3594302d76c6233cedf3ff9cb03a86737 Mon Sep 17 00:00:00 2001 From: Arnaud Sourioux Date: Fri, 5 Sep 2014 00:21:00 +0200 Subject: [PATCH 21/60] Bug 1049812 - Part3: Rename PlaceHashKey private members with a 'm' prefix. r=mak --- toolkit/components/places/History.cpp | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index 4fd5fe22865..ee033310e75 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -188,20 +188,20 @@ class PlaceHashKey : public nsCStringHashKey public: explicit PlaceHashKey(const nsACString& aSpec) : nsCStringHashKey(&aSpec) - , visitCount(0) - , bookmarked(false) + , mVisitCount(0) + , mBookmarked(false) #ifdef DEBUG - , isInitialized(false) + , mIsInitialized(false) #endif { } explicit PlaceHashKey(const nsACString* aSpec) : nsCStringHashKey(aSpec) - , visitCount(0) - , bookmarked(false) + , mVisitCount(0) + , mBookmarked(false) #ifdef DEBUG - , isInitialized(false) + , mIsInitialized(false) #endif { } @@ -214,39 +214,39 @@ public: void SetProperties(uint32_t aVisitCount, bool aBookmarked) { - visitCount = aVisitCount; - bookmarked = aBookmarked; + mVisitCount = aVisitCount; + mBookmarked = aBookmarked; #ifdef DEBUG - isInitialized = true; + mIsInitialized = true; #endif } uint32_t VisitCount() const { #ifdef DEBUG - MOZ_ASSERT(isInitialized, "PlaceHashKey::visitCount not set"); + MOZ_ASSERT(mIsInitialized, "PlaceHashKey::mVisitCount not set"); #endif - return visitCount; + return mVisitCount; } bool IsBookmarked() const { #ifdef DEBUG - MOZ_ASSERT(isInitialized, "PlaceHashKey::bookmarked not set"); + MOZ_ASSERT(mIsInitialized, "PlaceHashKey::mBookmarked not set"); #endif - return bookmarked; + return mBookmarked; } // Array of VisitData objects. - nsTArray visits; + nsTArray mVisits; private: // Visit count for this place. - uint32_t visitCount; + uint32_t mVisitCount; // Whether this place is bookmarked. - bool bookmarked; + bool mBookmarked; #ifdef DEBUG // Whether previous attributes are set. - bool isInitialized; + bool mIsInitialized; #endif }; @@ -1605,7 +1605,7 @@ static PLDHashOperator TransferHashEntries(PlaceHashKey* aEntry, static_cast *>(aHash); PlaceHashKey* copy = hash->PutEntry(aEntry->GetKey()); copy->SetProperties(aEntry->VisitCount(), aEntry->IsBookmarked()); - aEntry->visits.SwapElements(copy->visits); + aEntry->mVisits.SwapElements(copy->mVisits); return PL_DHASH_NEXT; } @@ -1616,7 +1616,7 @@ static PLDHashOperator NotifyVisitRemoval(PlaceHashKey* aEntry, void* aHistory) { nsNavHistory* history = static_cast(aHistory); - const nsTArray& visits = aEntry->visits; + const nsTArray& visits = aEntry->mVisits; nsCOMPtr uri; (void)NS_NewURI(getter_AddRefs(uri), visits[0].spec); bool removingPage = @@ -1696,7 +1696,7 @@ private: static PLDHashOperator ListToBeRemovedPlaceIds(PlaceHashKey* aEntry, void* aIdsList) { - const nsTArray& visits = aEntry->visits; + const nsTArray& visits = aEntry->mVisits; // Only orphan ids should be listed. if (visits.Length() == aEntry->VisitCount() && !aEntry->IsBookmarked()) { @@ -1849,7 +1849,7 @@ private: entry = aPlaces.PutEntry(visit.spec); } entry->SetProperties(static_cast(visitCount), static_cast(bookmarked)); - entry->visits.AppendElement(visit); + entry->mVisits.AppendElement(visit); } NS_ENSURE_SUCCESS(rv, rv); From 1ffab17f17004c8d4594214f720a7a480e4b1826 Mon Sep 17 00:00:00 2001 From: Brian Grinstead Date: Fri, 5 Sep 2014 06:58:00 +0200 Subject: [PATCH 22/60] Bug 1047148 - [markup view] Fix overlapping scrollbars when editing outer HTML in dark theme. r=past --- browser/devtools/markupview/markup-view.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/devtools/markupview/markup-view.css b/browser/devtools/markupview/markup-view.css index a5d7dff360d..15a3d526c7a 100644 --- a/browser/devtools/markupview/markup-view.css +++ b/browser/devtools/markupview/markup-view.css @@ -36,6 +36,9 @@ .html-editor-inner { border: solid .1px; flex: 1 1 main-size; + + /* Keep the editor away from the markup view floating scrollbars */ + -moz-margin-end: 12px; } .html-editor iframe { From 7e04ed37ddaf7c6b4c3c591a8063ca8b4bedd6c7 Mon Sep 17 00:00:00 2001 From: Jan Odvarko Date: Fri, 5 Sep 2014 13:11:34 +0200 Subject: [PATCH 23/60] Bug 1055571 - Implement ToolSidebar.removeTab API. r=bgrins --- browser/devtools/framework/sidebar.js | 33 ++++++++++++++++--- .../framework/test/browser_toolbox_sidebar.js | 22 ++++++++++++- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/browser/devtools/framework/sidebar.js b/browser/devtools/framework/sidebar.js index 3c17276eb05..073c3ae2af4 100644 --- a/browser/devtools/framework/sidebar.js +++ b/browser/devtools/framework/sidebar.js @@ -70,12 +70,16 @@ ToolSidebar.prototype = { let tab = this._tabbox.tabs.appendItem(); tab.setAttribute("label", ""); // Avoid showing "undefined" while the tab is loading + tab.setAttribute("id", "sidebar-tab-" + id); + + let onIFrameLoaded = (event) => { + let doc = event.target; + let win = doc.defaultView; + tab.setAttribute("label", doc.title); - let onIFrameLoaded = () => { - tab.setAttribute("label", iframe.contentDocument.title); iframe.removeEventListener("load", onIFrameLoaded, true); - if ("setPanel" in iframe.contentWindow) { - iframe.contentWindow.setPanel(this._toolPanel, iframe); + if ("setPanel" in win) { + win.setPanel(this._toolPanel, iframe); } this.emit(id + "-ready"); }; @@ -109,6 +113,27 @@ ToolSidebar.prototype = { this.emit("new-tab-registered", id); }, + /** + * Remove an existing tab. + */ + removeTab: function(id) { + let tab = this._tabbox.tabs.querySelector("tab#sidebar-tab-" + id); + if (!tab) { + return; + } + + tab.remove(); + + let panel = this.getTab(id); + if (panel) { + panel.remove(); + } + + this._tabs.delete(id); + + this.emit("tab-unregistered", id); + }, + /** * Select a specific tab. */ diff --git a/browser/devtools/framework/test/browser_toolbox_sidebar.js b/browser/devtools/framework/test/browser_toolbox_sidebar.js index f9ec0611179..752580da995 100644 --- a/browser/devtools/framework/test/browser_toolbox_sidebar.js +++ b/browser/devtools/framework/test/browser_toolbox_sidebar.js @@ -108,6 +108,7 @@ function test() { for (let tab of tabs) { is(tab.getAttribute("label"), label++, "Tab has the right title"); } + is(label, 4, "Found the right amount of tabs."); is(panel.sidebar._tabbox.selectedPanel, panels[0], "First tab is selected"); ok(panel.sidebar.getCurrentTabID(), "tab1", "getCurrentTabID() is correct"); @@ -119,13 +120,32 @@ function test() { panel.sidebar.hide(); is(panel.sidebar._tabbox.getAttribute("hidden"), "true", "Sidebar hidden"); is(panel.sidebar.getWindowForTab("tab1").location.href, tab1URL, "Window is accessible"); - testWidth(panel); + testRemoval(panel); }); }); panel.sidebar.select("tab2"); } + function testRemoval(panel) { + panel.sidebar.once("tab-unregistered", function(event, id) { + info(event); + registeredTabs[id] = false; + + is(id, "tab3", "The right tab must be removed"); + + let tabs = panel.sidebar._tabbox.querySelectorAll("tab"); + let panels = panel.sidebar._tabbox.querySelectorAll("tabpanel"); + + is(tabs.length, 2, "There is the right number of tabs"); + is(panels.length, 2, "There is the right number of panels"); + + testWidth(panel); + }); + + panel.sidebar.removeTab("tab3"); + } + function testWidth(panel) { let tabbox = panel.panelDoc.getElementById("sidebar"); tabbox.width = 420; From 96f0c1368873b464ce90e7402a3c58bb15173a97 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 4 Sep 2014 15:53:00 +0200 Subject: [PATCH 24/60] Bug 1062611 - Test for WebIDE tabs. r=paul --- browser/devtools/webide/test/browser.ini | 2 +- browser/devtools/webide/test/browser_tabs.js | 18 ++++++++++-------- browser/devtools/webide/test/doc_tabs.html | 15 +++++++++++++++ browser/devtools/webide/test/head.js | 5 +++++ 4 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 browser/devtools/webide/test/doc_tabs.html diff --git a/browser/devtools/webide/test/browser.ini b/browser/devtools/webide/test/browser.ini index a31e8822933..28594a69bb6 100644 --- a/browser/devtools/webide/test/browser.ini +++ b/browser/devtools/webide/test/browser.ini @@ -2,8 +2,8 @@ subsuite = devtools support-files = addons/simulators.json + doc_tabs.html head.js templates.json [browser_tabs.js] -skip-if = true # Fails on TBPL, to be fixed in bug 1062611 diff --git a/browser/devtools/webide/test/browser_tabs.js b/browser/devtools/webide/test/browser_tabs.js index 4e57ee007b2..1b9883455b8 100644 --- a/browser/devtools/webide/test/browser_tabs.js +++ b/browser/devtools/webide/test/browser_tabs.js @@ -2,6 +2,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; +const TEST_URI = "http://example.com/browser/browser/devtools/webide/test/doc_tabs.html"; + function test() { waitForExplicitFinish(); SimpleTest.requestCompleteLog(); @@ -9,10 +11,12 @@ function test() { Task.spawn(function() { const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {}); - DebuggerServer.init(function () { return true; }); - DebuggerServer.addBrowserActors(); + if (!DebuggerServer.initialized) { + DebuggerServer.init(function () { return true; }); + DebuggerServer.addBrowserActors(); + } - let tab = yield addTab("about:newtab"); + let tab = yield addTab(TEST_URI); let win = yield openWebIDE(); @@ -23,15 +27,13 @@ function test() { yield selectTabProject(win); let project = win.AppManager.selectedProject; - is(project.location, "about:newtab", "Location is correct"); - is(project.name, "New Tab", "Name is correct"); + is(project.location, TEST_URI, "Location is correct"); + is(project.name, "example.com: Test Tab", "Name is correct"); yield closeWebIDE(win); DebuggerServer.destroy(); yield removeTab(tab); - - finish(); - }); + }).then(finish, handleError); } function connectToLocal(win) { diff --git a/browser/devtools/webide/test/doc_tabs.html b/browser/devtools/webide/test/doc_tabs.html new file mode 100644 index 00000000000..4901289fc78 --- /dev/null +++ b/browser/devtools/webide/test/doc_tabs.html @@ -0,0 +1,15 @@ + + + + + + + Test Tab + + + + Test Tab + + + diff --git a/browser/devtools/webide/test/head.js b/browser/devtools/webide/test/head.js index a583b763647..eff32d4bc6b 100644 --- a/browser/devtools/webide/test/head.js +++ b/browser/devtools/webide/test/head.js @@ -153,3 +153,8 @@ function removeTab(aTab, aWindow) { targetBrowser.removeTab(aTab); return deferred.promise; } + +function handleError(aError) { + ok(false, "Got an error: " + aError.message + "\n" + aError.stack); + finish(); +} From 51d8c2654f061bbb35a606c87a7accec73492058 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 5 Sep 2014 14:35:44 -0700 Subject: [PATCH 25/60] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/73442e5ccb1e Author: Dave Hunt Desc: Bug 1049723 - Post logs to Treeherder report. r=rwood r=jlal ======== https://hg.mozilla.org/integration/gaia-central/rev/9caeaa8e5443 Author: Dave Hunt Desc: Bug 1049723 - Exclude the artifact path from the link in Treeherder. r=rwood ======== https://hg.mozilla.org/integration/gaia-central/rev/1b52998366d8 Author: Dave Hunt Desc: Bug 1049723 - Replaced Treeherder command line options with environment variables. r=rwood --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 271b736e1b8..a410d17608d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "e7a7c126f48f4ea3bded1f2e9ee5e4f79ae1be9e", + "revision": "73442e5ccb1efa7a1b62200c8d3e5ac13c02c6ef", "repo_path": "/integration/gaia-central" } From 72ffa9c7174b454236bfe5a246cd42d5542d51f1 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 5 Sep 2014 14:41:56 -0700 Subject: [PATCH 26/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 85a947e8d3b..52557f0795a 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index e72b2c1bc6f..625a90f543a 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index f3100eea956..ab100da9923 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 67940d3949b..880752df7d3 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index e72b2c1bc6f..625a90f543a 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 6c1380b4cb1..e4599cd6314 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 4734af2d2df..c53144ff12a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 42b12e9bb44..c90e77bd7cc 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 66530c8e182..7d41d1e0d21 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 8b0d19d9fb6..786453e8150 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 4d8749579ee..7a248377a29 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From a005dd1fc0db8edbe97cf6dea77ecbce28d0943f Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Fri, 5 Sep 2014 15:41:01 -0700 Subject: [PATCH 27/60] Bug 1063126 - DeviceStorage - Add some logging. r=khuey --- dom/devicestorage/nsDeviceStorage.cpp | 40 +++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/dom/devicestorage/nsDeviceStorage.cpp b/dom/devicestorage/nsDeviceStorage.cpp index b2926ccbf1e..a3d7fe1bfd6 100644 --- a/dom/devicestorage/nsDeviceStorage.cpp +++ b/dom/devicestorage/nsDeviceStorage.cpp @@ -871,13 +871,17 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType, InitDirs(); #ifdef MOZ_WIDGET_GONK + nsresult rv; nsString volMountPoint; if (DeviceStorageTypeChecker::IsVolumeBased(aStorageType)) { nsCOMPtr vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID); NS_ENSURE_TRUE_VOID(vs); - nsresult rv; nsCOMPtr vol; rv = vs->GetVolumeByName(aStorageName, getter_AddRefs(vol)); + if(NS_FAILED(rv)) { + printf_stderr("##### DeviceStorage: GetVolumeByName('%s') failed\n", + NS_LossyConvertUTF16toASCII(aStorageName).get()); + } NS_ENSURE_SUCCESS_VOID(rv); vol->GetMountPoint(volMountPoint); } @@ -886,7 +890,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType, // Picture directory if (aStorageType.EqualsLiteral(DEVICESTORAGE_PICTURES)) { #ifdef MOZ_WIDGET_GONK - NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + if(NS_FAILED(rv)) { + printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n", + NS_LossyConvertUTF16toASCII(volMountPoint).get(), + NS_LossyConvertUTF16toASCII(aStorageType).get()); + } #else f = sDirs->pictures; #endif @@ -895,7 +904,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType, // Video directory else if (aStorageType.EqualsLiteral(DEVICESTORAGE_VIDEOS)) { #ifdef MOZ_WIDGET_GONK - NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + if(NS_FAILED(rv)) { + printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n", + NS_LossyConvertUTF16toASCII(volMountPoint).get(), + NS_LossyConvertUTF16toASCII(aStorageType).get()); + } #else f = sDirs->videos; #endif @@ -904,7 +918,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType, // Music directory else if (aStorageType.EqualsLiteral(DEVICESTORAGE_MUSIC)) { #ifdef MOZ_WIDGET_GONK - NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + if(NS_FAILED(rv)) { + printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n", + NS_LossyConvertUTF16toASCII(volMountPoint).get(), + NS_LossyConvertUTF16toASCII(aStorageType).get()); + } #else f = sDirs->music; #endif @@ -919,7 +938,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType, // default SDCard else if (aStorageType.EqualsLiteral(DEVICESTORAGE_SDCARD)) { #ifdef MOZ_WIDGET_GONK - NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f)); + if(NS_FAILED(rv)) { + printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n", + NS_LossyConvertUTF16toASCII(volMountPoint).get(), + NS_LossyConvertUTF16toASCII(aStorageType).get()); + } #else f = sDirs->sdcard; #endif @@ -945,6 +969,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType, if (f) { f->Clone(aFile); + } else { + // This should never happen unless something is severely wrong. So + // scream a little. + printf_stderr("##### GetRootDirectoryForType('%s', '%s') failed #####", + NS_LossyConvertUTF16toASCII(aStorageType).get(), + NS_LossyConvertUTF16toASCII(aStorageName).get()); } } From 98a851bf869f0986e9afbd1f9525e7cb760da374 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 5 Sep 2014 15:55:46 -0700 Subject: [PATCH 28/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/e216b599282a Author: Michael Henretty Desc: Merge pull request #23779 from mikehenrty/bug-1063087-memoize-homescreen-url Bug 1063087 - Memoize homescreen url ======== https://hg.mozilla.org/integration/gaia-central/rev/16ee9c895ba6 Author: Michael Henretty Desc: Bug 1063087 - Memoize homescreen url r=kgrandon --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index a410d17608d..4029b44bc82 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "73442e5ccb1efa7a1b62200c8d3e5ac13c02c6ef", + "revision": "e216b599282a29a53ebbde59e440adbc5529838c", "repo_path": "/integration/gaia-central" } From 79d86b440843c4aef2f59526484743a362d3b65b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 5 Sep 2014 16:01:55 -0700 Subject: [PATCH 29/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 52557f0795a..36ac4aa5467 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 625a90f543a..c51ab8dd4b1 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index ab100da9923..e1b8d252846 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 880752df7d3..5c9a2fbf0e0 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 625a90f543a..c51ab8dd4b1 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e4599cd6314..ab07698643a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index c53144ff12a..cd5b222d492 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c90e77bd7cc..18c28e382f0 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 7d41d1e0d21..f217643d637 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 786453e8150..2a4e34b1963 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 7a248377a29..8924dbeb534 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 990e2a1c446ee91018c8eee15495eaf5d165904b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Fri, 5 Sep 2014 16:41:24 -0700 Subject: [PATCH 30/60] Bug 1056424 - Stuck at loading screen during power cut off test r=myk --- dom/apps/Webapps.jsm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dom/apps/Webapps.jsm b/dom/apps/Webapps.jsm index 7d14d02982f..e7b6f1bbbb8 100755 --- a/dom/apps/Webapps.jsm +++ b/dom/apps/Webapps.jsm @@ -633,10 +633,23 @@ this.DOMApplicationRegistry = { yield this.loadCurrentRegistry(); + try { + let systemManifestURL = + Services.prefs.getCharPref("b2g.system_manifest_url"); + let systemAppFound = + this.webapps.some(v => v.manifestURL == systemManifestURL); + + // We configured a system app but can't find it. That prevents us + // from starting so we clear our registry to start again from scratch. + if (!systemAppFound) { + runUpdate = true; + } + } catch(e) {} // getCharPref will throw on non-b2g platforms. That's ok. + if (runUpdate) { // Run migration before uninstall of core apps happens. - Services.obs.notifyObservers(null, "webapps-before-update-merge", null); + Services.obs.notifyObservers(null, "webapps-before-update-merge", null); #ifdef MOZ_WIDGET_GONK yield this.installSystemApps(); From 0739fc4da5c2ef94f1beda8eded7edff58793d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Fri, 5 Sep 2014 16:55:30 -0700 Subject: [PATCH 31/60] Bug 1063852 - Use webidl sequence for the receipts property. r=marco,bholley --- dom/apps/Webapps.js | 3 +++ dom/webidl/Apps.webidl | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dom/apps/Webapps.js b/dom/apps/Webapps.js index 9066760f4bc..175c254f224 100644 --- a/dom/apps/Webapps.js +++ b/dom/apps/Webapps.js @@ -639,6 +639,7 @@ WebappsApplication.prototype = { case "Webapps:AddReceipt:Return:OK": this.removeMessageListeners(["Webapps:AddReceipt:Return:OK", "Webapps:AddReceipt:Return:KO"]); + this.__DOM_IMPL__._clearCachedReceiptsValue(); this._proxy.receipts = msg.receipts; Services.DOMRequest.fireSuccess(req, null); break; @@ -650,6 +651,7 @@ WebappsApplication.prototype = { case "Webapps:RemoveReceipt:Return:OK": this.removeMessageListeners(["Webapps:RemoveReceipt:Return:OK", "Webapps:RemoveReceipt:Return:KO"]); + this.__DOM_IMPL__._clearCachedReceiptsValue(); this._proxy.receipts = msg.receipts; Services.DOMRequest.fireSuccess(req, null); break; @@ -661,6 +663,7 @@ WebappsApplication.prototype = { case "Webapps:ReplaceReceipt:Return:OK": this.removeMessageListeners(["Webapps:ReplaceReceipt:Return:OK", "Webapps:ReplaceReceipt:Return:KO"]); + this.__DOM_IMPL__._clearCachedReceiptsValue(); this._proxy.receipts = msg.receipts; Services.DOMRequest.fireSuccess(req, null); break; diff --git a/dom/webidl/Apps.webidl b/dom/webidl/Apps.webidl index 94d366c380d..5804e4e4a1e 100644 --- a/dom/webidl/Apps.webidl +++ b/dom/webidl/Apps.webidl @@ -33,9 +33,8 @@ interface DOMApplication : EventTarget { readonly attribute DOMTimeStamp installTime; readonly attribute boolean removable; - // That's actually a [Cached, Pure] sequence. - // Will update once bug 963382 is fixed. - readonly attribute any receipts; + [Cached, Pure] + readonly attribute sequence receipts; readonly attribute double progress; From 0fc2feb784abf2b20783782e91a810dcef7c8fd8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 5 Sep 2014 18:15:54 -0700 Subject: [PATCH 32/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/d7156188b49b Author: Kyle Machulis Desc: Merge pull request #23781 from qdot/1036691-fix-browser Bug 1036691 - Fix settings includes for browser shims ======== https://hg.mozilla.org/integration/gaia-central/rev/cfa39851d371 Author: Kyle Machulis Desc: Bug 1036691 - Fix settings includes for browser shims --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4029b44bc82..be3eec510fc 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "e216b599282a29a53ebbde59e440adbc5529838c", + "revision": "d7156188b49bdb0ba0b4d9ea6f89a4c1b45aeedb", "repo_path": "/integration/gaia-central" } From a1b1f6f0eda52db84f9a5e1d195b0f89c67617ba Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 5 Sep 2014 18:22:07 -0700 Subject: [PATCH 33/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 36ac4aa5467..a6ffaa5cd97 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c51ab8dd4b1..cc1f5ee7fb6 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index e1b8d252846..d3d04a322c9 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 5c9a2fbf0e0..12985f8111b 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c51ab8dd4b1..cc1f5ee7fb6 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index ab07698643a..74b3a4d325e 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index cd5b222d492..2f9b2f2e11b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 18c28e382f0..8abf3a9138a 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index f217643d637..a65af5fa780 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 2a4e34b1963..b4a46ebb18a 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 8924dbeb534..953dbcaf0a3 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From dd58fe3514487a09fde3fe2f69b5bd862db5b93b Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Fri, 5 Sep 2014 18:39:54 -0700 Subject: [PATCH 34/60] Bug 1062087 - Fix undefined variable error messages in Settings API; r=bent --- dom/settings/SettingsManager.js | 2 +- dom/settings/SettingsRequestManager.jsm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/settings/SettingsManager.js b/dom/settings/SettingsManager.js index 07bbdab4a82..b8fb3c08d59 100644 --- a/dom/settings/SettingsManager.js +++ b/dom/settings/SettingsManager.js @@ -55,7 +55,7 @@ function SettingsLock(aSettingsManager) { "Settings:Clear:OK", "Settings:Clear:KO", "Settings:Set:OK", "Settings:Set:KO", "Settings:Finalize:OK", "Settings:Finalize:KO"]); - this.sendMessage("Settings:CreateLock", {lockID: this._id, isInternalLock: false}); + this.sendMessage("Settings:CreateLock", {lockID: this._id, isServiceLock: false}); Services.tm.currentThread.dispatch(this._closeHelper.bind(this), Ci.nsIThread.DISPATCH_NORMAL); } diff --git a/dom/settings/SettingsRequestManager.jsm b/dom/settings/SettingsRequestManager.jsm index eb5e778c2f9..415e50aee3a 100644 --- a/dom/settings/SettingsRequestManager.jsm +++ b/dom/settings/SettingsRequestManager.jsm @@ -601,7 +601,7 @@ let SettingsRequestManager = { p.reject("Invalid operation: " + currentTask.operation); } p.then(function(ret) { - ret.task.defer.resolve(ret.results); + ret.task.defer.resolve("results" in ret ? ret.results : null); }.bind(currentTask), function(ret) { ret.task.defer.reject(ret.error); }); From 9e8b8d681808370182339f3597dbc0bb37e75ebf Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Fri, 5 Sep 2014 21:37:27 -0700 Subject: [PATCH 35/60] Bug 1054191 - AutoMounter should accomodate rndis. r=echou --- dom/system/gonk/AutoMounter.cpp | 62 ++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/dom/system/gonk/AutoMounter.cpp b/dom/system/gonk/AutoMounter.cpp index ed3eee0fc86..0ab4fe43a4d 100644 --- a/dom/system/gonk/AutoMounter.cpp +++ b/dom/system/gonk/AutoMounter.cpp @@ -96,9 +96,10 @@ namespace system { #define SYS_USB_CONFIG "sys.usb.config" #define PERSIST_SYS_USB_CONFIG "persist.sys.usb.config" -#define USB_FUNC_ADB "adb" -#define USB_FUNC_MTP "mtp" -#define USB_FUNC_UMS "mass_storage" +#define USB_FUNC_ADB "adb" +#define USB_FUNC_MTP "mtp" +#define USB_FUNC_RNDIS "rndis" +#define USB_FUNC_UMS "mass_storage" class AutoMounter; @@ -420,17 +421,21 @@ private: // mass_storage has been configured and we can start sharing once the user // enables it. STATE_UMS_CONFIGURED, + + // USB Tethering is enabled + STATE_RNDIS_CONFIGURED, }; const char *StateStr(STATE aState) { switch (aState) { - case STATE_IDLE: return "IDLE"; - case STATE_MTP_CONFIGURING: return "MTP_CONFIGURING"; - case STATE_MTP_CONNECTED: return "MTP_CONNECTED"; - case STATE_MTP_STARTED: return "MTP_STARTED"; - case STATE_UMS_CONFIGURING: return "UMS_CONFIGURING"; - case STATE_UMS_CONFIGURED: return "UMS_CONFIGURED"; + case STATE_IDLE: return "IDLE"; + case STATE_MTP_CONFIGURING: return "MTP_CONFIGURING"; + case STATE_MTP_CONNECTED: return "MTP_CONNECTED"; + case STATE_MTP_STARTED: return "MTP_STARTED"; + case STATE_UMS_CONFIGURING: return "UMS_CONFIGURING"; + case STATE_UMS_CONFIGURED: return "UMS_CONFIGURED"; + case STATE_RNDIS_CONFIGURED: return "RNDIS_CONFIGURED"; } return "STATE_???"; } @@ -660,6 +665,7 @@ AutoMounter::UpdateState() bool mtpAvail = false; bool mtpConfigured = false; bool mtpEnabled = false; + bool rndisConfigured = false; bool usbCablePluggedIn = IsUsbCablePluggedIn(); if (access(ICS_SYS_USB_FUNCTIONS, F_OK) == 0) { @@ -690,6 +696,8 @@ AutoMounter::UpdateState() mtpConfigured = false; mtpEnabled = false; } + + rndisConfigured = strstr(functionsStr, USB_FUNC_RNDIS) != nullptr; } bool enabled = mtpEnabled || umsEnabled; @@ -704,9 +712,9 @@ AutoMounter::UpdateState() } } - DBG("UpdateState: ums:A%dC%dE%d mtp:A%dC%dE%d mode:%d usb:%d mState:%s", + DBG("UpdateState: ums:A%dC%dE%d mtp:A%dC%dE%d rndis:%d mode:%d usb:%d mState:%s", umsAvail, umsConfigured, umsEnabled, - mtpAvail, mtpConfigured, mtpEnabled, + mtpAvail, mtpConfigured, mtpEnabled, rndisConfigured, mMode, usbCablePluggedIn, StateStr(mState)); switch (mState) { @@ -717,6 +725,11 @@ AutoMounter::UpdateState() // UEvent when the usb cable is plugged in. break; } + if (rndisConfigured) { + // USB Tethering uses RNDIS. We'll just wait until its turned off. + SetState(STATE_RNDIS_CONFIGURED); + break; + } if (mtpEnabled) { if (mtpConfigured) { // The USB layer has already been configured. Now we can go ahead @@ -726,7 +739,7 @@ AutoMounter::UpdateState() StartMtpServer(); SetState(STATE_MTP_STARTED); } else { - // The MTP USB layer is configuring. Wait for it to finish + // We need to configure USB to use mtp. Wait for it to be configured // before we start the MTP server. SetUsbFunction(USB_FUNC_MTP); SetState(STATE_MTP_CONFIGURING); @@ -752,6 +765,11 @@ AutoMounter::UpdateState() // the MTP server. StartMtpServer(); SetState(STATE_MTP_STARTED); + break; + } + if (rndisConfigured) { + SetState(STATE_RNDIS_CONFIGURED); + break; } break; @@ -764,6 +782,10 @@ AutoMounter::UpdateState() "mtpConfigured = %d mtpEnabled = %d usbCablePluggedIn: %d", mtpConfigured, mtpEnabled, usbCablePluggedIn); StopMtpServer(); + if (rndisConfigured) { + SetState(STATE_RNDIS_CONFIGURED); + break; + } if (umsAvail) { // Switch back to UMS SetUsbFunction(USB_FUNC_UMS); @@ -790,6 +812,10 @@ AutoMounter::UpdateState() } SetState(STATE_UMS_CONFIGURED); } + if (rndisConfigured) { + SetState(STATE_RNDIS_CONFIGURED); + break; + } break; case STATE_UMS_CONFIGURED: @@ -805,6 +831,18 @@ AutoMounter::UpdateState() break; } } + if (rndisConfigured) { + SetState(STATE_RNDIS_CONFIGURED); + break; + } + SetState(STATE_IDLE); + break; + + case STATE_RNDIS_CONFIGURED: + if (usbCablePluggedIn && rndisConfigured) { + // Normal state when RNDIS is enabled. + break; + } SetState(STATE_IDLE); break; From 65063752b9ad3fbee961ea77d146ffed1b8cdb05 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 6 Sep 2014 11:25:46 -0700 Subject: [PATCH 36/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/027830934e07 Author: Kevin Grandon Desc: Merge pull request #23785 from KevinGrandon/bug_1052722_fix_manifest_helper_call Bug 1052722 - Update call to manifest helper with manifestURL ======== https://hg.mozilla.org/integration/gaia-central/rev/62b94d1694e0 Author: Kevin Grandon Desc: Bug 1052722 - Update call to manifest helper with manifestURL a=nbotb r=fabrice --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index be3eec510fc..6074c5a976c 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "d7156188b49bdb0ba0b4d9ea6f89a4c1b45aeedb", + "revision": "027830934e070d4fd00604681a4253e49ac626e9", "repo_path": "/integration/gaia-central" } From a280536b08a3574215aa136c360502dff4e49706 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 6 Sep 2014 11:27:33 -0700 Subject: [PATCH 37/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index a6ffaa5cd97..f23a434a26f 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index cc1f5ee7fb6..088f76b221b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index d3d04a322c9..61c0eb1b802 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 12985f8111b..8866f3bffed 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index cc1f5ee7fb6..088f76b221b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 74b3a4d325e..1701fe6639a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 2f9b2f2e11b..269fcdbb7d1 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 8abf3a9138a..5c60a02e8ed 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index a65af5fa780..67aa6ae65ea 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index b4a46ebb18a..7ae2b6f2123 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 953dbcaf0a3..249f9b1ddf2 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 9bcd72dc4b84607aa1b44f7832ec778fdb4cee82 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 6 Sep 2014 19:30:46 -0700 Subject: [PATCH 38/60] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/70c97cdbc620 Author: Michael Henretty Desc: Merge pull request #23100 from mikehenrty/bug-960126-notification-get-tests Bug 960126 - Re-enable Notification.get tests ======== https://hg.mozilla.org/integration/gaia-central/rev/cae7cd1d345c Author: Michael Henretty Desc: Bug 960126 - Re-enable Notification.get tests ======== https://hg.mozilla.org/integration/gaia-central/rev/788dac75a669 Author: Michael Henretty Desc: Merge pull request #23780 from mikehenrty/bug-1061221-notification-resend-intermittent Bug 1061221 - re-enable resend test ======== https://hg.mozilla.org/integration/gaia-central/rev/957db987ebfd Author: Michael Henretty Desc: Bug 1061221 - re-enable resend test --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6074c5a976c..4d92bd84feb 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "027830934e070d4fd00604681a4253e49ac626e9", + "revision": "70c97cdbc620d36a7c101a7a7059b6cba1c56648", "repo_path": "/integration/gaia-central" } From ff58d9aa0e99b44e52756e6db74a50c37063059c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 6 Sep 2014 19:37:23 -0700 Subject: [PATCH 39/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index f23a434a26f..22c633346f4 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 088f76b221b..217181fb69c 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 61c0eb1b802..132ca723793 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 8866f3bffed..58f834d4638 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 088f76b221b..217181fb69c 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 1701fe6639a..34449e73dcb 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 269fcdbb7d1..92c2208d48b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 5c60a02e8ed..f188c466b6c 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 67aa6ae65ea..f2da82a7715 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 7ae2b6f2123..1d075bf81e3 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 249f9b1ddf2..436e8a03073 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ca10043db77f447610b6fcd4dffd1e75c68845b7 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 7 Sep 2014 09:45:51 -0700 Subject: [PATCH 40/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/76bcac0bd061 Author: Kevin Grandon Desc: Merge pull request #23776 from KevinGrandon/bug_1063789_places_no_app_results Bug 1063789 - [System][Rocketbar] Do not save places for non-browser frames ======== https://hg.mozilla.org/integration/gaia-central/rev/52ab58a658c7 Author: Kevin Grandon Desc: Bug 1063789 - [System][Rocketbar] Do not save places for non-browser frames r=daleharvey --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4d92bd84feb..6dc55c90aaa 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "70c97cdbc620d36a7c101a7a7059b6cba1c56648", + "revision": "76bcac0bd06173d505e8460c49dd19174ae6f3de", "repo_path": "/integration/gaia-central" } From f2dee0e1eb0b76ebf667d76670a1daa52d5fded8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 7 Sep 2014 09:52:08 -0700 Subject: [PATCH 41/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 22c633346f4..ee8587ddf89 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 217181fb69c..ab0bb86a359 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 132ca723793..483a2347558 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 58f834d4638..70d51448d5a 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 217181fb69c..ab0bb86a359 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 34449e73dcb..b87f87b0fdb 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 92c2208d48b..5f285a52d12 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index f188c466b6c..1cc57afa6bd 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index f2da82a7715..e639fd79587 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 1d075bf81e3..aed972ab485 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 436e8a03073..5ee574f18c6 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 4d1378ea9eb03c328ed1b83c71dc09a12616d963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Sun, 7 Sep 2014 20:04:58 -0700 Subject: [PATCH 42/60] backout bug 1063852 (84ac3d72395f) since that breaks Gij. r=bholley to please the dom/ hook. --- dom/apps/Webapps.js | 3 --- dom/webidl/Apps.webidl | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dom/apps/Webapps.js b/dom/apps/Webapps.js index 175c254f224..9066760f4bc 100644 --- a/dom/apps/Webapps.js +++ b/dom/apps/Webapps.js @@ -639,7 +639,6 @@ WebappsApplication.prototype = { case "Webapps:AddReceipt:Return:OK": this.removeMessageListeners(["Webapps:AddReceipt:Return:OK", "Webapps:AddReceipt:Return:KO"]); - this.__DOM_IMPL__._clearCachedReceiptsValue(); this._proxy.receipts = msg.receipts; Services.DOMRequest.fireSuccess(req, null); break; @@ -651,7 +650,6 @@ WebappsApplication.prototype = { case "Webapps:RemoveReceipt:Return:OK": this.removeMessageListeners(["Webapps:RemoveReceipt:Return:OK", "Webapps:RemoveReceipt:Return:KO"]); - this.__DOM_IMPL__._clearCachedReceiptsValue(); this._proxy.receipts = msg.receipts; Services.DOMRequest.fireSuccess(req, null); break; @@ -663,7 +661,6 @@ WebappsApplication.prototype = { case "Webapps:ReplaceReceipt:Return:OK": this.removeMessageListeners(["Webapps:ReplaceReceipt:Return:OK", "Webapps:ReplaceReceipt:Return:KO"]); - this.__DOM_IMPL__._clearCachedReceiptsValue(); this._proxy.receipts = msg.receipts; Services.DOMRequest.fireSuccess(req, null); break; diff --git a/dom/webidl/Apps.webidl b/dom/webidl/Apps.webidl index 5804e4e4a1e..94d366c380d 100644 --- a/dom/webidl/Apps.webidl +++ b/dom/webidl/Apps.webidl @@ -33,8 +33,9 @@ interface DOMApplication : EventTarget { readonly attribute DOMTimeStamp installTime; readonly attribute boolean removable; - [Cached, Pure] - readonly attribute sequence receipts; + // That's actually a [Cached, Pure] sequence. + // Will update once bug 963382 is fixed. + readonly attribute any receipts; readonly attribute double progress; From 0eaa1217f89149990bfe2a0ff61c60dc249747e8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 7 Sep 2014 20:15:41 -0700 Subject: [PATCH 43/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ffd9b630adb7 Author: Rudy Lu Desc: Merge pull request #23760 from RudyLu/keyboard/Bug1062571 Bug 1062571 - Keyboard is basically unusable with the new alternative chars menu. r=timdream. ======== https://hg.mozilla.org/integration/gaia-central/rev/a27701a86fc7 Author: Rudy Lu Desc: Bug 1062571 - Keyboard is basically unusable with the new "alternative chars menu" UI. - Should not cause JS error when invoking isMenuTarget() when there is no alternative chars menu. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6dc55c90aaa..b2022028c21 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "76bcac0bd06173d505e8460c49dd19174ae6f3de", + "revision": "ffd9b630adb79371714d93b38d389e728f001d11", "repo_path": "/integration/gaia-central" } From b594a1ee6b46c8381906e1e7dbf93a7eafd8a1f3 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 7 Sep 2014 20:24:18 -0700 Subject: [PATCH 44/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ee8587ddf89..78de961010a 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index ab0bb86a359..284255525a2 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 483a2347558..76fe78a4a66 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 70d51448d5a..22b6a0efe19 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index ab0bb86a359..284255525a2 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index b87f87b0fdb..f99b5e8c7f1 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5f285a52d12..43515cf3b6f 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1cc57afa6bd..f3a4fea46fb 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e639fd79587..b6670f5df75 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index aed972ab485..538b6cdf1d1 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 5ee574f18c6..511cc215619 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 987d6253073c23cd629498ab604565684216653f Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 7 Sep 2014 21:40:31 -0700 Subject: [PATCH 45/60] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/99aad80c93e9 Author: Kevin Grandon Desc: Revert "Bug 1063789 - [System][Rocketbar] Do not save places for non-browser frames r=daleharvey" This reverts commit adcf40510ea5b840a1f7562aafe9cfbdd882c608. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index b2022028c21..50ac55336ba 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ffd9b630adb79371714d93b38d389e728f001d11", + "revision": "99aad80c93e93d0afa1781d53c97bf08ed2c7536", "repo_path": "/integration/gaia-central" } From f18c25a57d33f8db76f874d46f0f6b514482440d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 7 Sep 2014 21:50:26 -0700 Subject: [PATCH 46/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 78de961010a..c7a9e297ef1 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 284255525a2..4a995d15958 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 76fe78a4a66..7adba69f68e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 22b6a0efe19..6fc56362146 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 284255525a2..4a995d15958 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index f99b5e8c7f1..5508a933752 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 43515cf3b6f..6d0cb235d7f 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index f3a4fea46fb..d8851faaad6 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index b6670f5df75..bc806ed1807 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 538b6cdf1d1..bedf475be7a 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 511cc215619..f2ed8141241 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 5a612db524fc78eabb8ffd364a2609e76db6efbc Mon Sep 17 00:00:00 2001 From: Mason Chang Date: Fri, 5 Sep 2014 12:39:59 -0700 Subject: [PATCH 47/60] Bug 1049258 - Make it easier to collect frame uniformity results. r=benwa --- .../composite/ContainerLayerComposite.cpp | 12 +++-- tools/profiler/ProfilerMarkers.cpp | 40 +++++++++++++++- tools/profiler/ProfilerMarkers.h | 46 +++++++++++++++++++ tools/profiler/moz.build | 1 + widget/gonk/GeckoTouchDispatcher.cpp | 11 ++--- 5 files changed, 99 insertions(+), 11 deletions(-) diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index 38e4f2d03bb..787fa32457a 100644 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -35,6 +35,8 @@ #include "nsTArray.h" // for nsAutoTArray #include "TextRenderer.h" // for TextRenderer #include +#include "GeckoProfiler.h" // for GeckoProfiler +#include "ProfilerMarkers.h" // for ProfilerMarkers #define CULLING_LOG(...) // #define CULLING_LOG(...) printf_stderr("CULLING: " __VA_ARGS__) @@ -115,7 +117,9 @@ static void DrawLayerInfo(const RenderTargetIntRect& aClipRect, static void PrintUniformityInfo(Layer* aLayer) { - static TimeStamp t0 = TimeStamp::Now(); + if (!profiler_is_active()) { + return; + } // Don't want to print a log for smaller layers if (aLayer->GetEffectiveVisibleRegion().GetBounds().width < 300 || @@ -127,10 +131,10 @@ static void PrintUniformityInfo(Layer* aLayer) if (!transform.Is2D()) { return; } + Point translation = transform.As2D().GetTranslation(); - printf_stderr("UniformityInfo Layer_Move %llu %p %s\n", - (unsigned long long)(TimeStamp::Now() - t0).ToMilliseconds(), aLayer, - ToString(translation).c_str()); + LayerTranslationPayload* payload = new LayerTranslationPayload(aLayer, translation); + PROFILER_MARKER_PAYLOAD("LayerTranslation", payload); } /* all of the per-layer prepared data we need to maintain */ diff --git a/tools/profiler/ProfilerMarkers.cpp b/tools/profiler/ProfilerMarkers.cpp index 1214efe98de..4cbb02f2e43 100644 --- a/tools/profiler/ProfilerMarkers.cpp +++ b/tools/profiler/ProfilerMarkers.cpp @@ -8,6 +8,7 @@ #include "ProfilerMarkers.h" #include "gfxASurface.h" #include "SyncProfile.h" +#include "Layers.h" ProfilerMarkerPayload::ProfilerMarkerPayload(ProfilerBacktrace* aStack) : mStack(aStack) @@ -124,9 +125,46 @@ IOMarkerPayload::streamPayloadImp(JSStreamWriter& b) b.EndObject(); } - void ProfilerJSEventMarker(const char *event) { PROFILER_MARKER(event); } + +LayerTranslationPayload::LayerTranslationPayload(mozilla::layers::Layer* aLayer, + mozilla::gfx::Point aPoint) + : ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr) + , mLayer(aLayer) + , mPoint(aPoint) +{ +} + +void +LayerTranslationPayload::streamPayloadImpl(JSStreamWriter& b) +{ + const size_t bufferSize = 32; + char buffer[bufferSize]; + snprintf(buffer, bufferSize, "%p", mLayer); + + b.BeginObject(); + b.NameValue("layer", buffer); + b.NameValue("x", mPoint.x); + b.NameValue("y", mPoint.y); + b.NameValue("category", "LayerTranslation"); + b.EndObject(); +} + +TouchDataPayload::TouchDataPayload(const mozilla::ScreenIntPoint& aPoint) + : ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr) +{ + mPoint = aPoint; +} + +void +TouchDataPayload::streamPayloadImpl(JSStreamWriter& b) +{ + b.BeginObject(); + b.NameValue("x", mPoint.x); + b.NameValue("y", mPoint.y); + b.EndObject(); +} diff --git a/tools/profiler/ProfilerMarkers.h b/tools/profiler/ProfilerMarkers.h index fc561e52c01..e5691ab0579 100644 --- a/tools/profiler/ProfilerMarkers.h +++ b/tools/profiler/ProfilerMarkers.h @@ -9,6 +9,13 @@ #include "JSStreamWriter.h" #include "mozilla/TimeStamp.h" #include "nsAutoPtr.h" +#include "Units.h" // For ScreenIntPoint + +namespace mozilla { +namespace layers { +class Layer; +} // layers +} // mozilla /** * This is an abstract object that can be implied to supply @@ -122,4 +129,43 @@ private: char* mFilename; }; +/** + * Contains the translation applied to a 2d layer so we can + * track the layer position at each frame. + */ +class LayerTranslationPayload : public ProfilerMarkerPayload +{ +public: + LayerTranslationPayload(mozilla::layers::Layer* aLayer, + mozilla::gfx::Point aPoint); + +protected: + virtual void + streamPayload(JSStreamWriter& b) { return streamPayloadImpl(b); } + +private: + void streamPayloadImpl(JSStreamWriter& b); + mozilla::layers::Layer* mLayer; + mozilla::gfx::Point mPoint; +}; + +/** + * Tracks when touch events are processed by gecko, not when + * the touch actually occured in gonk/android. + */ +class TouchDataPayload : public ProfilerMarkerPayload +{ +public: + TouchDataPayload(const mozilla::ScreenIntPoint& aPoint); + virtual ~TouchDataPayload() {} + +protected: + virtual void + streamPayload(JSStreamWriter& b) { return streamPayloadImpl(b); } + +private: + void streamPayloadImpl(JSStreamWriter& b); + mozilla::ScreenIntPoint mPoint; +}; + #endif // PROFILER_MARKERS_H diff --git a/tools/profiler/moz.build b/tools/profiler/moz.build index 10790bc9b97..ca212140f3f 100644 --- a/tools/profiler/moz.build +++ b/tools/profiler/moz.build @@ -15,6 +15,7 @@ if CONFIG['MOZ_ENABLE_PROFILER_SPS']: EXPORTS += [ 'GeckoProfilerFunc.h', 'GeckoProfilerImpl.h', + 'JSStreamWriter.h', 'ProfilerMarkers.h', 'PseudoStack.h', 'shared-libraries.h', diff --git a/widget/gonk/GeckoTouchDispatcher.cpp b/widget/gonk/GeckoTouchDispatcher.cpp index 9eae2195d3c..fc48397f042 100644 --- a/widget/gonk/GeckoTouchDispatcher.cpp +++ b/widget/gonk/GeckoTouchDispatcher.cpp @@ -19,6 +19,7 @@ #include "GeckoProfiler.h" #include "GeckoTouchDispatcher.h" #include "InputData.h" +#include "ProfilerMarkers.h" #include "base/basictypes.h" #include "gfxPrefs.h" #include "libui/Input.h" @@ -379,7 +380,7 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch) WidgetTouchEvent event = aMultiTouch.ToWidgetTouchEvent(nullptr); nsEventStatus status = nsWindow::DispatchInputEvent(event, &captured); - if (mEnabledUniformityInfo) { + if (mEnabledUniformityInfo && profiler_is_active()) { const char* touchAction = "Invalid"; switch (aMultiTouch.mType) { case MultiTouchInput::MULTITOUCH_START: @@ -394,11 +395,9 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch) break; } - const SingleTouchData& firstTouch = aMultiTouch.mTouches[0]; - const ScreenIntPoint& touchPoint = firstTouch.mScreenPoint; - - LOG("UniformityInfo %s %llu %d %d", touchAction, systemTime(SYSTEM_TIME_MONOTONIC), - touchPoint.x, touchPoint.y); + const ScreenIntPoint& touchPoint = aMultiTouch.mTouches[0].mScreenPoint; + TouchDataPayload* payload = new TouchDataPayload(touchPoint); + PROFILER_MARKER_PAYLOAD(touchAction, payload); } if (!captured && (aMultiTouch.mTouches.Length() == 1)) { From 881a3238b0ef773d8e4f358236bd8dcaae2daa0e Mon Sep 17 00:00:00 2001 From: Shian-Yow Wu Date: Thu, 4 Sep 2014 19:55:00 +0200 Subject: [PATCH 48/60] Bug 1057855 - Fix error checking when calling nsZipArchive::GetItem(). r=smaug --- content/base/src/nsXMLHttpRequest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 0791da2b707..2168f62af3f 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -4074,8 +4074,8 @@ ArrayBufferBuilder::mapToFileInPackage(const nsCString& aFile, return rv; } nsZipItem* zipItem = zip->GetItem(aFile.get()); - if (NS_FAILED(rv)) { - return rv; + if (!zipItem) { + return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST; } // If file was added to the package as stored(uncompressed), map to the From 7fc83e6d8a531cd1540c892d4972e3fabe157072 Mon Sep 17 00:00:00 2001 From: "manu.jain13@gmail.com" Date: Sat, 6 Sep 2014 07:37:00 +0200 Subject: [PATCH 49/60] Bug 1060423 - Cut function in a readonly textarea. r=mfinkle r=markcapella --- mobile/android/chrome/content/SelectionHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/android/chrome/content/SelectionHandler.js b/mobile/android/chrome/content/SelectionHandler.js index 4361d84124c..3b380fd41b2 100644 --- a/mobile/android/chrome/content/SelectionHandler.js +++ b/mobile/android/chrome/content/SelectionHandler.js @@ -797,8 +797,8 @@ var SelectionHandler = { }, isElementEditableText: function (aElement) { - return ((aElement instanceof HTMLInputElement && aElement.mozIsTextField(false)) || - (aElement instanceof HTMLTextAreaElement)); + return (((aElement instanceof HTMLInputElement && aElement.mozIsTextField(false)) || + (aElement instanceof HTMLTextAreaElement)) && !aElement.readOnly); }, /* From be1464c767e16ad932655ca2cad69280a9ecbdb8 Mon Sep 17 00:00:00 2001 From: ffxbld Date: Sat, 6 Sep 2014 03:17:51 -0700 Subject: [PATCH 50/60] No bug, Automated HSTS preload list update from host b-linux64-ix-0009 - a=hsts-update --- security/manager/boot/src/nsSTSPreloadList.errors | 7 ++++--- security/manager/boot/src/nsSTSPreloadList.inc | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/security/manager/boot/src/nsSTSPreloadList.errors b/security/manager/boot/src/nsSTSPreloadList.errors index 63ca8f0d688..51b226356e0 100644 --- a/security/manager/boot/src/nsSTSPreloadList.errors +++ b/security/manager/boot/src/nsSTSPreloadList.errors @@ -46,6 +46,7 @@ email.lookout.com: could not connect to host encrypted.google.com: did not receive HSTS header (error ignored - included regardless) epoxate.com: did not receive HSTS header espra.com: could not connect to host +f-droid.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 124" data: no] fatzebra.com.au: did not receive HSTS header gamesdepartment.co.uk: did not receive HSTS header get.zenpayroll.com: did not receive HSTS header @@ -73,11 +74,11 @@ jitsi.org: did not receive HSTS header jottit.com: could not connect to host keymaster.lookout.com: did not receive HSTS header kiwiirc.com: max-age too low: 5256000 +klaxn.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 124" data: no] ledgerscope.net: did not receive HSTS header liberty.lavabit.com: could not connect to host lifeguard.aecom.com: did not receive HSTS header lists.mayfirst.org: did not receive HSTS header -loenshotel.de: could not connect to host login.corp.google.com: max-age too low: 7776000 (error ignored - included regardless) logotype.se: did not receive HSTS header ludwig.im: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 124" data: no] @@ -110,6 +111,7 @@ profiles.google.com: did not receive HSTS header (error ignored - included regar promecon-gmbh.de: did not receive HSTS header rapidresearch.me: could not connect to host riseup.net: did not receive HSTS header +roddis.net: could not connect to host sah3.net: could not connect to host saturngames.co.uk: did not receive HSTS header script.google.com: did not receive HSTS header (error ignored - included regardless) @@ -148,7 +150,6 @@ www.gmail.com: did not receive HSTS header (error ignored - included regardless) www.googlemail.com: did not receive HSTS header (error ignored - included regardless) www.greplin.com: did not receive HSTS header www.jitsi.org: did not receive HSTS header -www.lastpass.com: did not receive HSTS header www.ledgerscope.net: did not receive HSTS header www.logentries.com: did not receive HSTS header www.moneybookers.com: did not receive HSTS header @@ -156,7 +157,7 @@ www.neonisi.com: could not connect to host www.paycheckrecords.com: max-age too low: 86400 www.paypal.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 124" data: no] www.rme.li: did not receive HSTS header -www.roddis.net: did not receive HSTS header +www.roddis.net: could not connect to host www.sandbox.mydigipass.com: could not connect to host www.surfeasy.com: did not receive HSTS header zoo24.de: max-age too low: 2592000 diff --git a/security/manager/boot/src/nsSTSPreloadList.inc b/security/manager/boot/src/nsSTSPreloadList.inc index 0a5a4f4152e..2e2ad6b5150 100644 --- a/security/manager/boot/src/nsSTSPreloadList.inc +++ b/security/manager/boot/src/nsSTSPreloadList.inc @@ -8,7 +8,7 @@ /*****************************************************************************/ #include -const PRTime gPreloadListExpirationTime = INT64_C(1420280117245000); +const PRTime gPreloadListExpirationTime = INT64_C(1420884435199000); class nsSTSPreload { @@ -152,7 +152,7 @@ static const nsSTSPreload kSTSPreloadList[] = { { "fairbill.com", true }, { "faq.lookout.com", false }, { "feedbin.com", false }, - { "ferienhaus-polchow-ruegen.de", true }, + { "ferienhaus-polchow-ruegen.de", false }, { "fiken.no", true }, { "firemail.io", true }, { "fischer-its.com", true }, @@ -497,6 +497,7 @@ static const nsSTSPreload kSTSPreloadList[] = { { "www.heliosnet.com", true }, { "www.intercom.io", false }, { "www.irccloud.com", false }, + { "www.lastpass.com", false }, { "www.linode.com", false }, { "www.lookout.com", false }, { "www.makeyourlaws.org", true }, From ebb89deb383bf701be10f63644ee80d3158fbc9d Mon Sep 17 00:00:00 2001 From: ffxbld Date: Sat, 6 Sep 2014 03:17:54 -0700 Subject: [PATCH 51/60] No bug, Automated HPKP preload list update from host b-linux64-ix-0009 - a=hpkp-update --- security/manager/boot/src/StaticHPKPins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/manager/boot/src/StaticHPKPins.h b/security/manager/boot/src/StaticHPKPins.h index 19c204523dc..0e90b592c53 100644 --- a/security/manager/boot/src/StaticHPKPins.h +++ b/security/manager/boot/src/StaticHPKPins.h @@ -1087,4 +1087,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = { static const int32_t kUnknownId = -1; -static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1418406258075000); +static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1418465237331000); From dcdc17025abcd8f763498417fc21786911b8788d Mon Sep 17 00:00:00 2001 From: Mason Chang Date: Sat, 6 Sep 2014 12:25:00 +0200 Subject: [PATCH 52/60] Bug 1063265 - Stop Blinking the Text Caret when it isn't visible. r=roc --- layout/base/nsCaret.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index 6316c18c9d6..a67a2054564 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -548,7 +548,7 @@ void nsCaret::ResetBlinking() { mIsBlinkOn = true; - if (mReadOnly) { + if (mReadOnly || !mVisible) { StopBlinking(); return; } From 629a3afc22f3daaab3bbcc88a178c628dc79b566 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 8 Sep 2014 00:10:52 -0700 Subject: [PATCH 53/60] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c1fd0c75afd4 Author: Carsten Book Desc: Merge pull request #23710 from kamituel/Bug_1026373_remove_shrinking_rejected Bug 1026373 - Remove unused shrinking-rejected. r=gweng ======== https://hg.mozilla.org/integration/gaia-central/rev/116515f35ca7 Author: Kamil Leszczuk Desc: Bug 1026373: Remove unused shrinking-rejected --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 50ac55336ba..758a1534c30 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "99aad80c93e93d0afa1781d53c97bf08ed2c7536", + "revision": "c1fd0c75afd4ccbc7f32465d50d3022eaa55e7b6", "repo_path": "/integration/gaia-central" } From 3f0a8d5a4defee50db3b6ae5f98097fd5037aa5c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 8 Sep 2014 00:17:14 -0700 Subject: [PATCH 54/60] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index c7a9e297ef1..fb50bd7498f 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 4a995d15958..98e826f3134 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 7adba69f68e..c6863bc3960 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 6fc56362146..32e8d3981ef 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 4a995d15958..98e826f3134 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 5508a933752..76b53aa6efa 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 6d0cb235d7f..60e5ab9012a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index d8851faaad6..86adf88687b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index bc806ed1807..fc05afddfbf 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index bedf475be7a..a5586e3ebcb 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index f2ed8141241..aac51f2a3c6 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 8bdb5817d4beb8f2bd625f7df4990f544fa4ac3a Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 8 Sep 2014 10:17:52 +0200 Subject: [PATCH 55/60] Backed out changeset cfeccb9028a9 (bug 1062611) for dt-test failures --- browser/devtools/webide/test/browser.ini | 2 +- browser/devtools/webide/test/browser_tabs.js | 18 ++++++++---------- browser/devtools/webide/test/doc_tabs.html | 15 --------------- browser/devtools/webide/test/head.js | 5 ----- 4 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 browser/devtools/webide/test/doc_tabs.html diff --git a/browser/devtools/webide/test/browser.ini b/browser/devtools/webide/test/browser.ini index 28594a69bb6..a31e8822933 100644 --- a/browser/devtools/webide/test/browser.ini +++ b/browser/devtools/webide/test/browser.ini @@ -2,8 +2,8 @@ subsuite = devtools support-files = addons/simulators.json - doc_tabs.html head.js templates.json [browser_tabs.js] +skip-if = true # Fails on TBPL, to be fixed in bug 1062611 diff --git a/browser/devtools/webide/test/browser_tabs.js b/browser/devtools/webide/test/browser_tabs.js index 1b9883455b8..4e57ee007b2 100644 --- a/browser/devtools/webide/test/browser_tabs.js +++ b/browser/devtools/webide/test/browser_tabs.js @@ -2,8 +2,6 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -const TEST_URI = "http://example.com/browser/browser/devtools/webide/test/doc_tabs.html"; - function test() { waitForExplicitFinish(); SimpleTest.requestCompleteLog(); @@ -11,12 +9,10 @@ function test() { Task.spawn(function() { const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {}); - if (!DebuggerServer.initialized) { - DebuggerServer.init(function () { return true; }); - DebuggerServer.addBrowserActors(); - } + DebuggerServer.init(function () { return true; }); + DebuggerServer.addBrowserActors(); - let tab = yield addTab(TEST_URI); + let tab = yield addTab("about:newtab"); let win = yield openWebIDE(); @@ -27,13 +23,15 @@ function test() { yield selectTabProject(win); let project = win.AppManager.selectedProject; - is(project.location, TEST_URI, "Location is correct"); - is(project.name, "example.com: Test Tab", "Name is correct"); + is(project.location, "about:newtab", "Location is correct"); + is(project.name, "New Tab", "Name is correct"); yield closeWebIDE(win); DebuggerServer.destroy(); yield removeTab(tab); - }).then(finish, handleError); + + finish(); + }); } function connectToLocal(win) { diff --git a/browser/devtools/webide/test/doc_tabs.html b/browser/devtools/webide/test/doc_tabs.html deleted file mode 100644 index 4901289fc78..00000000000 --- a/browser/devtools/webide/test/doc_tabs.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - Test Tab - - - - Test Tab - - - diff --git a/browser/devtools/webide/test/head.js b/browser/devtools/webide/test/head.js index eff32d4bc6b..a583b763647 100644 --- a/browser/devtools/webide/test/head.js +++ b/browser/devtools/webide/test/head.js @@ -153,8 +153,3 @@ function removeTab(aTab, aWindow) { targetBrowser.removeTab(aTab); return deferred.promise; } - -function handleError(aError) { - ok(false, "Got an error: " + aError.message + "\n" + aError.stack); - finish(); -} From 4df6cb96d67971a4c2b1b6fba58f7a67fe6c99a2 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 8 Sep 2014 10:19:23 +0200 Subject: [PATCH 56/60] Backed out changeset 6a6f51ad3348 (bug 1036914) for likely causing bc1 test error --- browser/modules/BrowserUITelemetry.jsm | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/browser/modules/BrowserUITelemetry.jsm b/browser/modules/BrowserUITelemetry.jsm index c4375f4a3ea..e7e5de3f281 100644 --- a/browser/modules/BrowserUITelemetry.jsm +++ b/browser/modules/BrowserUITelemetry.jsm @@ -179,7 +179,6 @@ this.BrowserUITelemetry = { Services.obs.addObserver(this, "sessionstore-windows-restored", false); Services.obs.addObserver(this, "browser-delayed-startup-finished", false); - Services.obs.addObserver(this, "autocomplete-did-enter-text", false); CustomizableUI.addListener(this); }, @@ -191,13 +190,6 @@ this.BrowserUITelemetry = { case "browser-delayed-startup-finished": this._registerWindow(aSubject); break; - case "autocomplete-did-enter-text": - let input = aSubject.QueryInterface(Ci.nsIAutoCompleteInput); - if (input && input.id == "urlbar" && !input.inPrivateContext && - input.popup.selectedIndex != -1) { - this._logAwesomeBarSearchResult(input.textValue); - } - break; } }, @@ -572,17 +564,6 @@ this.BrowserUITelemetry = { } }, - _logAwesomeBarSearchResult: function (url) { - let spec = Services.search.parseSubmissionURL(url); - if (spec.engine) { - let matchedEngine = "default"; - if (spec.engine.name !== Services.search.currentEngine.name) { - matchedEngine = "other"; - } - this.countSearchEvent("autocomplete-" + matchedEngine); - } - }, - _durations: { customization: [], }, From f29210c66089dd97a99f8497c8bbf47cdd9e29bf Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 8 Sep 2014 10:19:39 +0200 Subject: [PATCH 57/60] Backed out changeset ceb9328526e0 (bug 1036912) for bc1 test errors --- browser/base/content/newtab/search.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/browser/base/content/newtab/search.js b/browser/base/content/newtab/search.js index 251c236ede8..5038b633009 100644 --- a/browser/base/content/newtab/search.js +++ b/browser/base/content/newtab/search.js @@ -35,21 +35,11 @@ let gSearch = { } let searchStr = this._nodes.text.value; if (this.currentEngineName && searchStr.length) { - - let eventData = { + this._send("Search", { engineName: this.currentEngineName, searchString: searchStr, whence: "newtab", - } - - if (searchText.hasAttribute("selection-index")) { - eventData.selection = { - index: searchText.getAttribute("selection-index"), - kind: searchText.getAttribute("selection-kind") - }; - } - - this._send("Search", eventData); + }); } this._suggestionController.addInputValueToFormHistory(); }, From 1bc7dd4191763d92f0ff575b26a609054ccb07ff Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 8 Sep 2014 10:19:50 +0200 Subject: [PATCH 58/60] Backed out changeset b556a4fdfe52 (bug 1036908) for bc1 test errors --- browser/base/content/abouthome/aboutHome.js | 18 +++--------------- browser/base/content/browser.js | 8 ++------ browser/base/content/searchSuggestionUI.js | 9 --------- browser/docs/UITelemetry.rst | 11 ----------- browser/modules/AboutHome.jsm | 2 +- browser/modules/BrowserUITelemetry.jsm | 5 +---- browser/modules/ContentSearch.jsm | 2 +- 7 files changed, 8 insertions(+), 47 deletions(-) diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/abouthome/aboutHome.js index d9ef6c16692..1b9e76b428e 100644 --- a/browser/base/content/abouthome/aboutHome.js +++ b/browser/base/content/abouthome/aboutHome.js @@ -298,28 +298,16 @@ function ensureSnippetsMapThen(aCallback) function onSearchSubmit(aEvent) { - let searchText = document.getElementById("searchText"); - let searchTerms = searchText.value; + let searchTerms = document.getElementById("searchText").value; let engineName = document.documentElement.getAttribute("searchEngineName"); if (engineName && searchTerms.length > 0) { // Send an event that will perform a search and Firefox Health Report will // record that a search from about:home has occurred. - - let eventData = { + let eventData = JSON.stringify({ engineName: engineName, searchTerms: searchTerms - }; - - if (searchText.hasAttribute("selection-index")) { - eventData.selection = { - index: searchText.getAttribute("selection-index"), - kind: searchText.getAttribute("selection-kind") - }; - } - - eventData = JSON.stringify(eventData); - + }); let event = new CustomEvent("AboutHomeSearchEvent", {detail: eventData}); document.dispatchEvent(event); } diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index acfb57f5230..d07579831e0 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3122,13 +3122,9 @@ const BrowserSearch = { * @param source * (string) Where the search originated from. See the FHR * SearchesProvider for allowed values. - * @param selection [optional] - * ({index: The selected index, kind: "key" or "mouse"}) If - * the search was a suggested search, this indicates where the - * item was in the suggestion list and how the user selected it. */ - recordSearchInHealthReport: function (engine, source, selection) { - BrowserUITelemetry.countSearchEvent(source, null, selection); + recordSearchInHealthReport: function (engine, source) { + BrowserUITelemetry.countSearchEvent(source); #ifdef MOZ_SERVICES_HEALTHREPORT let reporter = Cc["@mozilla.org/datareporting/service;1"] .getService() diff --git a/browser/base/content/searchSuggestionUI.js b/browser/base/content/searchSuggestionUI.js index 5b3fa59963e..f5594c24cfb 100644 --- a/browser/base/content/searchSuggestionUI.js +++ b/browser/base/content/searchSuggestionUI.js @@ -179,13 +179,6 @@ SearchSuggestionUIController.prototype = { case event.DOM_VK_RETURN: if (this.selectedIndex >= 0) { this.input.value = this.suggestionAtIndex(this.selectedIndex); - this.input.setAttribute("selection-index", this.selectedIndex); - this.input.setAttribute("selection-kind", "key"); - } else { - // If we didn't select anything, make sure to remove the attributes - // in case they were populated last time. - this.input.removeAttribute("selection-index"); - this.input.removeAttribute("selection-kind"); } this._stickyInputValue = this.input.value; this._hideSuggestions(); @@ -235,8 +228,6 @@ SearchSuggestionUIController.prototype = { let suggestion = this.suggestionAtIndex(idx); this._stickyInputValue = suggestion; this.input.value = suggestion; - this.input.setAttribute("selection-index", idx); - this.input.setAttribute("selection-kind", "mouse"); this._hideSuggestions(); if (this.onClick) { this.onClick.call(null); diff --git a/browser/docs/UITelemetry.rst b/browser/docs/UITelemetry.rst index 2c6dcb6df82..45f91984930 100644 --- a/browser/docs/UITelemetry.rst +++ b/browser/docs/UITelemetry.rst @@ -71,17 +71,6 @@ object with the following properties: - ``move`` counts the number of times an item is moved somewhere else (but not to the palette); - ``remove`` counts the number of times an item is removed to the palette; - ``reset`` counts the number of times the 'restore defaults' button is used; -- ``search`` is an object tracking searches of various types, keyed off the search - location, storing a number indicating how often the respective type of search - has happened. - - There are also two special keys that mean slightly different things. - - ``urlbar-keyword`` records searches that would have been an invalid-protocol - error, but are now keyword searches. They are also counted in the ``urlbar`` - keyword (along with all the other urlbar searches). - - ``selection`` searches records selections of search suggestions. They include - the source, the index of the selection, and the kind of selection (mouse or - enter key). Selection searches are also counted in their sources. - ``UITour`` diff --git a/browser/modules/AboutHome.jsm b/browser/modules/AboutHome.jsm index 3c0d480eee6..ea00029ab54 100644 --- a/browser/modules/AboutHome.jsm +++ b/browser/modules/AboutHome.jsm @@ -191,7 +191,7 @@ let AboutHome = { let engine = Services.search.currentEngine; #ifdef MOZ_SERVICES_HEALTHREPORT - window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome", data.selection); + window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome"); #endif // Trigger a search through nsISearchEngine.getSubmission() let submission = engine.getSubmission(data.searchTerms, null, "homepage"); diff --git a/browser/modules/BrowserUITelemetry.jsm b/browser/modules/BrowserUITelemetry.jsm index e7e5de3f281..3ace39ce768 100644 --- a/browser/modules/BrowserUITelemetry.jsm +++ b/browser/modules/BrowserUITelemetry.jsm @@ -554,14 +554,11 @@ this.BrowserUITelemetry = { this._countEvent(["customize", aEventType]); }, - countSearchEvent: function(source, query, selection) { + countSearchEvent: function(source, query) { this._countEvent(["search", source]); if ((/^[a-zA-Z]+:[^\/\\]/).test(query)) { this._countEvent(["search", "urlbar-keyword"]); } - if (selection) { - this._countEvent(["search", "selection", source, selection.index, selection.kind]); - } }, _durations: { diff --git a/browser/modules/ContentSearch.jsm b/browser/modules/ContentSearch.jsm index 6acc6e14b6d..02a1a8616ce 100644 --- a/browser/modules/ContentSearch.jsm +++ b/browser/modules/ContentSearch.jsm @@ -206,7 +206,7 @@ this.ContentSearch = { ]); let browserWin = msg.target.ownerDocument.defaultView; let engine = Services.search.getEngineByName(data.engineName); - browserWin.BrowserSearch.recordSearchInHealthReport(engine, data.whence, data.selection); + browserWin.BrowserSearch.recordSearchInHealthReport(engine, data.whence); let submission = engine.getSubmission(data.searchString, "", data.whence); browserWin.loadURI(submission.uri.spec, null, submission.postData); return Promise.resolve(); From b45fbd360cd423896e6a32325fa120fd1ecc7573 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 8 Sep 2014 11:30:32 +0200 Subject: [PATCH 59/60] Backed out changeset 56606aa26f45 (bug 1053185) --- b2g/dev/app/moz.build | 3 --- 1 file changed, 3 deletions(-) diff --git a/b2g/dev/app/moz.build b/b2g/dev/app/moz.build index bdb19346930..6fbe8159b2d 100644 --- a/b2g/dev/app/moz.build +++ b/b2g/dev/app/moz.build @@ -1,6 +1,3 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. - -DIST_SUBDIR = 'browser' -export('DIST_SUBDIR') From 18b29adc199d0f84a831ffa5b728de4fbe0e3aa2 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 8 Sep 2014 15:17:23 +0200 Subject: [PATCH 60/60] Backed out changeset c1cc52b986f8 (bug 1049258) for breaking non-unified windows builds --- .../composite/ContainerLayerComposite.cpp | 12 ++--- tools/profiler/ProfilerMarkers.cpp | 40 +--------------- tools/profiler/ProfilerMarkers.h | 46 ------------------- tools/profiler/moz.build | 1 - widget/gonk/GeckoTouchDispatcher.cpp | 11 +++-- 5 files changed, 11 insertions(+), 99 deletions(-) diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index 787fa32457a..38e4f2d03bb 100644 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -35,8 +35,6 @@ #include "nsTArray.h" // for nsAutoTArray #include "TextRenderer.h" // for TextRenderer #include -#include "GeckoProfiler.h" // for GeckoProfiler -#include "ProfilerMarkers.h" // for ProfilerMarkers #define CULLING_LOG(...) // #define CULLING_LOG(...) printf_stderr("CULLING: " __VA_ARGS__) @@ -117,9 +115,7 @@ static void DrawLayerInfo(const RenderTargetIntRect& aClipRect, static void PrintUniformityInfo(Layer* aLayer) { - if (!profiler_is_active()) { - return; - } + static TimeStamp t0 = TimeStamp::Now(); // Don't want to print a log for smaller layers if (aLayer->GetEffectiveVisibleRegion().GetBounds().width < 300 || @@ -131,10 +127,10 @@ static void PrintUniformityInfo(Layer* aLayer) if (!transform.Is2D()) { return; } - Point translation = transform.As2D().GetTranslation(); - LayerTranslationPayload* payload = new LayerTranslationPayload(aLayer, translation); - PROFILER_MARKER_PAYLOAD("LayerTranslation", payload); + printf_stderr("UniformityInfo Layer_Move %llu %p %s\n", + (unsigned long long)(TimeStamp::Now() - t0).ToMilliseconds(), aLayer, + ToString(translation).c_str()); } /* all of the per-layer prepared data we need to maintain */ diff --git a/tools/profiler/ProfilerMarkers.cpp b/tools/profiler/ProfilerMarkers.cpp index 4cbb02f2e43..1214efe98de 100644 --- a/tools/profiler/ProfilerMarkers.cpp +++ b/tools/profiler/ProfilerMarkers.cpp @@ -8,7 +8,6 @@ #include "ProfilerMarkers.h" #include "gfxASurface.h" #include "SyncProfile.h" -#include "Layers.h" ProfilerMarkerPayload::ProfilerMarkerPayload(ProfilerBacktrace* aStack) : mStack(aStack) @@ -125,46 +124,9 @@ IOMarkerPayload::streamPayloadImp(JSStreamWriter& b) b.EndObject(); } + void ProfilerJSEventMarker(const char *event) { PROFILER_MARKER(event); } - -LayerTranslationPayload::LayerTranslationPayload(mozilla::layers::Layer* aLayer, - mozilla::gfx::Point aPoint) - : ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr) - , mLayer(aLayer) - , mPoint(aPoint) -{ -} - -void -LayerTranslationPayload::streamPayloadImpl(JSStreamWriter& b) -{ - const size_t bufferSize = 32; - char buffer[bufferSize]; - snprintf(buffer, bufferSize, "%p", mLayer); - - b.BeginObject(); - b.NameValue("layer", buffer); - b.NameValue("x", mPoint.x); - b.NameValue("y", mPoint.y); - b.NameValue("category", "LayerTranslation"); - b.EndObject(); -} - -TouchDataPayload::TouchDataPayload(const mozilla::ScreenIntPoint& aPoint) - : ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr) -{ - mPoint = aPoint; -} - -void -TouchDataPayload::streamPayloadImpl(JSStreamWriter& b) -{ - b.BeginObject(); - b.NameValue("x", mPoint.x); - b.NameValue("y", mPoint.y); - b.EndObject(); -} diff --git a/tools/profiler/ProfilerMarkers.h b/tools/profiler/ProfilerMarkers.h index e5691ab0579..fc561e52c01 100644 --- a/tools/profiler/ProfilerMarkers.h +++ b/tools/profiler/ProfilerMarkers.h @@ -9,13 +9,6 @@ #include "JSStreamWriter.h" #include "mozilla/TimeStamp.h" #include "nsAutoPtr.h" -#include "Units.h" // For ScreenIntPoint - -namespace mozilla { -namespace layers { -class Layer; -} // layers -} // mozilla /** * This is an abstract object that can be implied to supply @@ -129,43 +122,4 @@ private: char* mFilename; }; -/** - * Contains the translation applied to a 2d layer so we can - * track the layer position at each frame. - */ -class LayerTranslationPayload : public ProfilerMarkerPayload -{ -public: - LayerTranslationPayload(mozilla::layers::Layer* aLayer, - mozilla::gfx::Point aPoint); - -protected: - virtual void - streamPayload(JSStreamWriter& b) { return streamPayloadImpl(b); } - -private: - void streamPayloadImpl(JSStreamWriter& b); - mozilla::layers::Layer* mLayer; - mozilla::gfx::Point mPoint; -}; - -/** - * Tracks when touch events are processed by gecko, not when - * the touch actually occured in gonk/android. - */ -class TouchDataPayload : public ProfilerMarkerPayload -{ -public: - TouchDataPayload(const mozilla::ScreenIntPoint& aPoint); - virtual ~TouchDataPayload() {} - -protected: - virtual void - streamPayload(JSStreamWriter& b) { return streamPayloadImpl(b); } - -private: - void streamPayloadImpl(JSStreamWriter& b); - mozilla::ScreenIntPoint mPoint; -}; - #endif // PROFILER_MARKERS_H diff --git a/tools/profiler/moz.build b/tools/profiler/moz.build index ca212140f3f..10790bc9b97 100644 --- a/tools/profiler/moz.build +++ b/tools/profiler/moz.build @@ -15,7 +15,6 @@ if CONFIG['MOZ_ENABLE_PROFILER_SPS']: EXPORTS += [ 'GeckoProfilerFunc.h', 'GeckoProfilerImpl.h', - 'JSStreamWriter.h', 'ProfilerMarkers.h', 'PseudoStack.h', 'shared-libraries.h', diff --git a/widget/gonk/GeckoTouchDispatcher.cpp b/widget/gonk/GeckoTouchDispatcher.cpp index fc48397f042..9eae2195d3c 100644 --- a/widget/gonk/GeckoTouchDispatcher.cpp +++ b/widget/gonk/GeckoTouchDispatcher.cpp @@ -19,7 +19,6 @@ #include "GeckoProfiler.h" #include "GeckoTouchDispatcher.h" #include "InputData.h" -#include "ProfilerMarkers.h" #include "base/basictypes.h" #include "gfxPrefs.h" #include "libui/Input.h" @@ -380,7 +379,7 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch) WidgetTouchEvent event = aMultiTouch.ToWidgetTouchEvent(nullptr); nsEventStatus status = nsWindow::DispatchInputEvent(event, &captured); - if (mEnabledUniformityInfo && profiler_is_active()) { + if (mEnabledUniformityInfo) { const char* touchAction = "Invalid"; switch (aMultiTouch.mType) { case MultiTouchInput::MULTITOUCH_START: @@ -395,9 +394,11 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch) break; } - const ScreenIntPoint& touchPoint = aMultiTouch.mTouches[0].mScreenPoint; - TouchDataPayload* payload = new TouchDataPayload(touchPoint); - PROFILER_MARKER_PAYLOAD(touchAction, payload); + const SingleTouchData& firstTouch = aMultiTouch.mTouches[0]; + const ScreenIntPoint& touchPoint = firstTouch.mScreenPoint; + + LOG("UniformityInfo %s %llu %d %d", touchAction, systemTime(SYSTEM_TIME_MONOTONIC), + touchPoint.x, touchPoint.y); } if (!captured && (aMultiTouch.mTouches.Length() == 1)) {