Bug 1167508 - Remove TabState.flush() r=billm
☠☠ backed out by 986f641d87e4 ☠ ☠
authorTim Taubert <ttaubert@mozilla.com>
Fri, 22 May 2015 02:11:03 -0400
changeset 248031 c1a16fd640aed3c0fbfacde14bd3bcbfda7adf3d
parent 248030 092037dd209ade86cbe52e765a7d7ac05f8c57bf
child 248032 00eb943a27b21e92204c525a656c59ec17e3c50e
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