Bug 1303288 - Force unloading all JSM when reloading devtools via the addon. r=pbro
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 21 Sep 2016 08:06:01 -0700
changeset 358102 7a8ba181b2e173fb656499b18ab80814152642f9
parent 358101 3c4ca5845f2c12974cad7617efe5f12137603721
child 358103 1aaa9010a9a18ca16ee3dfedfc8aa0f085fb4510
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1303288
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1303288 - Force unloading all JSM when reloading devtools via the addon. r=pbro MozReview-Commit-ID: H6z4c6CXBC1
devtools/bootstrap.js
--- a/devtools/bootstrap.js
+++ b/devtools/bootstrap.js
@@ -119,16 +119,28 @@ function reload(event) {
   }, false);
 
   // As we can't get a reference to existing Loader.jsm instances, we send them
   // an observer service notification to unload them.
   Services.obs.notifyObservers(null, "devtools-unload", "reload");
 
   // Then spawn a brand new Loader.jsm instance and start the main module
   Cu.unload("resource://devtools/shared/Loader.jsm");
+  // Also unload all resources loaded as jsm, hopefully all of them are going
+  // to be converted into regular modules
+  Cu.unload("resource://devtools/client/shared/browser-loader.js");
+  Cu.unload("resource://devtools/client/framework/ToolboxProcess.jsm");
+  Cu.unload("resource://devtools/shared/apps/Devices.jsm");
+  Cu.unload("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
+  Cu.unload("resource://devtools/shared/Parser.jsm");
+  Cu.unload("resource://devtools/client/shared/DOMHelpers.jsm");
+  Cu.unload("resource://devtools/client/shared/widgets/VariablesView.jsm");
+  Cu.unload("resource://devtools/client/responsivedesign/responsivedesign.jsm");
+  Cu.unload("resource://devtools/client/shared/widgets/AbstractTreeItem.jsm");
+  Cu.unload("resource://devtools/shared/deprecated-sync-thenables.js");
   const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
   devtools.require("devtools/client/framework/devtools-browser");
 
   // Go over all top level windows to reload all devtools related things
   let windowsEnum = Services.wm.getEnumerator(null);
   while (windowsEnum.hasMoreElements()) {
     let window = windowsEnum.getNext();
     let windowtype = window.document.documentElement.getAttribute("windowtype");