Bug 1298323 - do not destroy the Finder instance when only a single window closes in e10s mode, because that render the findbar useless. r=jaws, a=ritu
authorMike de Boer <mdeboer@mozilla.com>
Mon, 26 Sep 2016 14:24:23 +0200
changeset 348336 e613221b195971a2b4a390bf6ca9109e09b99ddf
parent 348335 2663d882602b065945d483a206bb3a39f46cc479
child 348337 48d77c582ec436b3f7dca684fff6ef2ab97af086
push id6420
push usermdeboer@mozilla.com
push dateMon, 26 Sep 2016 12:27:29 +0000
treeherdermozilla-beta@e613221b1959 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, ritu
bugs1298323
milestone50.0
Bug 1298323 - do not destroy the Finder instance when only a single window closes in e10s mode, because that render the findbar useless. r=jaws, a=ritu
toolkit/modules/RemoteFinder.jsm
--- a/toolkit/modules/RemoteFinder.jsm
+++ b/toolkit/modules/RemoteFinder.jsm
@@ -21,27 +21,17 @@ XPCOMUtils.defineLazyGetter(this, "Rect"
 function RemoteFinder(browser) {
   this._listeners = new Set();
   this._searchString = null;
 
   this.swapBrowser(browser);
 }
 
 RemoteFinder.prototype = {
-  destroy() {
-    this._browser.messageManager.sendAsyncMessage("Finder:Destroy");
-    if (this._messageManager) {
-      this._messageManager.removeMessageListener("Finder:Result", this);
-      this._messageManager.removeMessageListener("Finder:MatchesResult", this);
-      this._messageManager.removeMessageListener("Finder:CurrentSelectionResult",this);
-      this._messageManager.removeMessageListener("Finder:HighlightFinished",this);
-    }
-    this._listeners.clear();
-    this._browser = this._messageManager = null;
-  },
+  destroy() {},
 
   swapBrowser: function(aBrowser) {
     if (this._messageManager) {
       this._messageManager.removeMessageListener("Finder:Result", this);
       this._messageManager.removeMessageListener("Finder:MatchesResult", this);
       this._messageManager.removeMessageListener("Finder:CurrentSelectionResult",this);
       this._messageManager.removeMessageListener("Finder:HighlightFinished",this);
     }
@@ -223,17 +213,16 @@ function RemoteFinderListener(global) {
   for (let msg of this.MESSAGES) {
     global.addMessageListener(msg, this);
   }
 }
 
 RemoteFinderListener.prototype = {
   MESSAGES: [
     "Finder:CaseSensitive",
-    "Finder:Destroy",
     "Finder:EntireWord",
     "Finder:FastFind",
     "Finder:FindAgain",
     "Finder:SetSearchStringToSelection",
     "Finder:GetInitialSelection",
     "Finder:Highlight",
     "Finder:HighlightAllChange",
     "Finder:EnableSelection",
@@ -258,20 +247,16 @@ RemoteFinderListener.prototype = {
   onHighlightFinished: function(aData) {
     this._global.sendAsyncMessage("Finder:HighlightFinished", aData);
   },
 
   receiveMessage: function (aMessage) {
     let data = aMessage.data;
 
     switch (aMessage.name) {
-      case "Finder:Destroy":
-        this._finder.destroy();
-        break;
-
       case "Finder:CaseSensitive":
         this._finder.caseSensitive = data.caseSensitive;
         break;
 
       case "Finder:EntireWord":
         this._finder.entireWord = data.entireWord;
         break;