Bug 1167508 - Remove TabState.flush() r=billm
authorTim Taubert <ttaubert@mozilla.com>
Tue, 09 Jun 2015 22:11:25 +0200
changeset 248078 d3de3ab56658c3571acf02bf500c7afa3090cbdb
parent 248077 0b0b75e8dd0b5996638bf44aa6f8c3afd58bf3b1
child 248079 ad065623983ef6a0a6ea02dc412cf05948ace88a
push id60888
push userkwierso@gmail.com
push dateThu, 11 Jun 2015 01:38:38 +0000
treeherdermozilla-inbound@39e638ed06bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1167508
milestone41.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 1167508 - Remove TabState.flush() r=billm
browser/components/sessionstore/TabState.jsm
--- a/browser/components/sessionstore/TabState.jsm
+++ b/browser/components/sessionstore/TabState.jsm
@@ -30,20 +30,16 @@ this.TabState = Object.freeze({
   setSyncHandler: function (browser, handler) {
     TabStateInternal.setSyncHandler(browser, handler);
   },
 
   update: function (browser, data) {
     TabStateInternal.update(browser, data);
   },
 
-  flush: function (browser) {
-    TabStateInternal.flush(browser);
-  },
-
   flushAsync: function (browser) {
     TabStateInternal.flushAsync(browser);
   },
 
   flushWindow: function (window) {
     TabStateInternal.flushWindow(window);
   },
 
@@ -87,43 +83,36 @@ let TabStateInternal = {
     // synchronously.
     if (id > this._latestMessageID.get(browser.permanentKey)) {
       this._latestMessageID.set(browser.permanentKey, id);
       TabStateCache.update(browser, data);
     }
   },
 
   /**
-   * Flushes all data currently queued in the given browser's content script.
-   */
-  flush: function (browser) {
-    if (this._syncHandlers.has(browser.permanentKey)) {
-      let lastID = this._latestMessageID.get(browser.permanentKey);
-      this._syncHandlers.get(browser.permanentKey).flush(lastID);
-    }
-  },
-
-  /**
    * DO NOT USE - DEBUGGING / TESTING ONLY
    *
    * This function is used to simulate certain situations where race conditions
    * can occur by sending data shortly before flushing synchronously.
    */
   flushAsync: function(browser) {
     if (this._syncHandlers.has(browser.permanentKey)) {
       this._syncHandlers.get(browser.permanentKey).flushAsync();
     }
   },
 
   /**
    * Flushes queued content script data for all browsers of a given window.
    */
   flushWindow: function (window) {
     for (let browser of window.gBrowser.browsers) {
-      this.flush(browser);
+      if (this._syncHandlers.has(browser.permanentKey)) {
+        let lastID = this._latestMessageID.get(browser.permanentKey);
+        this._syncHandlers.get(browser.permanentKey).flush(lastID);
+      }
     }
   },
 
   /**
    * Collect data related to a single tab, synchronously.
    *
    * @param tab
    *        tabbrowser tab