Bug 1240900 - Use outerWindowID directly from browser. r=ochameau draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 31 May 2016 16:56:54 -0500
changeset 374296 c08197d7243eb6ad8d5f7114e905c7f9faea0bf6
parent 374295 c631883768e3a9fb035b3c5453d3bcf72b900186
child 522603 605db4f8883c6b7bf396ff1df489ad11e88c334e
push id19984
push userbmo:jryans@gmail.com
push dateThu, 02 Jun 2016 07:18:32 +0000
reviewersochameau
bugs1240900
milestone49.0a1
Bug 1240900 - Use outerWindowID directly from browser. r=ochameau MozReview-Commit-ID: JuJNSScaJEs
devtools/client/framework/target.js
devtools/shared/client/main.js
--- a/devtools/client/framework/target.js
+++ b/devtools/client/framework/target.js
@@ -420,17 +420,17 @@ TabTarget.prototype = {
       this._client.connect()
         .then(() => this._client.getTab({ tab: this.tab }))
         .then(response => {
           this._form = response.tab;
           this._url = this._form.url;
           this._title = this._form.title;
 
           attachTab();
-        });
+        }, e => this._remote.reject(e));
     } else if (this.isTabActor) {
       // In the remote debugging case, the protocol connection will have been
       // already initialized in the connection screen code.
       attachTab();
     } else {
       // AddonActor and chrome debugging on RootActor doesn't inherits from
       // TabActor and doesn't need to be attached.
       attachConsole();
--- a/devtools/shared/client/main.js
+++ b/devtools/shared/client/main.js
@@ -1635,20 +1635,17 @@ RootClient.prototype = {
         packet.tabId = aFilter.tabId;
       } else if ("tab" in aFilter) {
         let browser = aFilter.tab.linkedBrowser;
         if (browser.frameLoader.tabParent) {
           // Tabs in child process
           packet.tabId = browser.frameLoader.tabParent.tabId;
         } else {
           // Tabs in parent process
-          let windowUtils = browser.contentWindow
-            .QueryInterface(Ci.nsIInterfaceRequestor)
-            .getInterface(Ci.nsIDOMWindowUtils);
-          packet.outerWindowID = windowUtils.outerWindowID;
+          packet.outerWindowID = browser.outerWindowID;
         }
       } else {
         // Throw if a filter object have been passed but without
         // any clearly idenfified filter.
         throw new Error("Unsupported argument given to getTab request");
       }
     }