Bug 1462121 - Remove unused docShell member draft
authorRob Wu <rob@robwu.nl>
Thu, 17 May 2018 12:27:06 +0200
changeset 796413 e0c1f08e6284903bb36604135628be9075f7cef4
parent 796412 0f7d2f84073aafc577742c923f9d29db5b0731c1
child 796414 8660bdb2ac50776a58c88f3ace04628cd773bcd5
push id110248
push userbmo:rob@robwu.nl
push dateThu, 17 May 2018 17:12:40 +0000
bugs1462121
milestone62.0a1
Bug 1462121 - Remove unused docShell member MozReview-Commit-ID: GsnJ8qcLhXp
toolkit/components/extensions/ExtensionCommon.jsm
--- a/toolkit/components/extensions/ExtensionCommon.jsm
+++ b/toolkit/components/extensions/ExtensionCommon.jsm
@@ -130,47 +130,43 @@ class BaseContext {
     this._lastError = null;
     this.contextId = getUniqueId();
     this.unloaded = false;
     this.extension = extension;
     this.jsonSandbox = null;
     this.active = true;
     this.incognito = null;
     this.messageManager = null;
-    this.docShell = null;
     this.contentWindow = null;
     this.innerWindowID = 0;
   }
 
   setContentWindow(contentWindow) {
     let {document} = contentWindow;
-    let {docShell} = document;
 
     this.innerWindowID = getInnerWindowID(contentWindow);
-    this.messageManager = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
+    this.messageManager = document.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
                                   .getInterface(Ci.nsIContentFrameMessageManager);
 
     if (this.incognito == null) {
       this.incognito = PrivateBrowsingUtils.isContentWindowPrivate(contentWindow);
     }
 
     MessageChannel.setupMessageManagers([this.messageManager]);
 
     let onPageShow = event => {
       if (!event || event.target === document) {
-        this.docShell = docShell;
         this.contentWindow = contentWindow;
         this.active = true;
       }
     };
     let onPageHide = event => {
       if (!event || event.target === document) {
         // Put this off until the next tick.
         Promise.resolve().then(() => {
-          this.docShell = null;
           this.contentWindow = null;
           this.active = false;
         });
       }
     };
 
     onPageShow();
     contentWindow.addEventListener("pagehide", onPageHide, {mozSystemGroup: true});