Created
August 30, 2017 15:32
-
-
Save juliandescottes/2297bea42b002c4a60abce1c50ec80b7 to your computer and use it in GitHub Desktop.
Patch Bug 1392602
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HG changeset patch | |
# User Alexandre Poirot <poirot.alex@gmail.com> | |
# Date 1504106732 -7200 | |
# Wed Aug 30 17:25:32 2017 +0200 | |
# Node ID 2e82b9d2aabb0cadb122acb5aff6ac8360addca3 | |
# Parent 17c9e17bd049ea981483a28dfd3c483f614189de | |
Bug 1392602 - Copy SDK Loader to devtools. r=jdescottes | |
MozReview-Commit-ID: 6INu38Wqvt | |
diff --git a/devtools/client/shared/browser-loader.js b/devtools/client/shared/browser-loader.js | |
--- a/devtools/client/shared/browser-loader.js | |
+++ b/devtools/client/shared/browser-loader.js | |
@@ -1,15 +1,15 @@ | |
/* 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/. */ | |
"use strict"; | |
var Cu = Components.utils; | |
-const loaders = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}); | |
+const loaders = Cu.import("resource://devtools/shared/loader.js", {}); | |
const { devtools } = Cu.import("resource://devtools/shared/Loader.jsm", {}); | |
const { joinURI } = devtools.require("devtools/shared/path"); | |
const { assert } = devtools.require("devtools/shared/DevToolsUtils"); | |
const Services = devtools.require("Services"); | |
const { AppConstants } = devtools.require("resource://gre/modules/AppConstants.jsm"); | |
const BROWSER_BASED_DIRS = [ | |
"resource://devtools/client/inspector/boxmodel", | |
diff --git a/devtools/shared/Loader.jsm b/devtools/shared/Loader.jsm | |
--- a/devtools/shared/Loader.jsm | |
+++ b/devtools/shared/Loader.jsm | |
@@ -5,17 +5,17 @@ | |
"use strict"; | |
/** | |
* Manages the addon-sdk loader instance used to load the developer tools. | |
*/ | |
var { utils: Cu } = Components; | |
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {}); | |
-var { Loader, descriptor, resolveURI } = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}); | |
+var { Loader, descriptor, resolveURI } = Cu.import("resource://devtools/shared/loader.js", {}); | |
var { requireRawId } = Cu.import("resource://devtools/shared/loader-plugin-raw.jsm", {}); | |
this.EXPORTED_SYMBOLS = ["DevToolsLoader", "devtools", "BuiltinProvider", | |
"require", "loader"]; | |
/** | |
* Providers are different strategies for loading the devtools. | |
*/ | |
diff --git a/devtools/shared/builtin-modules.js b/devtools/shared/builtin-modules.js | |
--- a/devtools/shared/builtin-modules.js | |
+++ b/devtools/shared/builtin-modules.js | |
@@ -9,17 +9,17 @@ | |
* pseudo modules that aren't separate files but just dynamically set values. | |
* | |
* As it does so, the module itself doesn't have access to these globals, | |
* nor the pseudo modules. Be careful to avoid loading any other js module as | |
* they would also miss them. | |
*/ | |
const { Cu, CC, Cc, Ci } = require("chrome"); | |
-const { Loader } = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}); | |
+const { Loader } = Cu.import("resource://devtools/shared/loader.js", {}); | |
const promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise; | |
const jsmScope = Cu.import("resource://gre/modules/Services.jsm", {}); | |
const { Services } = jsmScope; | |
// Steal various globals only available in JSM scope (and not Sandbox one) | |
const { PromiseDebugging, ChromeUtils, ThreadSafeChromeUtils, HeapSnapshot, | |
atob, btoa, TextEncoder, TextDecoder } = jsmScope; | |
// Create a single Sandbox to access global properties needed in this module. | |
diff --git a/addon-sdk/source/lib/toolkit/loader.js b/devtools/shared/loader.js | |
copy from addon-sdk/source/lib/toolkit/loader.js | |
copy to devtools/shared/loader.js | |
diff --git a/devtools/shared/moz.build b/devtools/shared/moz.build | |
--- a/devtools/shared/moz.build | |
+++ b/devtools/shared/moz.build | |
@@ -55,16 +55,17 @@ DevToolsModules( | |
'event-emitter.js', | |
'extend.js', | |
'flags.js', | |
'generate-uuid.js', | |
'indentation.js', | |
'indexed-db.js', | |
'l10n.js', | |
'loader-plugin-raw.jsm', | |
+ 'loader.js', | |
'Loader.jsm', | |
'old-event-emitter.js', | |
'Parser.jsm', | |
'path.js', | |
'plural-form.js', | |
'protocol.js', | |
'system.js', | |
'task.js', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment