mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1237606 - Ensure reloading gDevTools dependencies from the reload addon. r=jryans
This commit is contained in:
parent
d2b3b8649d
commit
8e2329706f
4
devtools/bootstrap.js
vendored
4
devtools/bootstrap.js
vendored
@ -80,6 +80,10 @@ function reload(event) {
|
||||
// Ask the loader to update itself and reopen the toolbox if needed
|
||||
const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
devtools.reload(reloadToolbox);
|
||||
|
||||
// Also tells gDevTools to reload its dependencies
|
||||
const {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
gDevTools.reload();
|
||||
}
|
||||
|
||||
let listener;
|
||||
|
@ -10,21 +10,34 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
const { require, loader } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const promise = require("promise");
|
||||
// Load target and toolbox lazily as they need gDevTools to be fully initialized
|
||||
loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/target", true);
|
||||
loader.lazyRequireGetter(this, "Toolbox", "devtools/client/framework/toolbox", true);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
|
||||
"resource:///modules/CustomizableUI.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
|
||||
// Make most dependencies be reloadable so that the reload addon
|
||||
// can update all of them while keeping gDevTools.jsm as-is
|
||||
// Bug 1188405 is going to refactor this JSM into a commonjs module
|
||||
// so that it can be reloaded as other modules.
|
||||
let require, loader, promise, DefaultTools, DefaultThemes;
|
||||
let loadDependencies = () => {
|
||||
let l = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
require = l.require;
|
||||
loader = l.loader;
|
||||
promise = require("promise");
|
||||
// Load target and toolbox lazily as they need gDevTools to be fully initialized
|
||||
loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/target", true);
|
||||
loader.lazyRequireGetter(this, "Toolbox", "devtools/client/framework/toolbox", true);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
|
||||
"resource:///modules/CustomizableUI.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
|
||||
|
||||
let d = require("devtools/client/definitions");
|
||||
DefaultTools = d.defaultTools;
|
||||
DefaultThemes = d.defaultThemes;
|
||||
};
|
||||
loadDependencies();
|
||||
|
||||
const {defaultTools: DefaultTools, defaultThemes: DefaultThemes} =
|
||||
require("devtools/client/definitions");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const Telemetry = require("devtools/client/shared/telemetry");
|
||||
const {JsonView} = require("devtools/client/jsonview/main");
|
||||
@ -511,6 +524,11 @@ DevTools.prototype = {
|
||||
// Is taken care of by the gDevToolsBrowser.forgetBrowserWindow
|
||||
},
|
||||
|
||||
// Force reloading dependencies if the loader happens to have reloaded
|
||||
reload() {
|
||||
loadDependencies();
|
||||
},
|
||||
|
||||
/**
|
||||
* Iterator that yields each of the toolboxes.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user