Bug 1492950 - Get rid of getBrowserForDocument, getBrowserForContentWindow and _getTabForContentWindow. r=NeilDeakin
authorMike Conley <mconley@mozilla.com>
Tue, 02 Oct 2018 17:54:15 +0000
changeset 494958 48be1c7d47ef2dbc664d350dbe7f1837d1d39ce7
parent 494957 1940595cb776790de40008a4b90d54356f5e5753
child 494959 56f92aa110f06c299e2dc301782d7abd3f02400b
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeilDeakin
bugs1492950
milestone64.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 1492950 - Get rid of getBrowserForDocument, getBrowserForContentWindow and _getTabForContentWindow. r=NeilDeakin Depends on D6716 Differential Revision: https://phabricator.services.mozilla.com/D6718
browser/base/content/tabbrowser.js
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -639,48 +639,20 @@ window._gBrowser = {
       });
     });
   },
 
   getBrowserAtIndex(aIndex) {
     return this.browsers[aIndex];
   },
 
-  getBrowserForDocument(aDocument) {
-    var tab = this._getTabForContentWindow(aDocument.defaultView);
-    return tab ? tab.linkedBrowser : null;
-  },
-
-  getBrowserForContentWindow(aWindow) {
-    var tab = this._getTabForContentWindow(aWindow);
-    return tab ? tab.linkedBrowser : null;
-  },
-
   getBrowserForOuterWindowID(aID) {
     return this._outerWindowIDBrowserMap.get(aID);
   },
 
-  _getTabForContentWindow(aWindow) {
-    // When not using remote browsers, we can take a fast path by getting
-    // directly from the content window to the browser without looping
-    // over all browsers.
-    if (!gMultiProcessBrowser) {
-      let browser = aWindow.docShell.chromeEventHandler;
-      return this.getTabForBrowser(browser);
-    }
-
-    for (let i = 0; i < this.browsers.length; i++) {
-      // NB: We use contentWindowAsCPOW so that this code works both
-      // for remote browsers as well. aWindow may be a CPOW.
-      if (this.browsers[i].contentWindowAsCPOW == aWindow)
-        return this.tabs[i];
-    }
-    return null;
-  },
-
   getTabForBrowser(aBrowser) {
     return this._tabForBrowser.get(aBrowser);
   },
 
   getNotificationBox(aBrowser) {
     return this.getSidebarContainer(aBrowser).parentNode;
   },