Bug 1356244 - use DevToolsShim in ext-devtools.js draft
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 24 Apr 2017 11:03:27 +0200
changeset 567009 a95b13f7542f42b21809f1af795e9096091aabc7
parent 567008 ca9e5f5b8680f58fe97a496a31e5b83104b326a2
child 567010 67cdf2bf63a1e404dcb13edf2e47c3eef6602965
push id55407
push userjdescottes@mozilla.com
push dateMon, 24 Apr 2017 09:44:49 +0000
bugs1356244
milestone55.0a1
Bug 1356244 - use DevToolsShim in ext-devtools.js MozReview-Commit-ID: Bi1bSqgl1mI
browser/components/extensions/ext-devtools.js
--- a/browser/components/extensions/ext-devtools.js
+++ b/browser/components/extensions/ext-devtools.js
@@ -4,18 +4,18 @@
 
 /* global getTargetTabIdForToolbox */
 
 /**
  * This module provides helpers used by the other specialized `ext-devtools-*.js` modules
  * and the implementation of the `devtools_page`.
  */
 
-XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
-                                  "resource://devtools/client/framework/gDevTools.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "DevToolsShim",
+                                  "chrome://devtools-shim/content/DevToolsShim.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 Cu.import("resource://gre/modules/ExtensionParent.jsm");
 
 var {
   HiddenExtensionPage,
   watchExtensionProxyContextLoad,
@@ -254,17 +254,17 @@ let devToolsInitialized = false;
 initDevTools = function() {
   if (devToolsInitialized) {
     return;
   }
 
   /* eslint-disable mozilla/balanced-listeners */
   // Create a devtools page context for a new opened toolbox,
   // based on the registered devtools_page definitions.
-  gDevTools.on("toolbox-created", (evt, toolbox) => {
+  DevToolsShim.on("toolbox-created", (evt, toolbox) => {
     if (!toolbox.target.isLocalTab) {
       // Only local tabs are currently supported (See Bug 1304378 for additional details
       // related to remote targets support).
       let msg = `Ignoring DevTools Toolbox for target "${toolbox.target.toString()}": ` +
                 `"${toolbox.target.name}" ("${toolbox.target.url}"). ` +
                 "Only local tab are currently supported by the WebExtensions DevTools API.";
       let scriptError = Cc["@mozilla.org/scripterror;1"].createInstance(Ci.nsIScriptError);
       scriptError.init(msg, null, null, null, null, Ci.nsIScriptError.warningFlag, "content javascript");
@@ -276,17 +276,17 @@ initDevTools = function() {
 
     for (let devtoolsPage of devtoolsPageDefinitionMap.values()) {
       devtoolsPage.buildForToolbox(toolbox);
     }
   });
 
   // Destroy a devtools page context for a destroyed toolbox,
   // based on the registered devtools_page definitions.
-  gDevTools.on("toolbox-destroy", (evt, target) => {
+  DevToolsShim.on("toolbox-destroy", (evt, target) => {
     if (!target.isLocalTab) {
       // Only local tabs are currently supported (See Bug 1304378 for additional details
       // related to remote targets support).
       return;
     }
 
     for (let devtoolsPageDefinition of devtoolsPageDefinitionMap.values()) {
       devtoolsPageDefinition.shutdownForTarget(target);