Backed out 4 changesets (bug 1415342) for bc failures in browser/components/preferences/in-content/tests/siteData/browser_clearSiteData.js on a CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Thu, 19 Apr 2018 10:37:30 +0300
changeset 467950 2c32c973232d7362ca9dfe103e1c3a4863e9a423
parent 467949 8218cd8d6ec1a86a2b23e5e3fa3f5b8e19a57977
child 467979 8ed49dd81059dfdd876cf62ad5def1cfa56ffbbf
child 467981 40a6f6d55dfad3bb644ccbd2fad35cdee9e7303b
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1415342
milestone61.0a1
backs out36ff321fc1b832f20d6e54e9a619900a94459775
d7e30b8499cdcda4c45488cd1377e517ccc0bb88
4913f1571ece4a881302570e156cd7a5b24ebcd2
25d665693e38463818f4387657643cc193ffed69
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1415342) for bc failures in browser/components/preferences/in-content/tests/siteData/browser_clearSiteData.js on a CLOSED TREE Backed out changeset 36ff321fc1b8 (bug 1415342) Backed out changeset d7e30b8499cd (bug 1415342) Backed out changeset 4913f1571ece (bug 1415342) Backed out changeset 25d665693e38 (bug 1415342)
browser/base/content/test/general/browser_offlineQuotaNotification.js
browser/components/preferences/in-content/tests/siteData/head.js
browser/modules/Sanitizer.jsm
browser/modules/moz.build
browser/modules/offlineAppCache.jsm
mobile/android/modules/Sanitizer.jsm
toolkit/modules/moz.build
toolkit/modules/offlineAppCache.jsm
--- a/browser/base/content/test/general/browser_offlineQuotaNotification.js
+++ b/browser/base/content/test/general/browser_offlineQuotaNotification.js
@@ -10,17 +10,17 @@ const URL = "http://mochi.test:8888/brow
 
 registerCleanupFunction(function() {
   // Clean up after ourself
   let uri = Services.io.newURI(URL);
   let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
   Services.perms.removeFromPrincipal(principal, "offline-app");
   Services.prefs.clearUserPref("offline-apps.quota.warn");
   Services.prefs.clearUserPref("offline-apps.allow_by_default");
-  let {OfflineAppCacheHelper} = ChromeUtils.import("resource://gre/modules/offlineAppCache.jsm", {});
+  let {OfflineAppCacheHelper} = ChromeUtils.import("resource:///modules/offlineAppCache.jsm", {});
   OfflineAppCacheHelper.clear();
 });
 
 // Same as the other one, but for in-content preferences
 function checkInContentPreferences(win) {
   let doc = win.document;
   let sel = doc.getElementById("categories").selectedItems[0].id;
   is(gBrowser.currentURI.spec, "about:preferences#privacy", "about:preferences loaded");
--- a/browser/components/preferences/in-content/tests/siteData/head.js
+++ b/browser/components/preferences/in-content/tests/siteData/head.js
@@ -10,17 +10,17 @@ const TEST_OFFLINE_HOST = "example.org";
 const TEST_OFFLINE_ORIGIN = "https://" + TEST_OFFLINE_HOST;
 const TEST_OFFLINE_URL = getRootDirectory(gTestPath).replace("chrome://mochitests/content", TEST_OFFLINE_ORIGIN) + "/offline/offline.html";
 const TEST_SERVICE_WORKER_URL = getRootDirectory(gTestPath).replace("chrome://mochitests/content", TEST_OFFLINE_ORIGIN) + "/service_worker_test.html";
 
 const REMOVE_DIALOG_URL = "chrome://browser/content/preferences/siteDataRemoveSelected.xul";
 
 const { DownloadUtils } = ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm", {});
 const { SiteDataManager } = ChromeUtils.import("resource:///modules/SiteDataManager.jsm", {});
-const { OfflineAppCacheHelper } = ChromeUtils.import("resource://gre/modules/offlineAppCache.jsm", {});
+const { OfflineAppCacheHelper } = ChromeUtils.import("resource:///modules/offlineAppCache.jsm", {});
 
 ChromeUtils.defineModuleGetter(this, "SiteDataTestUtils",
                                "resource://testing-common/SiteDataTestUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "serviceWorkerManager", "@mozilla.org/serviceworkers/manager;1", "nsIServiceWorkerManager");
 
 function promiseSiteDataManagerSitesUpdated() {
   return TestUtils.topicObserved("sitedatamanager:sites-updated", () => true);
--- a/browser/modules/Sanitizer.jsm
+++ b/browser/modules/Sanitizer.jsm
@@ -12,17 +12,17 @@ XPCOMUtils.defineLazyModuleGetters(this,
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   FormHistory: "resource://gre/modules/FormHistory.jsm",
   Downloads: "resource://gre/modules/Downloads.jsm",
   DownloadsCommon: "resource:///modules/DownloadsCommon.jsm",
   TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
   setTimeout: "resource://gre/modules/Timer.jsm",
   ServiceWorkerCleanUp: "resource://gre/modules/ServiceWorkerCleanUp.jsm",
-  OfflineAppCacheHelper: "resource://gre/modules/offlineAppCache.jsm",
+  OfflineAppCacheHelper: "resource:///modules/offlineAppCache.jsm",
 });
 
 XPCOMUtils.defineLazyServiceGetter(this, "sas",
                                    "@mozilla.org/storage/activity-service;1",
                                    "nsIStorageActivityService");
 XPCOMUtils.defineLazyServiceGetter(this, "quotaManagerService",
                                    "@mozilla.org/dom/quota-manager-service;1",
                                    "nsIQuotaManagerService");
@@ -270,20 +270,16 @@ var Sanitizer = {
     }
   },
 
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsiObserver,
     Ci.nsISupportsWeakReference
   ]),
 
