mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
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) --HG-- rename : toolkit/modules/offlineAppCache.jsm => browser/modules/offlineAppCache.jsm
This commit is contained in:
parent
38773abdb6
commit
6b88e0ee99
@ -15,7 +15,7 @@ registerCleanupFunction(function() {
|
||||
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();
|
||||
});
|
||||
|
||||
|
@ -15,7 +15,7 @@ const REMOVE_DIALOG_URL = "chrome://browser/content/preferences/siteDataRemoveSe
|
||||
|
||||
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");
|
||||
|
@ -17,7 +17,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
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",
|
||||
@ -275,10 +275,6 @@ var Sanitizer = {
|
||||
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) {
|
||||
|
@ -106,6 +106,9 @@ with Files("WindowsJumpLists.jsm"):
|
||||
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")
|
||||
|
||||
@ -143,6 +146,7 @@ EXTRA_JS_MODULES += [
|
||||
'FormSubmitObserver.jsm',
|
||||
'FormValidationHandler.jsm',
|
||||
'LaterRun.jsm',
|
||||
'offlineAppCache.jsm',
|
||||
'OpenInTabsUtils.jsm',
|
||||
'PageActions.jsm',
|
||||
'PermissionUI.jsm',
|
||||
|
@ -13,18 +13,11 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
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() {}
|
||||
@ -67,16 +60,7 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// 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) {
|
||||
@ -103,8 +87,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// 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) {
|
||||
@ -114,14 +96,6 @@ Sanitizer.prototype = {
|
||||
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();
|
||||
});
|
||||
},
|
||||
@ -131,7 +105,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Same as desktop Firefox.
|
||||
siteSettings: {
|
||||
clear: Task.async(function* () {
|
||||
let refObj = {};
|
||||
@ -171,45 +144,16 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Same as desktop Firefox.
|
||||
offlineApps: {
|
||||
async clear() {
|
||||
// AppCache
|
||||
// This doesn't wait for the cleanup to be complete.
|
||||
OfflineAppCacheHelper.clear();
|
||||
clear: function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
|
||||
try {
|
||||
appCacheStorage.asyncEvictStorage(null);
|
||||
} catch (er) {}
|
||||
|
||||
// LocalStorage
|
||||
Services.obs.notifyObservers(null, "extension:purge-localStorage");
|
||||
|
||||
// ServiceWorkers
|
||||
await ServiceWorkerCleanUp.removeAll();
|
||||
|
||||
// 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() {
|
||||
@ -217,8 +161,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// 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 = {};
|
||||
@ -246,8 +188,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Equivalent to openWindows on desktop, but specific to Fennec's implementation
|
||||
// of tabbed browsing and the session store.
|
||||
openTabs: {
|
||||
clear: function() {
|
||||
let refObj = {};
|
||||
@ -269,7 +209,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Specific to Fennec.
|
||||
searchHistory: {
|
||||
clear: function() {
|
||||
return EventDispatcher.instance.sendRequestForResult({ type: "Sanitize:ClearHistory", clearSearchHistory: true })
|
||||
@ -281,8 +220,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// 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) {
|
||||
@ -314,7 +251,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Adapted from desktop, but heavily modified - see comments below.
|
||||
downloadFiles: {
|
||||
clear: Task.async(function* ({ startTime = 0, deleteFiles = true} = {}) {
|
||||
let refObj = {};
|
||||
@ -364,7 +300,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Specific to Fennec.
|
||||
passwords: {
|
||||
clear: function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
@ -379,7 +314,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Same as desktop Firefox.
|
||||
sessions: {
|
||||
clear: function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
@ -403,7 +337,6 @@ Sanitizer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
// Specific to Fennec.
|
||||
syncedTabs: {
|
||||
clear: function() {
|
||||
return EventDispatcher.instance.sendRequestForResult({ type: "Sanitize:ClearSyncedTabs" })
|
||||
|
@ -106,9 +106,6 @@ with Files('NewTabUtils.jsm'):
|
||||
with Files('ObjectUtils.jsm'):
|
||||
BUG_COMPONENT = ('Toolkit', 'Telemetry')
|
||||
|
||||
with Files("offlineAppCache.jsm"):
|
||||
BUG_COMPONENT = ("Toolkit", "Preferences")
|
||||
|
||||
with Files('PageMenu.jsm'):
|
||||
BUG_COMPONENT = ('Firefox', 'Menus')
|
||||
|
||||
@ -214,7 +211,6 @@ EXTRA_JS_MODULES += [
|
||||
'NewTabUtils.jsm',
|
||||
'NLP.jsm',
|
||||
'ObjectUtils.jsm',
|
||||
'offlineAppCache.jsm',
|
||||
'PageMenu.jsm',
|
||||
'PageMetadata.jsm',
|
||||
'PermissionsUtils.jsm',
|
||||
|
Loading…
Reference in New Issue
Block a user