Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
let {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
|
||||
let {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", {});
|
||||
let protocolProxyService = Cc["@mozilla.org/network/protocol-proxy-service;1"]
|
||||
.getService(Ci.nsIProtocolProxyService);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
|
||||
let EventUtils = {};
|
||||
Services.scriptloader.loadSubScript(
|
||||
@@ -27,7 +27,7 @@ const FAVICON_URI = TEST_DIRECTORY + "file_favicon.png";
|
||||
const TEST_FAVICON_CACHE_URI = TEST_DIRECTORY + "file_favicon_cache.png";
|
||||
|
||||
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
let makeURI = Cu.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
|
||||
let makeURI = ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
|
||||
|
||||
function clearAllImageCaches() {
|
||||
let tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
|
||||
ChromeUtils.defineModuleGetter(this, "Promise",
|
||||
"resource://gre/modules/Promise.jsm");
|
||||
|
||||
let EventUtils = {};
|
||||
@@ -27,7 +27,7 @@ const USER_CONTEXT_ID_PERSONAL = 1;
|
||||
const USER_CONTEXT_ID_WORK = 2;
|
||||
|
||||
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
let makeURI = Cu.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
|
||||
let makeURI = ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
|
||||
|
||||
function clearAllImageCaches() {
|
||||
var tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
let Cu = Components.utils;
|
||||
let {HttpServer} = Cu.import("resource://testing-common/httpd.js", {});
|
||||
let {HttpServer} = ChromeUtils.import("resource://testing-common/httpd.js", {});
|
||||
|
||||
let server = new HttpServer();
|
||||
server.registerPathHandler("/file.html", fileHandler);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
requestLongerTimeout(2);
|
||||
|
||||
let Cu = Components.utils;
|
||||
let {HttpServer} = Cu.import("resource://testing-common/httpd.js", {});
|
||||
let {HttpServer} = ChromeUtils.import("resource://testing-common/httpd.js", {});
|
||||
|
||||
const NUM_ISOLATION_LOADS = 2;
|
||||
const NUM_CACHED_LOADS = 1;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
let {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
|
||||
let {LoadContextInfo} = ChromeUtils.import("resource://gre/modules/LoadContextInfo.jsm", {});
|
||||
|
||||
const TEST_DOMAIN = "http://example.net/";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user