Skip to content

Commit

Permalink
Bug 1464542: Part 3b - Add existing Services.jsm registrations to the…
Browse files Browse the repository at this point in the history
… new services cache. r=mccr8,geckoview-reviewers,agi

Differential Revision: https://phabricator.services.mozilla.com/D81419
  • Loading branch information
kmaglione committed Jul 9, 2020
1 parent 47b1ac6 commit 9c460f2
Show file tree
Hide file tree
Showing 54 changed files with 187 additions and 49 deletions.
2 changes: 1 addition & 1 deletion browser/components/extensions/parent/ext-browsingData.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const clearLocalStorage = async function(options) {
Services.obs.notifyObservers(null, "extension:purge-localStorage");
}

if (Services.lsm.nextGenLocalStorageEnabled) {
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
// Ideally we could reuse the logic in Sanitizer.jsm or nsIClearDataService,
// but this API exposes an ability to wipe data at a much finger granularity
// than those APIs. So custom logic is used here to wipe only the QM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ add_task(async function testLocalStorage() {
await browser.tabs.sendMessage(tabs[0].id, "checkLocalStorageCleared");
await browser.tabs.sendMessage(tabs[1].id, "checkLocalStorageSet");

if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled === false) {
if (
SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled ===
false
) {
// This assertion fails when localStorage is using the legacy
// implementation (See Bug 1595431).
browser.test.log("Skipped assertion on nextGenLocalStorageEnabled=false");
Expand Down
2 changes: 2 additions & 0 deletions docshell/build/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ Classes = [
},
{
'name': 'URIFixup',
'js_name': 'uriFixup',
'cid': '{c6cf88b7-452e-47eb-bdc9-86e3561648ef}',
'contract_ids': ['@mozilla.org/docshell/uri-fixup;1'],
'interfaces': ['nsIURIFixup'],
'jsm': 'resource://gre/modules/URIFixup.jsm',
'constructor': 'URIFixup',
},
Expand Down
2 changes: 2 additions & 0 deletions dom/base/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

Classes = [
{
'js_name': 'droppedLinkHandler',
'cid': '{1f34bc80-1bc7-11d6-a384-d705dd0746fc}',
'contract_ids': ['@mozilla.org/content/dropped-link-handler;1'],
'interfaces': ['nsIDroppedLinkHandler'],
'jsm': 'resource://gre/modules/ContentAreaDropListener.jsm',
'constructor': 'ContentAreaDropListener',
},
Expand Down
2 changes: 1 addition & 1 deletion dom/bindings/test/TestInterfaceJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ TestInterfaceJS.prototype = {
testThrowNsresultFromNative(x) {
// We want to throw an exception that we generate from an nsresult thrown
// by a C++ component.
Services.netUtils.notImplemented();
Services.io.notImplemented();
},

testThrowCallbackError(callback) {
Expand Down
2 changes: 1 addition & 1 deletion dom/localstorage/test/unit/test_preloading.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function testSteps() {
];

async function isPreloaded(principal) {
return Services.lsm.isPreloaded(principal);
return Services.domStorageManager.isPreloaded(principal);
}

info("Setting prefs");
Expand Down
6 changes: 1 addition & 5 deletions dom/manifest/ImageObjectProcessor.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,7 @@ ImageObjectProcessor.prototype.process = function(
};
let value = extractor.extractValue(spec);
if (value) {
value = Services.netUtils.parseRequestContentType(
value,
charset,
hadCharset
);
value = Services.io.parseRequestContentType(value, charset, hadCharset);
}
return value || undefined;
}
Expand Down
10 changes: 5 additions & 5 deletions dom/tests/browser/browser_localStorage_e10s.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Services.scriptloader.loadSubScript(
/* import-globals-from helper_localStorage_e10s.js */

function waitForLocalStorageFlush() {
if (Services.lsm.nextGenLocalStorageEnabled) {
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
return new Promise(resolve => executeSoon(resolve));
}

Expand All @@ -45,7 +45,7 @@ function waitForLocalStorageFlush() {
* notifications, but correctness is guaranteed after the second notification.
*/
function triggerAndWaitForLocalStorageFlush() {
if (Services.lsm.nextGenLocalStorageEnabled) {
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
return new Promise(resolve => executeSoon(resolve));
}

Expand Down Expand Up @@ -76,7 +76,7 @@ function clearOriginStorageEnsuringNoPreload() {
HELPER_PAGE_ORIGIN
);

if (Services.lsm.nextGenLocalStorageEnabled) {
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
let request = Services.qms.clearStoragesForPrincipal(
principal,
"default",
Expand Down Expand Up @@ -114,8 +114,8 @@ async function verifyTabPreload(knownTab, expectStorageExists) {
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
origin
);
if (Services.lsm.nextGenLocalStorageEnabled) {
return Services.lsm.isPreloaded(principal);
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
return Services.domStorageManager.isPreloaded(principal);
}
return !!Services.domStorageManager.getStorage(
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ requestLongerTimeout(4);
* Verify snapshotting of our localStorage implementation in multi-e10s setup.
*/
add_task(async function() {
if (!Services.lsm.nextGenLocalStorageEnabled) {
if (!Services.domStorageManager.nextGenLocalStorageEnabled) {
ok(true, "Test ignored when the next gen local storage is not enabled.");
return;
}
Expand Down
10 changes: 5 additions & 5 deletions dom/tests/mochitest/localstorage/localStorageCommon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function localStorageFlush(cb) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(function() {
cb();
});
Expand All @@ -17,7 +17,7 @@ function localStorageFlush(cb) {
}

function localStorageReload(callback) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
localStorage.close();
let qms = SpecialPowers.Services.qms;
let principal = SpecialPowers.wrap(document).nodePrincipal;
Expand All @@ -36,7 +36,7 @@ function localStorageReload(callback) {
}

function localStorageFlushAndReload(callback) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
localStorage.close();
let qms = SpecialPowers.Services.qms;
let principal = SpecialPowers.wrap(document).nodePrincipal;
Expand All @@ -54,7 +54,7 @@ function localStorageFlushAndReload(callback) {
}

function localStorageClearAll(callback) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
let qms = SpecialPowers.Services.qms;
let ssm = SpecialPowers.Services.scriptSecurityManager;

Expand Down Expand Up @@ -92,7 +92,7 @@ function localStorageClearAll(callback) {
}

function localStorageClearDomain(domain, callback) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
let qms = SpecialPowers.Services.qms;
let principal = SpecialPowers.wrap(document).nodePrincipal;
let request = qms.clearStoragesForPrincipal(principal, "default", "ls");
Expand Down
2 changes: 1 addition & 1 deletion dom/tests/mochitest/localstorage/test_bug600307-DBOps.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
localStorageReload(function() {
is(localStorage.length, 0, "localStorage clean in case 4");

if (!SpecialPowers.Services.lsm.nextGenLocalStorageEnabled &&
if (!SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled &&
SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(
SpecialPowers.Ci.nsIXULRuntime).processType != SpecialPowers.Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
// Following tests cannot be run in a child/plugin process type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

function startTest()
{
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
ok(true, "Test ignored when the next gen local storage is enabled.");
SimpleTest.finish();
return;
Expand Down
10 changes: 5 additions & 5 deletions dom/tests/mochitest/localstorage/test_localStorageQuota.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
switch (currentTest)
{
case 1:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "http://example.com";
Expand Down Expand Up @@ -50,7 +50,7 @@
// Try to set a new 500 bytes key and check we fail because we are over the
// quota.
case 5:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -67,7 +67,7 @@

// Now try again to set 500 bytes key, it must succeed.
case 7:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -76,7 +76,7 @@
break;

case 8:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(doNextTest);
} else {
// Do a clean up...
Expand All @@ -92,7 +92,7 @@
break;

case 10:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(doNextTest);
} else {
// Do a clean up...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
// Initialy setup the quota to testing value of 1024B and
// set a 500 bytes key with name length 1 (allocate 501 bytes)
case 1:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "http://example.com";
Expand Down Expand Up @@ -74,7 +74,7 @@
// Try to set a new 500 bytes key and check we fail because we are over the
// quota.
case 5:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -91,7 +91,7 @@

// Now try again to set 500 bytes key, it must succeed.
case 7:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -100,7 +100,7 @@
break;

case 8:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(() => doNextTest(aWindow));
} else {
// Do a clean up...
Expand All @@ -116,7 +116,7 @@
break;

case 10:
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(() => doNextTest(aWindow));
} else {
// Do a clean up...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
SimpleTest.waitForExplicitFinish();

function startTest() {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
ok(true, "Test ignored when the next gen local storage is enabled.");
SimpleTest.finish();
return;
Expand Down
2 changes: 2 additions & 0 deletions extensions/permissions/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

Classes = [
{
'js_name': 'perms',
'cid': '{4f6b5e00-0c36-11d5-a535-0010a401eb10}',
'contract_ids': ['@mozilla.org/permissionmanager;1'],
'interfaces': ['nsIPermissionManager'],
'singleton': True,
'type': 'nsIPermissionManager',
'constructor': 'mozilla::PermissionManager::GetXPCOMSingleton',
Expand Down
2 changes: 2 additions & 0 deletions intl/build/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

Classes = [
{
'js_name': 'strings',
'cid': '{d85a17c1-aa7c-11d2-9b8c-00805f8a16d9}',
'contract_ids': ['@mozilla.org/intl/stringbundle;1'],
'interfaces': ['nsIStringBundleService'],
'type': 'nsStringBundleService',
'headers': ['/intl/strres/nsStringBundleService.h'],
'init_method': 'Init',
Expand Down
2 changes: 2 additions & 0 deletions intl/locale/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

Classes = [
{
'js_name': 'locale',
'cid': '{92735ff4-6384-4ad6-8508-757010e149ee}',
'contract_ids': ['@mozilla.org/intl/localeservice;1'],
'interfaces': ['mozILocaleService'],
'singleton': True,
'type': 'mozilla::intl::LocaleService',
'headers': ['mozilla/intl/LocaleService.h'],
Expand Down
2 changes: 2 additions & 0 deletions intl/uconv/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Classes = [
'headers': ['/intl/uconv/nsScriptableUConv.h'],
},
{
'js_name': 'textToSubURI',
'cid': '{8b042e22-6f87-11d3-b3c8-00805f8a6670}',
'contract_ids': ['@mozilla.org/intl/texttosuburi;1'],
'interfaces': ['nsITextToSubURI'],
'type': 'nsTextToSubURI',
'headers': ['/intl/uconv/nsTextToSubURI.h'],
},
Expand Down
2 changes: 2 additions & 0 deletions js/xpconnect/src/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

Classes = [
{
'js_name': 'scriptloader',
'cid': '{929814d6-1dd2-11b2-8e08-82fa0a339b00}',
'contract_ids': ['@mozilla.org/moz/jssubscript-loader;1'],
'interfaces': ['mozIJSSubScriptLoader'],
'type': 'mozJSSubScriptLoader',
'headers': ['/js/xpconnect/loader/mozJSSubScriptLoader.h'],
},
Expand Down
Loading

0 comments on commit 9c460f2

Please sign in to comment.