-  // When making any changes to the sanitize implementations here,
-  // please check whether the changes are applicable to Android
-  // (mobile/android/modules/Sanitizer.jsm) as well.
-
   items: {
     cache: {
       async clear(range) {
         let seenException;
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_CACHE", refObj);
 
         try {
--- a/browser/modules/moz.build
+++ b/browser/modules/moz.build
@@ -101,16 +101,19 @@ with Files("Windows8WindowFrameColor.jsm
     BUG_COMPONENT = ("Firefox", "Theme")
 
 with Files("WindowsJumpLists.jsm"):
     BUG_COMPONENT = ("Firefox", "Shell Integration")
 
 with Files("WindowsPreviewPerTab.jsm"):
     BUG_COMPONENT = ("Core", "Widget: Win32")
 
+with Files("offlineAppCache.jsm"):
+    BUG_COMPONENT = ("Firefox", "Preferences")
+
 with Files("UpdateTopLevelContentWindowIDHelper.jsm"):
     BUG_COMPONENT = ("Core", "Networking")
 
 with Files("webrtcUI.jsm"):
     BUG_COMPONENT = ("Firefox", "Device Permissions")
 
 with Files("ZoomUI.jsm"):
     BUG_COMPONENT = ("Firefox", "Toolbars and Customization")
@@ -138,16 +141,17 @@ EXTRA_JS_MODULES += [
     'ContentSearch.jsm',
     'ContentWebRTC.jsm',
     'ContextMenu.jsm',
     'ExtensionsUI.jsm',
     'Feeds.jsm',
     'FormSubmitObserver.jsm',
     'FormValidationHandler.jsm',
     'LaterRun.jsm',
+    'offlineAppCache.jsm',
     'OpenInTabsUtils.jsm',
     'PageActions.jsm',
     'PermissionUI.jsm',
     'PingCentre.jsm',
     'PluginContent.jsm',
     'ProcessHangMonitor.jsm',
     'ReaderParent.jsm',
     'RecentWindow.jsm',
rename from toolkit/modules/offlineAppCache.jsm
rename to browser/modules/offlineAppCache.jsm
--- a/mobile/android/modules/Sanitizer.jsm
+++ b/mobile/android/modules/Sanitizer.jsm
@@ -8,28 +8,21 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   Accounts: "resource://gre/modules/Accounts.jsm",
   DownloadIntegration: "resource://gre/modules/DownloadIntegration.jsm",
   Downloads: "resource://gre/modules/Downloads.jsm",
   EventDispatcher: "resource://gre/modules/Messaging.jsm",
   FormHistory: "resource://gre/modules/FormHistory.jsm",
-  OfflineAppCacheHelper: "resource://gre/modules/offlineAppCache.jsm",
   OS: "resource://gre/modules/osfile.jsm",
-  ServiceWorkerCleanUp: "resource://gre/modules/ServiceWorkerCleanUp.jsm",
   Task: "resource://gre/modules/Task.jsm",
   TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
 });
 
-XPCOMUtils.defineLazyServiceGetters(this, {
-  quotaManagerService: ["@mozilla.org/dom/quota-manager-service;1", "nsIQuotaManagerService"],
-});
-
-
 var EXPORTED_SYMBOLS = ["Sanitizer"];
 
 function Sanitizer() {}
 Sanitizer.prototype = {
   clearItem: function(aItemName, startTime) {
     // Only a subset of items support deletion with startTime.
     // Those who do not will be rejected with error message.
     if (typeof startTime != "undefined") {
@@ -62,26 +55,17 @@ Sanitizer.prototype = {
         }
       };
       return maybeDoClear();
     } else if (canClear) {
       return item.clear(options);
     }
   },
 
-  // This code is mostly based on the Sanitizer code for desktop Firefox
-  // (browser/modules/Sanitzer.jsm), however over the course of time some
-  // general differences have evolved:
-  // - async shutdown (and seenException handling) isn't implemented in Fennec
-  // - currently there is only limited support for range-based clearing of data
-
-  // Any further specific differences caused by architectural differences between
-  // Fennec and desktop Firefox are documented below for each item.
   items: {
-    // Same as desktop Firefox.
     cache: {
       clear: function() {
         return new Promise(function(resolve, reject) {
           let refObj = {};
           TelemetryStopwatch.start("FX_SANITIZE_CACHE", refObj);
 
           try {
             Services.cache2.clear();
@@ -98,45 +82,34 @@ Sanitizer.prototype = {
         });
       },
 
       get canClear() {
         return true;
       }
     },
 
-    // Compared to desktop, we don't clear plugin data, as plugins
-    // aren't supported on Android.
     cookies: {
       clear: function() {
         return new Promise(function(resolve, reject) {
           let refObj = {};
           TelemetryStopwatch.start("FX_SANITIZE_COOKIES_2", refObj);
 
           Services.cookies.removeAll();
 
           TelemetryStopwatch.finish("FX_SANITIZE_COOKIES_2", refObj);
-
-          // Clear deviceIds. Done asynchronously (returns before complete).
-          try {
-            let mediaMgr = Cc["@mozilla.org/mediaManagerService;1"]
-                             .getService(Ci.nsIMediaManagerService);
-            mediaMgr.sanitizeDeviceIds(0);
-          } catch (er) { }
-
           resolve();
         });
       },
 
       get canClear() {
         return true;
       }
     },
 
-    // Same as desktop Firefox.
     siteSettings: {
       clear: Task.async(function* () {
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_SITESETTINGS", refObj);
 
         // Clear site-specific permissions like "Allow this site to open popups"
         Services.perms.removeAll();
 
@@ -166,64 +139,33 @@ Sanitizer.prototype = {
         TelemetryStopwatch.finish("FX_SANITIZE_SITESETTINGS", refObj);
       }),
 
       get canClear() {
         return true;
       }
     },
 
-    // Same as desktop Firefox.
     offlineApps: {
-      async clear() {
-        // AppCache
-        // This doesn't wait for the cleanup to be complete.
-        OfflineAppCacheHelper.clear();
-
-        // LocalStorage
-        Services.obs.notifyObservers(null, "extension:purge-localStorage");
-
-        // ServiceWorkers
-        await ServiceWorkerCleanUp.removeAll();
+      clear: function() {
+        return new Promise(function(resolve, reject) {
+          var appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
+          try {
+            appCacheStorage.asyncEvictStorage(null);
+          } catch (er) {}
 
-        // QuotaManager
-        let promises = [];
-        await new Promise(resolve => {
-          quotaManagerService.getUsage(request => {
-            if (request.resultCode != Cr.NS_OK) {
-              // We are probably shutting down. We don't want to propagate the
-              // error, rejecting the promise.
-              resolve();
-              return;
-            }
-
-            for (let item of request.result) {
-              let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(item.origin);
-              let uri = principal.URI;
-              if (uri.scheme == "http" || uri.scheme == "https" || uri.scheme == "file") {
-                promises.push(new Promise(r => {
-                  let req = quotaManagerService.clearStoragesForPrincipal(principal, null, false);
-                  req.callback = () => { r(); };
-                }));
-              }
-            }
-            resolve();
-          });
+          resolve();
         });
-
-        return Promise.all(promises);
       },
 
       get canClear() {
           return true;
       }
     },
 
-    // History on Android is implemented by the Java frontend and requires
-    // different handling. Everything else is the same as for desktop Firefox.
     history: {
       clear: function() {
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_HISTORY", refObj);
 
         return EventDispatcher.instance.sendRequestForResult({ type: "Sanitize:ClearHistory" })
           .catch(e => Cu.reportError("Java-side history clearing failed: " + e))
           .then(function() {
@@ -241,18 +183,16 @@ Sanitizer.prototype = {
 
       get canClear() {
         // bug 347231: Always allow clearing history due to dependencies on
         // the browser:purge-session-history notification. (like error console)
         return true;
       }
     },
 
-    // Equivalent to openWindows on desktop, but specific to Fennec's implementation
-    // of tabbed browsing and the session store.
     openTabs: {
       clear: function() {
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_OPENWINDOWS", refObj);
 
         return EventDispatcher.instance.sendRequestForResult({ type: "Sanitize:OpenTabs" })
           .catch(e => Cu.reportError("Java-side tab clearing failed: " + e))
           .then(function() {
@@ -264,30 +204,27 @@ Sanitizer.prototype = {
           });
       },
 
       get canClear() {
         return true;
       }
     },
 
-    // Specific to Fennec.
     searchHistory: {
       clear: function() {
         return EventDispatcher.instance.sendRequestForResult({ type: "Sanitize:ClearHistory", clearSearchHistory: true })
           .catch(e => Cu.reportError("Java-side search history clearing failed: " + e));
       },
 
       get canClear() {
         return true;
       }
     },
 
-    // Browser search is handled by searchHistory above and the find bar doesn't
-    // require extra handling. FormHistory itself is cleared like on desktop.
     formdata: {
       clear: function({ startTime = 0 } = {}) {
         return new Promise(function(resolve, reject) {
           let refObj = {};
           TelemetryStopwatch.start("FX_SANITIZE_FORMDATA", refObj);
 
           // Conver time to microseconds
           let time = startTime * 1000;
@@ -309,17 +246,16 @@ Sanitizer.prototype = {
           handleResult: function(aResult) { count = aResult; },
           handleError: function(aError) { Cu.reportError(aError); },
           handleCompletion: function(aReason) { aCallback(aReason == 0 && count > 0); }
         };
         FormHistory.count({}, countDone);
       }
     },
 
-    // Adapted from desktop, but heavily modified - see comments below.
     downloadFiles: {
       clear: Task.async(function* ({ startTime = 0, deleteFiles = true} = {}) {
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_DOWNLOADS", refObj);
 
         let list = yield Downloads.getList(Downloads.ALL);
         let downloads = yield list.getAll();
         var finalizePromises = [];
@@ -359,32 +295,30 @@ Sanitizer.prototype = {
         TelemetryStopwatch.finish("FX_SANITIZE_DOWNLOADS", refObj);
       }),
 
       get canClear() {
         return true;
       }
     },
 
-    // Specific to Fennec.
     passwords: {
       clear: function() {
         return new Promise(function(resolve, reject) {
           Services.logins.removeAllLogins();
           resolve();
         });
       },
 
       get canClear() {
         let count = Services.logins.countLogins("", "", ""); // count all logins
         return (count > 0);
       }
     },
 
-    // Same as desktop Firefox.
     sessions: {
       clear: function() {
         return new Promise(function(resolve, reject) {
           let refObj = {};
           TelemetryStopwatch.start("FX_SANITIZE_SESSIONS", refObj);
 
           // clear all auth tokens
           var sdr = Cc["@mozilla.org/security/sdr;1"].getService(Ci.nsISecretDecoderRing);
@@ -398,17 +332,16 @@ Sanitizer.prototype = {
         });
       },
 
       get canClear() {
         return true;
       }
     },
 
-    // Specific to Fennec.
     syncedTabs: {
       clear: function() {
         return EventDispatcher.instance.sendRequestForResult({ type: "Sanitize:ClearSyncedTabs" })
           .catch(e => Cu.reportError("Java-side synced tabs clearing failed: " + e));
       },
 
       canClear: function(aCallback) {
         Accounts.anySyncAccountsExist().then(aCallback)
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -101,19 +101,16 @@ with Files('NLP.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Find Toolbar')
 
 with Files('NewTabUtils.jsm'):
     BUG_COMPONENT = ('Firefox', 'Tabbed Browser')
 
 with Files('ObjectUtils.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Telemetry')
 
-with Files("offlineAppCache.jsm"):
-    BUG_COMPONENT = ("Toolkit", "Preferences")
-
 with Files('PageMenu.jsm'):
     BUG_COMPONENT = ('Firefox', 'Menus')
 
 with Files('PermissionsUtils.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Add-ons Manager')
 
 with Files('PopupNotifications.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Password Manager')
@@ -209,17 +206,16 @@ EXTRA_JS_MODULES += [
     'InlineSpellCheckerContent.jsm',
     'Integration.jsm',
     'JSONFile.jsm',
     'Log.jsm',
     'Memory.jsm',
     'NewTabUtils.jsm',
     'NLP.jsm',
     'ObjectUtils.jsm',
-    'offlineAppCache.jsm',
     'PageMenu.jsm',
     'PageMetadata.jsm',
     'PermissionsUtils.jsm',
     'PopupNotifications.jsm',
     'Preferences.jsm',
     'PrivateBrowsingUtils.jsm',
     'ProfileAge.jsm',
     'Promise-backend.js',