Bug 1003095 - Make the xpcInspector a built-in module;r=past

This commit is contained in:
Eddy Bruel 2014-05-21 15:55:53 +02:00
parent f411a6f46a
commit eed250e2f2
3 changed files with 8 additions and 1 deletions

View File

@ -30,6 +30,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", "resource://gre/modules/Fil
XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console", "resource://gre/modules/devtools/Console.jsm");
let xpcInspector = Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector);
let loader = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}).Loader;
let promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
@ -64,6 +66,7 @@ BuiltinProvider.prototype = {
"Services": Object.create(Services),
"Timer": Object.create(Timer),
"toolkit/loader": loader,
"xpcInspector": xpcInspector,
},
paths: {
// When you add a line to this mapping, don't forget to make a
@ -149,6 +152,7 @@ SrcdirProvider.prototype = {
"Services": Object.create(Services),
"Timer": Object.create(Timer),
"toolkit/loader": loader,
"xpcInspector": xpcInspector,
},
paths: {
"": "resource://gre/modules/commonjs/",

View File

@ -222,7 +222,7 @@ var DebuggerServer = {
return;
}
this.xpcInspector = Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector);
this.xpcInspector = require("xpcInspector");
this.initTransport(aAllowConnectionCallback);
this._initialized = true;

View File

@ -342,6 +342,8 @@ if (typeof Components === "object") {
const chrome = { CC: Function.bind.call(CC, Components), Cc: Cc,
ChromeWorker: ChromeWorker, Cm: Cm, Ci: Ci, Cu: Cu,
Cr: Cr, components: Components };
const xpcInspector = Cc["@mozilla.org/jsinspector;1"].
getService(Ci.nsIJSInspector);
this.worker = new WorkerDebuggerLoader({
createSandbox: createSandbox,
@ -355,6 +357,7 @@ if (typeof Components === "object") {
"Timer": Object.create(Timer),
"chrome": chrome,
"source-map": SourceMap,
"xpcInspector": xpcInspector,
},
paths: {
"": "resource://gre/modules/commonjs/",