Bug 1683058 - Remove unused isPrivate from ext-browser.js. r=robwu
authorRicha Sharma <onlinericha19@gmail.com>
Tue, 20 Apr 2021 12:59:26 +0000
changeset 576761 6ff3ee1b1d8d8e281bfaf28c16c43bb1610875a7
parent 576760 0334a079cbaf9fbb365a2944195effaee73b94d9
child 576762 f3c76d2c6c81361454c3bbfbaa198c0080fd6de1
push id38391
push userncsoregi@mozilla.com
push dateTue, 20 Apr 2021 21:39:49 +0000
treeherdermozilla-central@0c0c1834fbd1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobwu
bugs1683058
milestone89.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 1683058 - Remove unused isPrivate from ext-browser.js. r=robwu Differential Revision: https://phabricator.services.mozilla.com/D104055
browser/components/extensions/parent/ext-browser.js
--- a/browser/components/extensions/parent/ext-browser.js
+++ b/browser/components/extensions/parent/ext-browser.js
@@ -39,20 +39,16 @@ const READER_MODE_PREFIX = "about:reader
 
 let tabTracker;
 let windowTracker;
 
 function isPrivateTab(nativeTab) {
   return PrivateBrowsingUtils.isBrowserPrivate(nativeTab.linkedBrowser);
 }
 
-function isPrivateWindow(window) {
-  return PrivateBrowsingUtils.isContentWindowPrivate(window);
-}
-
 // This function is pretty tightly tied to Extension.jsm.
 // Its job is to fill in the |tab| property of the sender.
 const getSender = (extension, target, sender) => {
   let tabId;
   if ("tabId" in sender) {
     // The message came from a privileged extension page running in a tab. In
     // that case, it should include a tabId property (which is filled in by the
     // page-open listener below).
@@ -420,40 +416,36 @@ class TabTracker extends TabTrackerBase 
       return;
     }
     this.adoptedTabs.add(adoptedTab);
     let tabId = this.getId(adoptedTab);
     this.setId(adoptingTab, tabId);
     this.emit("tab-adopted", adoptingTab, adoptedTab);
     if (this.has("tab-detached")) {
       let nativeTab = adoptedTab;
-      let isPrivate = isPrivateTab(nativeTab);
       let adoptedBy = adoptingTab;
       let oldWindowId = windowTracker.getId(nativeTab.ownerGlobal);
       let oldPosition = nativeTab._tPos;
       this.emit("tab-detached", {
         nativeTab,
         adoptedBy,
         tabId,
         oldWindowId,
         oldPosition,
-        isPrivate,
       });
     }
     if (this.has("tab-attached")) {
       let nativeTab = adoptingTab;
-      let isPrivate = isPrivateTab(nativeTab);
       let newWindowId = windowTracker.getId(nativeTab.ownerGlobal);
       let newPosition = nativeTab._tPos;
       this.emit("tab-attached", {
         nativeTab,
         tabId,
         newWindowId,
         newPosition,
-        isPrivate,
       });
     }
   }
 
   _handleTabDestroyed(event, { nativeTab }) {
     let id = this._tabs.get(nativeTab);
     if (id) {
       this._tabs.delete(nativeTab);
@@ -677,17 +669,16 @@ class TabTracker extends TabTrackerBase 
    */
   emitActivated(nativeTab, previousTab = undefined) {
     let previousTabIsPrivate, previousTabId;
     if (previousTab && !previousTab.closing) {
       previousTabId = this.getId(previousTab);
       previousTabIsPrivate = isPrivateTab(previousTab);
     }
     this.emit("tab-activated", {
-      isPrivate: isPrivateTab(nativeTab),
       tabId: this.getId(nativeTab),
       previousTabId,
       previousTabIsPrivate,
       windowId: windowTracker.getId(nativeTab.ownerGlobal),
       nativeTab,
     });
   }
 
@@ -699,34 +690,32 @@ class TabTracker extends TabTrackerBase 
    * @private
    */
   emitHighlighted(window) {
     let tabIds = window.gBrowser.selectedTabs.map(tab => this.getId(tab));
     let windowId = windowTracker.getId(window);
     this.emit("tabs-highlighted", {
       tabIds,
       windowId,
-      isPrivate: isPrivateWindow(window),
     });
   }
 
   /**
    * Emits a "tab-created" event for the given tab element.
    *
    * @param {NativeTab} nativeTab
    *        The tab element which is being created.
    * @param {Object} [currentTabSize]
    *        The size of the tab element for the currently active tab.
    * @private
    */
   emitCreated(nativeTab, currentTabSize) {
     this.emit("tab-created", {
       nativeTab,
       currentTabSize,
-      isPrivate: isPrivateTab(nativeTab),
     });
   }
 
   /**
    * Emits a "tab-removed" event for the given tab element.
    *
    * @param {NativeTab} nativeTab
    *        The tab element which is being removed.
@@ -739,17 +728,16 @@ class TabTracker extends TabTrackerBase 
     let windowId = windowTracker.getId(nativeTab.ownerGlobal);
     let tabId = this.getId(nativeTab);
 
     this.emit("tab-removed", {
       nativeTab,
       tabId,
       windowId,
       isWindowClosing,
-      isPrivate: isPrivateTab(nativeTab),
     });
   }
 
   getBrowserData(browser) {
     let window = browser.ownerGlobal;
     if (!window) {
       return {
         tabId: -1,