Bug 1417937 - Remove unnecessary LoadContextInfo.jsm r?Standard8 draft
authorhemant <hemantsingh1612@gmail.com>
Wed, 31 Jan 2018 23:16:46 +0530
changeset 749557 37a863d7f1789dc61af226670e2c688c060e408a
parent 749389 7b46ef2ae1412b15ed45e7d2367ca491344729f7
push id97433
push userbmo:hemantsingh1612@gmail.com
push dateWed, 31 Jan 2018 17:49:08 +0000
reviewersStandard8
bugs1417937
milestone60.0a1
Bug 1417937 - Remove unnecessary LoadContextInfo.jsm r?Standard8 MozReview-Commit-ID: EnY0uKD4UD1
browser/base/content/pageinfo/pageInfo.js
browser/base/content/test/general/browser_sanitizeDialog.js
browser/base/content/test/general/browser_save_private_link_perwindowpb.js
browser/components/originattributes/test/browser/browser_cache.js
browser/components/originattributes/test/browser/browser_sanitize.js
browser/components/places/tests/unit/head_bookmarks.js
browser/components/places/tests/unit/test_clearHistory_shutdown.js
browser/components/preferences/in-content/main.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
browser/components/tests/unit/test_distribution.js
browser/modules/offlineAppCache.jsm
devtools/client/shared/AppCacheUtils.jsm
devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js
dom/html/test/browser_bug649778.js
mobile/android/modules/Sanitizer.jsm
netwerk/test/unit/head_cache.js
netwerk/test/unit/test_bug248970_cache.js
netwerk/test/unit/test_bug767025.js
netwerk/test/unit/test_cache2-06-pb-mode.js
netwerk/test/unit/test_cache2-21-anon-storage.js
netwerk/test/unit/test_cache2-22-anon-visit.js
netwerk/test/unit/test_cache2-23-read-over-chunk.js
netwerk/test/unit/test_cache2-24-exists.js
netwerk/test/unit/test_cache2-25-chunk-memory-limit.js
netwerk/test/unit/test_cache2-27-force-valid-for.js
netwerk/test/unit/test_cache2-30a-entry-pinning.js
netwerk/test/unit/test_cache2-30b-pinning-storage-clear.js
netwerk/test/unit/test_cache2-30c-pinning-deferred-doom.js
netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js
netwerk/test/unit/test_cache2-31-visit-all.js
netwerk/test/unit/test_doomentry.js
netwerk/test/unit/test_inhibit_caching.js
netwerk/test/unit/test_predictor.js
netwerk/test/unit/test_private_necko_channel.js
toolkit/modules/LoadContextInfo.jsm
toolkit/modules/moz.build
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -1,13 +1,12 @@
 /* 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/. */
 
-ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /* import-globals-from ../../../../toolkit/content/globalOverlay.js */
 /* import-globals-from ../../../../toolkit/content/contentAreaUtils.js */
 /* import-globals-from ../../../../toolkit/content/treeUtils.js */
 /* import-globals-from feeds.js */
 /* import-globals-from permissions.js */
 /* import-globals-from security.js */
@@ -233,17 +232,17 @@ const PERMISSION_CONTRACTID     = "@mozi
 const PREFERENCES_CONTRACTID    = "@mozilla.org/preferences-service;1";
 
 // a number of services I'll need later
 // the cache services
 const nsICacheStorageService = Components.interfaces.nsICacheStorageService;
 const nsICacheStorage = Components.interfaces.nsICacheStorage;
 const cacheService = Components.classes["@mozilla.org/netwerk/cache-storage-service;1"].getService(nsICacheStorageService);
 
-var loadContextInfo = LoadContextInfo.fromLoadContext(
+var loadContextInfo = Services.loadContextInfo.fromLoadContext(
   window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
         .getInterface(Components.interfaces.nsIWebNavigation)
         .QueryInterface(Components.interfaces.nsILoadContext), false);
 var diskStorage = cacheService.diskCacheStorage(loadContextInfo, false);
 
 const nsICookiePermission  = Components.interfaces.nsICookiePermission;
 const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
 
--- a/browser/base/content/test/general/browser_sanitizeDialog.js
+++ b/browser/base/content/test/general/browser_sanitizeDialog.js
@@ -13,18 +13,16 @@
  * test checks the UI of the dialog and makes sure it's correctly connected to
  * the sanitize timespan code.
  *
  * Some of this code, especially the history creation parts, was taken from
  * browser/base/content/test/general/browser_sanitize-timespans.js.
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-var {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", {});
-
 ChromeUtils.defineModuleGetter(this, "FormHistory",
                                "resource://gre/modules/FormHistory.jsm");
 ChromeUtils.defineModuleGetter(this, "Downloads",
                                "resource://gre/modules/Downloads.jsm");
 ChromeUtils.defineModuleGetter(this, "Timer",
                                "resource://gre/modules/Timer.jsm");
 ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
                                "resource://testing-common/PlacesTestUtils.jsm");
@@ -548,19 +546,19 @@ add_task(async function test_offline_cac
 
   // Give www.example.com privileges to store offline data
   Services.perms.addFromPrincipal(principal, "offline-app", Ci.nsIPermissionManager.ALLOW_ACTION);
   Services.perms.addFromPrincipal(principal, "offline-app", Ci.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
 
   // Store something to the offline cache
   var appcacheserv = Cc["@mozilla.org/network/application-cache-service;1"]
                      .getService(Ci.nsIApplicationCacheService);
-  var appcachegroupid = appcacheserv.buildGroupIDForInfo(makeURI(URL + "/manifest"), LoadContextInfo.default);
+  var appcachegroupid = appcacheserv.buildGroupIDForInfo(makeURI(URL + "/manifest"), Services.loadContextInfo.default);
   var appcache = appcacheserv.createApplicationCache(appcachegroupid);
-  var storage = Services.cache2.appCacheStorage(LoadContextInfo.default, appcache);
+  var storage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, appcache);
 
   // Open the dialog
   let wh = new WindowHelper();
   wh.onload = function() {
     this.selectDuration(Sanitizer.TIMESPAN_EVERYTHING);
     // Show details
     this.toggleDetails();
     // Clear only offlineApps
--- a/browser/base/content/test/general/browser_save_private_link_perwindowpb.js
+++ b/browser/base/content/test/general/browser_save_private_link_perwindowpb.js
@@ -22,18 +22,17 @@ function promiseNoCacheEntry(filename) {
         is(urispec.includes(filename), false, "web content present in disk cache");
       },
       onCacheEntryVisitCompleted() {
         resolve();
       }
     };
     function Visitor() {}
 
-    let {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", null);
-    let storage = Services.cache2.diskCacheStorage(LoadContextInfo.default, false);
+    let storage = Services.cache2.diskCacheStorage(Services.loadContextInfo.default, false);
     storage.asyncVisitStorage(new Visitor(), true /* Do walk entries */);
   });
 }
 
 function promiseImageDownloaded() {
   return new Promise((resolve, reject) => {
     let fileName;
     let MockFilePicker = SpecialPowers.MockFilePicker;
--- a/browser/components/originattributes/test/browser/browser_cache.js
+++ b/browser/components/originattributes/test/browser/browser_cache.js
@@ -5,17 +5,16 @@
  *   originAttributes. And then, it verifies the number of cache entries and
  *   the originAttributes of loading channels. If these two pages belong to
  *   the same originAttributes, the number of cache entries for a certain
  *   resource would be one. Otherwise, it would be two.
  */
 
 const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
 
-let {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", {});
 let protocolProxyService = Cc["@mozilla.org/network/protocol-proxy-service;1"]
                              .getService(Ci.nsIProtocolProxyService);
 
 const TEST_DOMAIN = "http://example.net";
 const TEST_PATH = "/browser/browser/components/originattributes/test/browser/";
 const TEST_PAGE = TEST_DOMAIN + TEST_PATH + "file_cache.html";
 
 let suffixes = ["iframe.html", "link.css", "script.js", "img.png", "object.png",
@@ -222,27 +221,27 @@ async function doTest(aBrowser) {
 
   return 0;
 }
 
 // The check function, which checks the number of cache entries.
 async function doCheck(aShouldIsolate, aInputA, aInputB) {
   let expectedEntryCount = 1;
   let data = [];
-  data = data.concat(await cacheDataForContext(LoadContextInfo.default));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.private));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(true, {})));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(false, { userContextId: 1 })));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(true, { userContextId: 1 })));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(false, { userContextId: 2 })));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(true, { userContextId: 2 })));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(false, { firstPartyDomain: "example.com" })));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(true, { firstPartyDomain: "example.com" })));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(false, { firstPartyDomain: "example.org" })));
-  data = data.concat(await cacheDataForContext(LoadContextInfo.custom(true, { firstPartyDomain: "example.org" })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.default));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.private));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(true, {})));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(false, { userContextId: 1 })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(true, { userContextId: 1 })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(false, { userContextId: 2 })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(true, { userContextId: 2 })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(false, { firstPartyDomain: "example.com" })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(true, { firstPartyDomain: "example.com" })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(false, { firstPartyDomain: "example.org" })));
+  data = data.concat(await cacheDataForContext(Services.loadContextInfo.custom(true, { firstPartyDomain: "example.org" })));
 
   if (aShouldIsolate) {
     expectedEntryCount = 2;
   }
 
   for (let suffix of suffixes) {
     let foundEntryCount = countMatchingCacheEntries(data, "example.net", suffix);
     let result = (expectedEntryCount === foundEntryCount);
--- a/browser/components/originattributes/test/browser/browser_sanitize.js
+++ b/browser/components/originattributes/test/browser/browser_sanitize.js
@@ -1,16 +1,14 @@
 /**
  * Bug 1270338 - Add a mochitest to ensure Sanitizer clears data for all containers
  */
 
 const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
 
-let {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", {});
-
 const TEST_DOMAIN = "http://example.net/";
 
 let tempScope = {};
 Services.scriptloader.loadSubScript("chrome://browser/content/sanitize.js",
                                     tempScope);
 let Sanitizer = tempScope.Sanitizer;
 
 function setCookies(aBrowser) {
@@ -49,21 +47,21 @@ function checkCookiesSanitized(aBrowser)
     is(content.document.cookie, "",
        "Cookies of all origin attributes should be cleared.");
   });
 }
 
 function checkCacheExists(aShouldExist) {
   return async function() {
     let loadContextInfos = [
-      LoadContextInfo.default,
-      LoadContextInfo.custom(false, { userContextId: 1 }),
-      LoadContextInfo.custom(false, { userContextId: 2 }),
-      LoadContextInfo.custom(false, { firstPartyDomain: "example.com" }),
-      LoadContextInfo.custom(false, { firstPartyDomain: "example.org" }),
+      Services.loadContextInfo.default,
+      Services.loadContextInfo.custom(false, { userContextId: 1 }),
+      Services.loadContextInfo.custom(false, { userContextId: 2 }),
+      Services.loadContextInfo.custom(false, { firstPartyDomain: "example.com" }),
+      Services.loadContextInfo.custom(false, { firstPartyDomain: "example.org" }),
     ];
     let i = 0;
     for (let loadContextInfo of loadContextInfos) {
       let cacheURIs = await cacheDataForContext(loadContextInfo);
       is(cacheURIs.includes(TEST_DOMAIN), aShouldExist, TEST_DOMAIN + " should "
         + (aShouldExist ? "not " : "") + "be cached for all origin attributes." + i++);
     }
   };
--- a/browser/components/places/tests/unit/head_bookmarks.js
+++ b/browser/components/places/tests/unit/head_bookmarks.js
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 var Cc = Components.classes;
 var Cr = Components.results;
 var Cu = Components.utils;
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm");
 
 // Import common head.
 /* import-globals-from ../../../../../toolkit/components/places/tests/head_common.js */
 var commonFile = do_get_file("../../../../../toolkit/components/places/tests/head_common.js", false);
 if (commonFile) {
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
--- a/browser/components/places/tests/unit/test_clearHistory_shutdown.js
+++ b/browser/components/places/tests/unit/test_clearHistory_shutdown.js
@@ -119,17 +119,17 @@ function getFormHistoryCount() {
                       { handleResult(result) { count = result; },
                         handleCompletion(reason) { resolve(count); }
                       });
   });
 }
 
 function storeCache(aURL, aContent) {
   let cache = Services.cache2;
-  let storage = cache.diskCacheStorage(LoadContextInfo.default, false);
+  let storage = cache.diskCacheStorage(Services.loadContextInfo.default, false);
 
   return new Promise(resolve => {
     let storeCacheListener = {
       onCacheEntryCheck(entry, appcache) {
         return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED;
       },
 
       onCacheEntryAvailable(entry, isnew, appcache, status) {
@@ -154,17 +154,17 @@ function storeCache(aURL, aContent) {
                          Ci.nsICacheStorage.OPEN_NORMALLY,
                          storeCacheListener);
   });
 }
 
 
 function checkCache(aURL) {
   let cache = Services.cache2;
-  let storage = cache.diskCacheStorage(LoadContextInfo.default, false);
+  let storage = cache.diskCacheStorage(Services.loadContextInfo.default, false);
 
   return new Promise(resolve => {
     let checkCacheListener = {
       onCacheEntryAvailable(entry, isnew, appcache, status) {
         Assert.equal(status, Cr.NS_ERROR_CACHE_KEY_NOT_FOUND);
         resolve();
       }
     };
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -8,17 +8,16 @@
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/Downloads.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource:///modules/ShellService.jsm");
 ChromeUtils.import("resource:///modules/TransientPrefs.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
-ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm");
 ChromeUtils.defineModuleGetter(this, "CloudStorage",
   "resource://gre/modules/CloudStorage.jsm");
 
 // Constants & Enumeration Values
 const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
 const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed";
 const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed";
 const TYPE_PDF = "application/pdf";
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
@@ -1,18 +1,16 @@
 /* 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/. */
 
 // Check about:cache after private browsing
 // This test covers MozTrap test 6047
 // bug 880621
 
-var {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", null);
-
 var tmp = {};
 
 Services.scriptloader.loadSubScript("chrome://browser/content/sanitize.js", tmp);
 
 var Sanitizer = tmp.Sanitizer;
 
 function test() {
 
@@ -60,20 +58,20 @@ function sanitizeCache() {
 
   s.sanitize();
 }
 
 function getStorageEntryCount(device, goon) {
   var storage;
   switch (device) {
   case "private":
-    storage = Services.cache2.diskCacheStorage(LoadContextInfo.private, false);
+    storage = Services.cache2.diskCacheStorage(Services.loadContextInfo.private, false);
     break;
   case "regular":
-    storage = Services.cache2.diskCacheStorage(LoadContextInfo.default, false);
+    storage = Services.cache2.diskCacheStorage(Services.loadContextInfo.default, false);
     break;
   default:
     throw "Unknown device " + device + " at getStorageEntryCount";
   }
 
   var visitor = {
     entryCount: 0,
     onCacheStorageInfo(aEntryCount, aConsumption) {
--- a/browser/components/tests/unit/test_distribution.js
+++ b/browser/components/tests/unit/test_distribution.js
@@ -1,17 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that preferences are properly set by distribution.ini
  */
 
-ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm");
-
 // Import common head.
 var commonFile = do_get_file("../../../../toolkit/components/places/tests/head_common.js", false);
 /* import-globals-from ../../../../toolkit/components/places/tests/head_common.js */
 if (commonFile) {
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
--- a/browser/modules/offlineAppCache.jsm
+++ b/browser/modules/offlineAppCache.jsm
@@ -1,20 +1,20 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["OfflineAppCacheHelper"];
 
-ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm");
+ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 this.OfflineAppCacheHelper = {
   clear() {
     var cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
-    var appCacheStorage = cacheService.appCacheStorage(LoadContextInfo.default, null);
+    var appCacheStorage = cacheService.appCacheStorage(Services.loadContextInfo.default, null);
     try {
       appCacheStorage.asyncEvictStorage(null);
     } catch (er) {}
   }
 };
--- a/devtools/client/shared/AppCacheUtils.jsm
+++ b/devtools/client/shared/AppCacheUtils.jsm
@@ -24,17 +24,16 @@
  */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 var { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 var { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
-var { LoadContextInfo } = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
 var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 
 var { gDevTools } = require("devtools/client/framework/devtools");
 var Services = require("Services");
 var promise = require("promise");
 
 this.EXPORTED_SYMBOLS = ["AppCacheUtils"];
 
@@ -249,17 +248,17 @@ AppCacheUtils.prototype = {
 
   listEntries: function ACU_show(searchTerm) {
     if (!Services.prefs.getBoolPref("browser.cache.disk.enable")) {
       throw new Error(l10n.GetStringFromName("cacheDisabled"));
     }
 
     let entries = [];
 
-    let appCacheStorage = Services.cache2.appCacheStorage(LoadContextInfo.default, null);
+    let appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
     appCacheStorage.asyncVisitStorage({
       onCacheStorageInfo: function () {},
 
       onCacheEntryInfo: function (aURI, aIdEnhance, aDataSize, aFetchCount, aLastModifiedTime, aExpirationTime) {
         let lowerKey = aURI.asciiSpec.toLowerCase();
 
         if (searchTerm && lowerKey.indexOf(searchTerm.toLowerCase()) == -1) {
           return;
@@ -298,17 +297,17 @@ AppCacheUtils.prototype = {
     win.openUILinkIn(url, "tab");
   },
 
   clearAll: function ACU_clearAll() {
     if (!Services.prefs.getBoolPref("browser.cache.disk.enable")) {
       throw new Error(l10n.GetStringFromName("cacheDisabled"));
     }
 
-    let appCacheStorage = Services.cache2.appCacheStorage(LoadContextInfo.default, null);
+    let appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
     appCacheStorage.asyncEvictStorage({
       onCacheEntryDoomed: function (result) {}
     });
   },
 
   _getManifestURI: function ACU__getManifestURI() {
     return new Promise((resolve, reject) => {
       let getURI = () => {
--- a/devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_private_perwindowpb.js
@@ -4,18 +4,16 @@
 
 "use strict";
 
 // This test makes sure that the style editor does not store any
 // content CSS files in the permanent cache when opened from PB mode.
 
 const TEST_URL = "http://" + TEST_HOST + "/browser/devtools/client/" +
   "styleeditor/test/test_private.html";
-const {LoadContextInfo} =
-  Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
 const cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
   .getService(Ci.nsICacheStorageService);
 
 add_task(function* () {
   info("Opening a new private window");
   let win = OpenBrowserWindow({private: true});
   yield waitForDelayedStartupFinished(win);
 
@@ -59,17 +57,17 @@ function checkDiskCacheFor(host) {
       },
       onCacheEntryVisitCompleted: function () {
         is(foundPrivateData, false, "web content present in disk cache");
         resolve();
       }
     };
     function Visitor() {}
 
-    let storage = cache.diskCacheStorage(LoadContextInfo.default, false);
+    let storage = cache.diskCacheStorage(Services.loadContextInfo.default, false);
     storage.asyncVisitStorage(new Visitor(),
       /* Do walk entries */
       true);
   });
 }
 
 function waitForDelayedStartupFinished(win) {
   return new Promise(resolve => {
--- a/dom/html/test/browser_bug649778.js
+++ b/dom/html/test/browser_bug649778.js
@@ -1,21 +1,20 @@
 // Test for bug 649778 - document.write may cause a document to be written to disk cache even when the page has Cache-Control: no-store
 
 // Globals
 var testPath = "http://mochi.test:8888/browser/dom/html/test/";
 var popup;
 
-var {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", null);
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm", null);
 
 function checkCache(url, inMemory, shouldExist, cb)
 {
   var cache = Services.cache2;
-  var storage = cache.diskCacheStorage(LoadContextInfo.default, false);
+  var storage = cache.diskCacheStorage(Services.loadContextInfo.default, false);
 
   function CheckCacheListener(inMemory, shouldExist)
   {
     this.inMemory = inMemory;
     this.shouldExist = shouldExist;
     this.onCacheEntryCheck = function() {
       return Components.interfaces.nsICacheEntryOpenCallback.ENTRY_WANTED;
     };
--- a/mobile/android/modules/Sanitizer.jsm
+++ b/mobile/android/modules/Sanitizer.jsm
@@ -1,9 +1,8 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 4 -*-
 /* 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/. */
 
 /* globals LoadContextInfo, FormHistory, Accounts */
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
@@ -13,17 +12,16 @@ 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",
-  LoadContextInfo: "resource://gre/modules/LoadContextInfo.jsm",
   OS: "resource://gre/modules/osfile.jsm",
   Task: "resource://gre/modules/Task.jsm",
   TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
 });
 
 function dump(a) {
   Services.console.logStringMessage(a);
 }
@@ -154,17 +152,17 @@ Sanitizer.prototype = {
         return true;
       }
     },
 
     offlineApps: {
       clear: function() {
         return new Promise(function(resolve, reject) {
           var cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
-          var appCacheStorage = cacheService.appCacheStorage(LoadContextInfo.default, null);
+          var appCacheStorage = cacheService.appCacheStorage(Services.loadContextInfo.default, null);
           try {
             appCacheStorage.asyncEvictStorage(null);
           } catch (er) {}
 
           resolve();
         });
       },
 
--- a/netwerk/test/unit/head_cache.js
+++ b/netwerk/test/unit/head_cache.js
@@ -1,10 +1,10 @@
 ChromeUtils.import('resource://gre/modules/XPCOMUtils.jsm');
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
+ChromeUtils.import('resource://gre/modules/Services.jsm');
 
 var _CSvc;
 function get_cache_service() {
   if (_CSvc)
     return _CSvc;
 
   return _CSvc = Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
                            .getService(Components.interfaces.nsICacheStorageService);
@@ -15,41 +15,41 @@ function evict_cache_entries(where)
   var clearDisk = (!where || where == "disk" || where == "all");
   var clearMem = (!where || where == "memory" || where == "all");
   var clearAppCache = (where == "appcache");
 
   var svc = get_cache_service();
   var storage;
 
   if (clearMem) {
-    storage = svc.memoryCacheStorage(LoadContextInfo.default);
+    storage = svc.memoryCacheStorage(Services.loadContextInfo.default);
     storage.asyncEvictStorage(null);
   }
 
   if (clearDisk) {
-    storage = svc.diskCacheStorage(LoadContextInfo.default, false);
+    storage = svc.diskCacheStorage(Services.loadContextInfo.default, false);
     storage.asyncEvictStorage(null);
   }
 
   if (clearAppCache) {
-    storage = svc.appCacheStorage(LoadContextInfo.default, null);
+    storage = svc.appCacheStorage(Services.loadContextInfo.default, null);
     storage.asyncEvictStorage(null);
   }
 }
 
 function createURI(urispec)
 {
   var ioServ = Components.classes["@mozilla.org/network/io-service;1"]
                          .getService(Components.interfaces.nsIIOService);
   return ioServ.newURI(urispec);
 }
 
 function getCacheStorage(where, lci, appcache)
 {
-  if (!lci) lci = LoadContextInfo.default;
+  if (!lci) lci = Services.loadContextInfo.default;
   var svc = get_cache_service();
   switch (where) {
     case "disk": return svc.diskCacheStorage(lci, false);
     case "memory": return svc.memoryCacheStorage(lci);
     case "appcache": return svc.appCacheStorage(lci, appcache);
     case "pin": return svc.pinningCacheStorage(lci);
   }
   return null;
--- a/netwerk/test/unit/test_bug248970_cache.js
+++ b/netwerk/test/unit/test_bug248970_cache.js
@@ -42,17 +42,17 @@ function store_entries(cb)
   if (store_idx == entries.length) {
     executeSoon(store_cb);
     return;
   }
 
   asyncOpenCacheEntry(entries[store_idx][0],
                       entries[store_idx][2],
                       Ci.nsICacheStorage.OPEN_TRUNCATE,
-                      LoadContextInfo.custom(false,
+                      Services.loadContextInfo.custom(false,
                         {privateBrowsingId : entries[store_idx][3] ? 0 : 1}),
                       store_data,
                       appCache);
 }
 
 var store_data = function(status, entry) {
   Assert.equal(status, Cr.NS_OK);
   var os = entry.openOutputStream(0);
@@ -83,17 +83,17 @@ function check_entries(cb, pbExited)
   if (check_idx == entries.length) {
     executeSoon(check_cb);
     return;
   }
 
   asyncOpenCacheEntry(entries[check_idx][0],
                       entries[check_idx][2],
                       Ci.nsICacheStorage.OPEN_READONLY,
-                      LoadContextInfo.custom(false,
+                      Services.loadContextInfo.custom(false,
                         {privateBrowsingId : entries[check_idx][3] ? 0 : 1}),
                       check_data,
                       appCache);
 }
 
 var check_data = function (status, entry) {
   var cont = function() {
     check_idx++;
--- a/netwerk/test/unit/test_bug767025.js
+++ b/netwerk/test/unit/test_bug767025.js
@@ -82,17 +82,17 @@ function init_http_server() {
     httpServer.registerPathHandler("/pages/foo" + i, datafile_handler);
   }
   httpServer.start(4444);
 }
 
 function clean_app_cache() {
   let cache_service = Cc[kNS_CACHESTORAGESERVICE_CONTRACTID].
     getService(Ci.nsICacheStorageService);
-  let storage = cache_service.appCacheStorage(LoadContextInfo.default, null);
+  let storage = cache_service.appCacheStorage(Services.loadContextInfo.default, null);
   storage.asyncEvictStorage(null);
 }
 
 function do_app_cache(manifestURL, pageURL) {
   let update_service = Cc[kNS_OFFLINECACHEUPDATESERVICE_CONTRACTID].
     getService(Ci.nsIOfflineCacheUpdateService);
 
   Services.perms.add(manifestURL,
@@ -164,17 +164,17 @@ function start_cache_nonpinned_app() {
 var hold_entry_foo1 = null;
 
 function check_bug() {
   // activate foo1
   asyncOpenCacheEntry(
     kHttpLocation + "pages/foo1",
     "appcache", Ci.nsICacheStorage.OPEN_READONLY, null,
     function(status, entry, appcache) {
-      let storage = get_cache_service().appCacheStorage(LoadContextInfo.default, appcache);
+      let storage = get_cache_service().appCacheStorage(Services.loadContextInfo.default, appcache);
 
       // Doom foo1 & foo2
       storage.asyncDoomURI(createURI(kHttpLocation + "pages/foo1"), "", { onCacheEntryDoomed: function() {
         storage.asyncDoomURI(createURI(kHttpLocation + "pages/foo2"), "", { onCacheEntryDoomed: function() {
           check_evict_cache(appcache);
         }});
       }});
 
@@ -201,17 +201,17 @@ function check_evict_cache(appcache) {
   // activate foo3
   asyncOpenCacheEntry(
     kHttpLocation + "pages/foo3",
     "appcache", Ci.nsICacheStorage.OPEN_READONLY, null,
     function(status, entry, appcache) {
       var hold_entry_foo3 = entry;
 
       // evict all documents.
-      let storage = get_cache_service().appCacheStorage(LoadContextInfo.default, appcache);
+      let storage = get_cache_service().appCacheStorage(Services.loadContextInfo.default, appcache);
       storage.asyncEvictStorage(null);
 
       // All documents are removed except foo1 & foo3.
       syncWithCacheIOThread(function () {
         // foo1
         let file = do_get_profile().clone();
         file.append("OfflineCache");
         file.append("5");
--- a/netwerk/test/unit/test_cache2-06-pb-mode.js
+++ b/netwerk/test/unit/test_cache2-06-pb-mode.js
@@ -5,23 +5,23 @@ function exitPB()
   obsvc.notifyObservers(null, "last-pb-context-exited");
 }
 
 function run_test()
 {
   do_get_profile();
 
   // Store PB entry
-  asyncOpenCacheEntry("http://p1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.private,
+  asyncOpenCacheEntry("http://p1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.private,
     new OpenCallback(NEW, "p1m", "p1d", function(entry) {
-      asyncOpenCacheEntry("http://p1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.private,
+      asyncOpenCacheEntry("http://p1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.private,
         new OpenCallback(NORMAL, "p1m", "p1d", function(entry) {
           // Check it's there
           syncWithCacheIOThread(function() {
-            var storage = getCacheStorage("disk", LoadContextInfo.private);
+            var storage = getCacheStorage("disk", Services.loadContextInfo.private);
             storage.asyncVisitStorage(
               new VisitCallback(1, 12, ["http://p1/"], function() {
                 // Simulate PB exit
                 exitPB();
                 // Check the entry is gone
                 storage.asyncVisitStorage(
                   new VisitCallback(0, 0, [], function() {
                     finish_cache2_test();
--- a/netwerk/test/unit/test_cache2-21-anon-storage.js
+++ b/netwerk/test/unit/test_cache2-21-anon-storage.js
@@ -1,26 +1,24 @@
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
-
 function run_test()
 {
   do_get_profile();
 
   // Create and check an entry anon disk storage
-  asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
+  asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.anonymous,
     new OpenCallback(NEW, "an1", "an1", function(entry) {
-      asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
+      asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.anonymous,
         new OpenCallback(NORMAL, "an1", "an1", function(entry) {
           // Create and check an entry non-anon disk storage
-          asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+          asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
             new OpenCallback(NEW, "na1", "na1", function(entry) {
-              asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+              asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
                 new OpenCallback(NORMAL, "na1", "na1", function(entry) {
                   // check the anon entry is still there and intact
-                  asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
+                  asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.anonymous,
                     new OpenCallback(NORMAL, "an1", "an1", function(entry) {
                       finish_cache2_test();
                     })
                   );
                 })
               );
             })
           );
--- a/netwerk/test/unit/test_cache2-22-anon-visit.js
+++ b/netwerk/test/unit/test_cache2-22-anon-visit.js
@@ -1,37 +1,35 @@
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
-
 function run_test()
 {
   do_get_profile();
 
   var mc = new MultipleCallbacks(2, function() {
-    var storage = getCacheStorage("disk", LoadContextInfo.default);
+    var storage = getCacheStorage("disk", Services.loadContextInfo.default);
     storage.asyncVisitStorage(
       new VisitCallback(1, 1024, ["http://an2/"], function() {
-        storage = getCacheStorage("disk", LoadContextInfo.anonymous);
+        storage = getCacheStorage("disk", Services.loadContextInfo.anonymous);
         storage.asyncVisitStorage(
           new VisitCallback(1, 1024, ["http://an2/"], function() {
             finish_cache2_test();
           }),
           true
         );
       }),
       true
     );
   });
 
 
-  asyncOpenCacheEntry("http://an2/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+  asyncOpenCacheEntry("http://an2/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
     new OpenCallback(NEW|WAITFORWRITE, "an2", "an2", function(entry) {
       mc.fired();
     })
   );
 
-  asyncOpenCacheEntry("http://an2/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
+  asyncOpenCacheEntry("http://an2/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.anonymous,
     new OpenCallback(NEW|WAITFORWRITE, "an2", "an2", function(entry) {
       mc.fired();
     })
   );
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_cache2-23-read-over-chunk.js
+++ b/netwerk/test/unit/test_cache2-23-read-over-chunk.js
@@ -1,25 +1,23 @@
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
-
 function run_test()
 {
   do_get_profile();
 
   const kChunkSize = (256 * 1024);
 
   var payload = "";
   for (var i = 0; i < (kChunkSize + 10); ++i) {
     if (i < (kChunkSize - 5))
       payload += "0";
     else
       payload += String.fromCharCode(i + 65);
   }
 
-  asyncOpenCacheEntry("http://read/", "disk", Ci.nsICacheStorage.OPEN_TRUNCATE, LoadContextInfo.default,
+  asyncOpenCacheEntry("http://read/", "disk", Ci.nsICacheStorage.OPEN_TRUNCATE, Services.loadContextInfo.default,
     new OpenCallback(NEW|WAITFORWRITE, "", payload, function(entry) {
       var is = entry.openInputStream(0);
       pumpReadStream(is, function(read) {
         Assert.equal(read.length, kChunkSize + 10);
         is.close();
         Assert.ok(read == payload); // not using do_check_eq since logger will fail for the 1/4MB string
         finish_cache2_test();
       });
--- a/netwerk/test/unit/test_cache2-24-exists.js
+++ b/netwerk/test/unit/test_cache2-24-exists.js
@@ -1,10 +1,8 @@
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
-
 function run_test()
 {
   do_get_profile();
 
   var mc = new MultipleCallbacks(2, function() {
     var mem = getCacheStorage("memory");
     var disk = getCacheStorage("disk");
 
@@ -12,22 +10,22 @@ function run_test()
     Assert.ok(mem.exists(createURI("http://m1/"), ""));
     Assert.ok(!mem.exists(createURI("http://m2/"), ""));
     Assert.ok(disk.exists(createURI("http://d1/"), ""));
     do_check_throws_nsIException(() => disk.exists(createURI("http://d2/"), ""), 'NS_ERROR_NOT_AVAILABLE');
 
     finish_cache2_test();
   });
 
-  asyncOpenCacheEntry("http://d1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+  asyncOpenCacheEntry("http://d1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
     new OpenCallback(NEW | WAITFORWRITE, "meta", "data", function(entry) {
       mc.fired();
     })
   );
 
-  asyncOpenCacheEntry("http://m1/", "memory", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+  asyncOpenCacheEntry("http://m1/", "memory", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
     new OpenCallback(NEW | WAITFORWRITE, "meta", "data", function(entry) {
       mc.fired();
     })
   );
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_cache2-25-chunk-memory-limit.js
+++ b/netwerk/test/unit/test_cache2-25-chunk-memory-limit.js
@@ -1,10 +1,8 @@
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
-
 function gen_200k()
 {
   var i;
   var data="0123456789ABCDEFGHIJLKMNO";
   for (i=0; i<13; i++)
     data+=data;
   return data;
 }
--- a/netwerk/test/unit/test_cache2-27-force-valid-for.js
+++ b/netwerk/test/unit/test_cache2-27-force-valid-for.js
@@ -1,19 +1,17 @@
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
-
 function run_test()
 {
   do_get_profile();
 
   var mc = new MultipleCallbacks(2, function() {
     finish_cache2_test();
   });
 
-  asyncOpenCacheEntry("http://m1/", "memory", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+  asyncOpenCacheEntry("http://m1/", "memory", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
     new OpenCallback(NEW, "meta", "data", function(entry) {
       // Check the default
       equal(entry.isForcedValid, false);
 
       // Forced valid and confirm
       entry.forceValidFor(2);
       do_timeout(1000, function() {
         equal(entry.isForcedValid, true);
--- a/netwerk/test/unit/test_cache2-30a-entry-pinning.js
+++ b/netwerk/test/unit/test_cache2-30a-entry-pinning.js
@@ -1,24 +1,24 @@
 function run_test()
 {
   do_get_profile();
 
   // Open for write, write
-  asyncOpenCacheEntry("http://a/", "pin", Ci.nsICacheStorage.OPEN_TRUNCATE, LoadContextInfo.default,
+  asyncOpenCacheEntry("http://a/", "pin", Ci.nsICacheStorage.OPEN_TRUNCATE, Services.loadContextInfo.default,
     new OpenCallback(NEW|WAITFORWRITE, "a1m", "a1d", function(entry) {
       // Open for read and check
-      asyncOpenCacheEntry("http://a/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+      asyncOpenCacheEntry("http://a/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
         new OpenCallback(NORMAL, "a1m", "a1d", function(entry) {
 
           // Now clear the whole cache
           get_cache_service().clear();
 
           // The pinned entry should be intact
-          asyncOpenCacheEntry("http://a/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+          asyncOpenCacheEntry("http://a/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
             new OpenCallback(NORMAL, "a1m", "a1d", function(entry) {
               finish_cache2_test();
             })
           );
 
         })
       );
     })
--- a/netwerk/test/unit/test_cache2-30b-pinning-storage-clear.js
+++ b/netwerk/test/unit/test_cache2-30b-pinning-storage-clear.js
@@ -1,13 +1,13 @@
 function run_test()
 {
   do_get_profile();
 
-  var lci = LoadContextInfo.default;
+  var lci = Services.loadContextInfo.default;
 
   // Open a pinned entry for write, write
   asyncOpenCacheEntry("http://a/", "pin", Ci.nsICacheStorage.OPEN_TRUNCATE, lci,
     new OpenCallback(NEW|WAITFORWRITE, "a1m", "a1d", function(entry) {
 
       // Now clear the disk storage, that should leave the pinned  entry in the cache
       var diskStorage = getCacheStorage("disk", lci);
       diskStorage.asyncEvictStorage(null);
--- a/netwerk/test/unit/test_cache2-30c-pinning-deferred-doom.js
+++ b/netwerk/test/unit/test_cache2-30c-pinning-deferred-doom.js
@@ -22,17 +22,17 @@ This is a complex test checking the inte
 const kENTRYCOUNT = 10;
 
 function log_(msg) { if (true) dump(">>>>>>>>>>>>> " + msg + "\n"); }
 
 function run_test()
 {
   do_get_profile();
 
-  var lci = LoadContextInfo.default;
+  var lci = Services.loadContextInfo.default;
   var testingInterface = get_cache_service().QueryInterface(Ci.nsICacheTesting);
   Assert.ok(testingInterface);
 
   var mc = new MultipleCallbacks(1, function() {
     // (2)
 
     mc = new MultipleCallbacks(1, finish_cache2_test);
     // Release all references to cache entries so that they can be purged
--- a/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js
+++ b/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js
@@ -18,17 +18,17 @@ This test exercises the CacheFileContext
 const kENTRYCOUNT = 10;
 
 function log_(msg) { if (true) dump(">>>>>>>>>>>>> " + msg + "\n"); }
 
 function run_test()
 {
   do_get_profile();
 
-  var lci = LoadContextInfo.default;
+  var lci = Services.loadContextInfo.default;
   var testingInterface = get_cache_service().QueryInterface(Ci.nsICacheTesting);
   Assert.ok(testingInterface);
 
   var mc = new MultipleCallbacks(1, function() {
     // (2)
 
     mc = new MultipleCallbacks(1, finish_cache2_test);
     // Release all references to cache entries so that they can be purged
--- a/netwerk/test/unit/test_cache2-31-visit-all.js
+++ b/netwerk/test/unit/test_cache2-31-visit-all.js
@@ -1,15 +1,15 @@
 function run_test()
 {
   var storage = getCacheStorage("disk");
-  var lcis = [LoadContextInfo.default,
-              LoadContextInfo.custom(false, { userContextId: 1 }),
-              LoadContextInfo.custom(false, { userContextId: 2 }),
-              LoadContextInfo.custom(false, { userContextId: 3 })];
+  var lcis = [Services.loadContextInfo.default,
+              Services.loadContextInfo.custom(false, { userContextId: 1 }),
+              Services.loadContextInfo.custom(false, { userContextId: 2 }),
+              Services.loadContextInfo.custom(false, { userContextId: 3 })];
 
   do_get_profile();
 
   var mc = new MultipleCallbacks(8, function() {
     executeSoon(function() {
       var expectedConsumption = 8192;
       var entries = [{ uri: "http://a/", lci: lcis[0] },    // default
                      { uri: "http://b/", lci: lcis[0] },    // default
--- a/netwerk/test/unit/test_doomentry.js
+++ b/netwerk/test/unit/test_doomentry.js
@@ -4,17 +4,17 @@
  *   - an existent inactive entry
  *   - a non-existent inactive entry
  *   - an existent active entry
  */
 
 function doom(url, callback)
 {
   get_cache_service()
-      .diskCacheStorage(LoadContextInfo.default, false)
+      .diskCacheStorage(Services.loadContextInfo.default, false)
       .asyncDoomURI(createURI(url), "", {
         onCacheEntryDoomed: function(result) {
           callback(result);
         }
       });
 }
 
 function write_and_check(str, data, len)
--- a/netwerk/test/unit/test_inhibit_caching.js
+++ b/netwerk/test/unit/test_inhibit_caching.js
@@ -1,9 +1,8 @@
-ChromeUtils.import('resource://gre/modules/LoadContextInfo.jsm');
 ChromeUtils.import("resource://testing-common/httpd.js");
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 
 var first = true;
 function contentHandler(metadata, response)
 {
   response.setHeader("Content-Type", 'text/plain');
   var body = "first";
--- a/netwerk/test/unit/test_predictor.js
+++ b/netwerk/test/unit/test_predictor.js
@@ -1,17 +1,16 @@
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 var Cc = Components.classes;
 
 ChromeUtils.import("resource://testing-common/httpd.js");
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm");
 
 var running_single_process = false;
 
 var predictor = null;
 
 function is_child_process() {
   return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
 }
@@ -101,17 +100,17 @@ Verifier.prototype = {
       Assert.ok(false, "Got prefetch for unexpected uri " + uri.asciiSpec);
     } else {
       this.expected_prefetches.splice(index, 1);
     }
 
     dump("checking validity of entry for " + uri.spec + "\n");
     var checker = new ValidityChecker(this, status);
     asyncOpenCacheEntry(uri.spec, "disk",
-        Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default,
+        Ci.nsICacheStorage.OPEN_NORMALLY, Services.loadContextInfo.default,
         checker);
   },
 
   onPredictPreconnect: function verifier_onPredictPreconnect(uri) {
     var origin = extract_origin(uri);
     var index = this.expected_preconnects.indexOf(origin);
     if (index == -1 && !this.complete) {
       Assert.ok(false, "Got preconnect for unexpected uri " + origin);
@@ -174,17 +173,17 @@ var prepListener = {
     this.numEntriesOpened++;
     if (this.numEntriesToOpen == this.numEntriesOpened) {
       this.continueCallback();
     }
   }
 };
 
 function open_and_continue(uris, continueCallback) {
-  var ds = Services.cache2.diskCacheStorage(LoadContextInfo.default, false);
+  var ds = Services.cache2.diskCacheStorage(Services.loadContextInfo.default, false);
 
   prepListener.init(uris.length, continueCallback);
   for (var i = 0; i < uris.length; ++i) {
     ds.asyncOpenURI(uris[i], "", Ci.nsICacheStorage.OPEN_NORMALLY,
                     prepListener);
   }
 }
 
--- a/netwerk/test/unit/test_private_necko_channel.js
+++ b/netwerk/test/unit/test_private_necko_channel.js
@@ -40,14 +40,14 @@ function setupChannel(path) {
 function serverHandler(metadata, response) {
   response.setHeader("Content-Type", "text/plain", false);
   response.bodyOutputStream.write(httpbody, httpbody.length);
 }
 
 function checkRequest(request, data, context) {
   get_device_entry_count("disk", null, function(count) {
     Assert.equal(count, 0)
-    get_device_entry_count("disk", LoadContextInfo.private, function(count) {
+    get_device_entry_count("disk", Services.loadContextInfo.private, function(count) {
       Assert.equal(count, 1);
       httpserver.stop(do_test_finished);
     });
   });
 }
deleted file mode 100644
--- a/toolkit/modules/LoadContextInfo.jsm
+++ /dev/null
@@ -1,17 +0,0 @@
-/* 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/. */
-
-/**
- * This jsm is here only for compatibility.  Extension developers may use it
- * to build nsILoadContextInfo to pass down to HTTP cache APIs.  Originally
- * it was possible to implement nsILoadContextInfo in JS.  But now it turned
- * out to be a built-in class only, so we need a component (service) as
- * a factory to build nsILoadContextInfo in a JS code.
- */
-
-this.EXPORTED_SYMBOLS = ["LoadContextInfo"];
-// XXX Bug 1417937 will remove this file.
-// eslint-disable-next-line mozilla/use-services
-this.LoadContextInfo = Components.classes["@mozilla.org/load-context-info-factory;1"]
-                                 .getService(Components.interfaces.nsILoadContextInfoFactory);
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -89,19 +89,16 @@ with Files('Integration.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Async Tooling')
 
 with Files('JSONFile.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Form Manager')
 
 with Files('LightweightThemeConsumer.jsm'):
     BUG_COMPONENT = ('Firefox', 'Toolbars and Customization')
 
-with Files('LoadContextInfo.jsm'):
-    BUG_COMPONENT = ('Core', 'Networking: Cache')
-
 with Files('Memory.jsm'):
     BUG_COMPONENT = ('Core', 'DOM: Content Processes')
 
 with Files('NLP.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Find Toolbar')
 
 with Files('NewTabUtils.jsm'):
     BUG_COMPONENT = ('Firefox', 'Tabbed Browser')
@@ -205,17 +202,16 @@ EXTRA_JS_MODULES += [
     'GMPInstallManager.jsm',
     'GMPUtils.jsm',
     'Http.jsm',
     'IndexedDB.jsm',
     'InlineSpellChecker.jsm',
     'InlineSpellCheckerContent.jsm',
     'Integration.jsm',
     'JSONFile.jsm',
-    'LoadContextInfo.jsm',
     'Log.jsm',
     'Memory.jsm',
     'NewTabUtils.jsm',
     'NLP.jsm',
     'ObjectUtils.jsm',
     'PageMenu.jsm',
     'PageMetadata.jsm',
     'PermissionsUtils.jsm',