Bug 1499874 - Part 0a: Use abbreviated function syntax for session store. r=esawin
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 23 Dec 2018 17:53:49 +0100
changeset 509921 fae88c351d9428322c2fba2fb6ebdb44469c8663
parent 509920 096e9d2bdcb1d7d9ea029de2943f4b41c92cbd5b
child 509922 87165a9651fd8eb2eb7dea10a5de3f38351e825b
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersesawin
bugs1499874
milestone66.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 1499874 - Part 0a: Use abbreviated function syntax for session store. r=esawin Differential Revision: https://phabricator.services.mozilla.com/D15327
mobile/android/components/SessionStore.js
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -94,17 +94,17 @@ SessionStore.prototype = {
   // Whether or not to send notifications for changes to the closed tabs.
   _notifyClosedTabs: false,
 
   // If we're simultaneously closing both a tab and Firefox, we don't want
   // to bother reloading the newly selected tab if it is zombified.
   // The Java UI will tell us which tab to watch out for.
   _keepAsZombieTabId: INVALID_TAB_ID,
 
-  init: function ss_init() {
+  init() {
     loggingEnabled = Services.prefs.getBoolPref("browser.sessionstore.debug_logging");
 
     // Get file references
     this._sessionFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
     this._sessionFileBackup = this._sessionFile.clone();
     this._sessionFilePrevious = this._sessionFile.clone();
     this._sessionFileTemp = this._sessionFile.clone();
     this._sessionFile.append("sessionstore.js"); // The main session store save file.
@@ -126,24 +126,24 @@ SessionStore.prototype = {
     // Copy changes in Gecko settings to their Java counterparts,
     // so the startup code can access them
     SharedPreferences.forApp().setBoolPref(PREFS_RESTORE_FROM_CRASH,
       Services.prefs.getBoolPref(PREFS_RESTORE_FROM_CRASH));
     SharedPreferences.forApp().setIntPref(PREFS_MAX_CRASH_RESUMES,
       Services.prefs.getIntPref(PREFS_MAX_CRASH_RESUMES));
   },
 
-  _updateMaxTabsUndo: function ss_updateMaxTabsUndo() {
+  _updateMaxTabsUndo() {
     this._maxTabsUndo = Services.prefs.getIntPref(PREFS_MAX_TABS_UNDO);
     if (this._maxTabsUndo == 0) {
       this._forgetClosedTabs();
     }
   },
 
-  _purgeHistory: function ss_purgeHistory(topic) {
+  _purgeHistory(topic) {
     log(topic);
     this._clearDisk();
 
     // Clear all data about closed tabs
     this._forgetClosedTabs();
 
     // Clear all cached session history data.
     if (topic == "browser:purge-session-history") {
@@ -172,42 +172,42 @@ SessionStore.prototype = {
     }
 
     Services.obs.notifyObservers(null, "sessionstore-state-purge-complete");
     if (this._notifyClosedTabs) {
       this._sendClosedTabsToJava(Services.wm.getMostRecentWindow("navigator:browser"));
     }
   },
 
-  _clearDisk: function ss_clearDisk() {
+  _clearDisk() {
     this._sessionDataIsGood = false;
     this._lastBackupTime = 0;
 
     if (this._loadState > STATE_QUITTING) {
       OS.File.remove(this._sessionFile.path);
       OS.File.remove(this._sessionFileBackup.path);
       OS.File.remove(this._sessionFilePrevious.path);
       OS.File.remove(this._sessionFileTemp.path);
     } else { // We're shutting down and must delete synchronously
       if (this._sessionFile.exists()) { this._sessionFile.remove(false); }
       if (this._sessionFileBackup.exists()) { this._sessionFileBackup.remove(false); }
       if (this._sessionFilePrevious.exists()) { this._sessionFilePrevious.remove(false); }
       if (this._sessionFileTemp.exists()) { this._sessionFileTemp.remove(false); }
     }
   },
 
-  _forgetClosedTabs: function ss_forgetClosedTabs() {
+  _forgetClosedTabs() {
     for (let win of Object.values(this._windows)) {
       win.closedTabs = [];
     }
 
     this._lastClosedTabIndex = INVALID_TAB_INDEX;
   },
 
-  onEvent: function ss_onEvent(event, data, callback) {
+  onEvent(event, data, callback) {
     switch (event) {
       case "ClosedTabs:StartNotifications":
         this._notifyClosedTabs = true;
         log("ClosedTabs:StartNotifications");
         this._sendClosedTabsToJava(Services.wm.getMostRecentWindow("navigator:browser"));
         break;
 
       case "ClosedTabs:StopNotifications":
@@ -284,17 +284,17 @@ SessionStore.prototype = {
             type: "Tabs:TabsOpened",
           });
         }
         break;
       }
     }
   },
 
-  observe: function ss_observe(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     let observerService = Services.obs;
     switch (aTopic) {
       case "app-startup":
         EventDispatcher.instance.registerListener(this, [
           "ClosedTabs:StartNotifications",
           "ClosedTabs:StopNotifications",
           "Session:FlushTabs",
           "Session:Restore",
@@ -423,17 +423,17 @@ SessionStore.prototype = {
         for (let window of Object.values(this._windows)) {
           window.closedTabs = window.closedTabs.filter(tab => !tab.isPrivate);
         }
         this._lastClosedTabIndex = INVALID_TAB_INDEX;
         break;
     }
   },
 
-  handleEvent: function ss_handleEvent(aEvent) {
+  handleEvent(aEvent) {
     let window = aEvent.currentTarget.ownerGlobal;
     switch (aEvent.type) {
       case "TabOpen": {
         let browser = aEvent.target;
         log("TabOpen for tab " + window.BrowserApp.getTabForBrowser(browser).id);
         this.onTabAdd(window, browser);
         break;
       }
@@ -560,17 +560,17 @@ SessionStore.prototype = {
               this.onTabScroll(window, browser);
             }, 500);
         }
         break;
       }
     }
   },
 
-  onWindowOpen: function ss_onWindowOpen(aWindow) {
+  onWindowOpen(aWindow) {
     // Return if window has already been initialized
     if (aWindow && aWindow.__SSID && this._windows[aWindow.__SSID]) {
       return;
     }
 
     // Ignore non-browser windows and windows opened while shutting down
     if (aWindow.document.documentElement.getAttribute("windowtype") != "navigator:browser" || this._loadState <= STATE_QUITTING) {
       return;
@@ -596,17 +596,17 @@ SessionStore.prototype = {
     browsers.addEventListener("TabOpen", this, true);
     browsers.addEventListener("TabClose", this, true);
     browsers.addEventListener("TabSelect", this, true);
     browsers.addEventListener("TabMove", this, true);
     browsers.addEventListener("TabPreZombify", this, true);
     browsers.addEventListener("TabPostZombify", this, true);
   },
 
-  onWindowClose: function ss_onWindowClose(aWindow) {
+  onWindowClose(aWindow) {
     // Ignore windows not tracked by SessionStore
     if (!aWindow.__SSID || !this._windows[aWindow.__SSID]) {
       return;
     }
 
     let browsers = aWindow.document.getElementById("browsers");
     browsers.removeEventListener("TabOpen", this, true);
     browsers.removeEventListener("TabClose", this, true);
@@ -628,17 +628,17 @@ SessionStore.prototype = {
 
     let tabs = aWindow.BrowserApp.tabs;
     for (let i = 0; i < tabs.length; i++)
       this.onTabRemove(aWindow, tabs[i].browser, true);
 
     delete aWindow.__SSID;
   },
 
-  onTabAdd: function ss_onTabAdd(aWindow, aBrowser, aNoNotification) {
+  onTabAdd(aWindow, aBrowser, aNoNotification) {
     // Use DOMTitleChange to catch the initial load and restore history
     aBrowser.addEventListener("DOMTitleChanged", this, true);
 
     // Use load to restore text data
     aBrowser.addEventListener("load", this, true);
 
     // Gecko might set the initial zoom level after the JS "load" event,
     // so we have to restore zoom and scroll position after that.
@@ -663,17 +663,17 @@ SessionStore.prototype = {
           this._collectWindowData(aWindow);
         });
       }
       this.saveStateDelayed();
     }
     this._updateCrashReportURL(aWindow);
   },
 
-  onTabRemove: function ss_onTabRemove(aWindow, aBrowser, aNoNotification) {
+  onTabRemove(aWindow, aBrowser, aNoNotification) {
     // Cleanup event listeners
     aBrowser.removeEventListener("DOMTitleChanged", this, true);
     aBrowser.removeEventListener("load", this, true);
     aBrowser.removeEventListener("pageshow", this, true);
     aBrowser.removeEventListener("AboutReaderContentReady", this, true);
     aBrowser.removeEventListener("input", this, true);
     aBrowser.removeEventListener("DOMAutoComplete", this, true);
     aBrowser.removeEventListener("scroll", this, true);
@@ -689,17 +689,17 @@ SessionStore.prototype = {
     log("onTabRemove() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id +
         ", aNoNotification = " + aNoNotification);
     if (!aNoNotification) {
       let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(aBrowser);
       this.saveStateDelayed(isPrivate);
     }
   },
 
-  onTabClose: function ss_onTabClose(aWindow, aBrowser, aTabIndex) {
+  onTabClose(aWindow, aBrowser, aTabIndex) {
     // collect any pending data before saving
     if (this._formdataSavePending) {
       this.onTabInput(aWindow, aBrowser);
     }
     if (this._scrollSavePending) {
       this.onTabScroll(aWindow, aBrowser);
     }
     let data = aBrowser.__SS_data;
@@ -727,28 +727,28 @@ SessionStore.prototype = {
         this._sendClosedTabsToJava(aWindow);
       }
 
       log("onTabClose() ran for tab " + tab.id);
       sendEvent(aBrowser, "SSTabCloseProcessed");
     }
   },
 
-  _sessionDataIsEmpty: function ss_sessionDataIsEmpty(aData) {
+  _sessionDataIsEmpty(aData) {
     if (!aData || !aData.entries || aData.entries.length == 0) {
       return true;
     }
 
     let entries = aData.entries;
 
     return (entries.length == 1 &&
             (entries[0].url == "about:home" || entries[0].url == "about:privatebrowsing"));
   },
 
-  onTabLoad: function ss_onTabLoad(aWindow, aBrowser) {
+  onTabLoad(aWindow, aBrowser) {
     // If this browser belongs to a zombie tab or the initial restore hasn't yet finished,
     // skip any session save activity.
     if (aBrowser.__SS_restore || !this._startupRestoreFinished || aBrowser.__SS_restoreReloadPending) {
       return;
     }
 
     // Ignore a transient "about:blank"
     if (!aBrowser.canGoBack && aBrowser.currentURI.spec == "about:blank") {
@@ -808,17 +808,17 @@ SessionStore.prototype = {
 
     log("onTabLoad() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id);
     sendEvent(aBrowser, "SSTabDataUpdated");
     this.saveStateDelayed();
 
     this._updateCrashReportURL(aWindow);
   },
 
-  onTabSelect: function ss_onTabSelect(aWindow, aBrowser) {
+  onTabSelect(aWindow, aBrowser) {
     if (this._loadState != STATE_RUNNING) {
       return;
     }
 
     let tab = aWindow.BrowserApp.getTabForBrowser(aBrowser);
     let tabId = tab.id;
 
     this._windows[aWindow.__SSID].selectedTabId = tabId;
@@ -839,42 +839,42 @@ SessionStore.prototype = {
     // If the selected tab has changed while listening for closed tab
     // notifications, we may have switched between different private browsing
     // modes.
     if (this._notifyClosedTabs) {
       this._sendClosedTabsToJava(aWindow);
     }
   },
 
-  restoreZombieTab: function ss_restoreZombieTab(aTab) {
+  restoreZombieTab(aTab) {
     if (!aTab.browser.__SS_restore) {
       return;
     }
 
     let browser = aTab.browser;
     let data = browser.__SS_data;
     this._restoreTab(data, browser);
 
     delete browser.__SS_restore;
     browser.removeAttribute("pending");
     log("restoring zombie tab " + aTab.id);
   },
 
-  onTabMove: function ss_onTabMove() {
+  onTabMove() {
     if (this._loadState != STATE_RUNNING) {
       return;
     }
 
     // The long press that initiated the move canceled any close undo option that may have been
     // present.
     this._lastClosedTabIndex = INVALID_TAB_INDEX;
     this.saveStateDelayed();
   },
 
-  onTabInput: function ss_onTabInput(aWindow, aBrowser) {
+  onTabInput(aWindow, aBrowser) {
     // If we've been called directly, cancel any pending timeouts.
     if (this._formdataSavePending) {
       aWindow.clearTimeout(this._formdataSavePending);
       this._formdataSavePending = null;
       log("onTabInput() clearing pending timeout");
     }
 
     // If this browser belongs to a zombie tab or the initial restore hasn't yet finished,
@@ -900,17 +900,17 @@ SessionStore.prototype = {
     if (formdata && Object.keys(formdata).length) {
       data.formdata = formdata;
       log("onTabInput() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id);
       this.saveStateDelayed();
     }
     sendEvent(aBrowser, "SSTabInputCaptured");
   },
 
-  onTabScroll: function ss_onTabScroll(aWindow, aBrowser) {
+  onTabScroll(aWindow, aBrowser) {
     // If we've been called directly, cancel any pending timeouts.
     if (this._scrollSavePending) {
       aWindow.clearTimeout(this._scrollSavePending);
       this._scrollSavePending = null;
       log("onTabScroll() clearing pending timeout");
     }
 
     // If this browser belongs to a zombie tab or the initial restore hasn't yet finished,
@@ -949,28 +949,28 @@ SessionStore.prototype = {
 
     // Save zoom and scroll data.
     data.scrolldata = scrolldata;
     log("onTabScroll() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id);
     sendEvent(aBrowser, "SSTabScrollCaptured");
     this.saveStateDelayed();
   },
 
-  _getContentViewerSize: function ss_getContentViewerSize(aWindow) {
+  _getContentViewerSize(aWindow) {
     let displaySize = {};
     let width = {}, height = {};
     aWindow.windowUtils.getContentViewerSize(width, height);
 
     displaySize.width = width.value;
     displaySize.height = height.value;
 
     return displaySize;
   },
 
-  saveStateDelayed: function ss_saveStateDelayed(aPrivateTabsOnly = false) {
+  saveStateDelayed(aPrivateTabsOnly = false) {
     this._pendingWrite++;
     if (aPrivateTabsOnly) {
       this._pendingWritePrivateOnly++;
     }
     log("incrementing _pendingWrite to " + this._pendingWritePrivateOnly +
         "/" + this._pendingWrite);
 
     if (!this._saveTimer) {
@@ -993,56 +993,56 @@ SessionStore.prototype = {
                  > SAVE_INTERVAL_PRIVATE_TABS) {
       this._killTimer();
       this._createTimer(SAVE_INTERVAL_PRIVATE_TABS);
     } else {
       log("saveStateDelayed() timer already running, taking no action");
     }
   },
 
-  saveState: function ss_saveState(aPrivateTabsOnly = false) {
+  saveState(aPrivateTabsOnly = false) {
     this._pendingWrite++;
     if (aPrivateTabsOnly) {
       this._pendingWritePrivateOnly++;
     }
     log("saveState(), incrementing _pendingWrite to " + this._pendingWritePrivateOnly +
         "/" + this._pendingWrite);
     this._saveState(true);
   },
 
   /**
    * Immediately and synchronously writes any pending state to disk.
    *
    * @return True if data was written, false if no pending file writes were present.
    */
-  flushPendingState: function ss_flushPendingState() {
+  flushPendingState() {
     log("flushPendingState(), _pendingWrite = " + this._pendingWrite);
     if (this._pendingWrite) {
       this._saveState(false);
       return true;
     }
     return false;
   },
 
-  _createTimer: function ss_createTimer(aDelay) {
+  _createTimer(aDelay) {
     this._lastQueuedSaveTime = Date.now();
     this._saveTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     this._saveTimer.init(this, aDelay, Ci.nsITimer.TYPE_ONE_SHOT);
     log("saveTimer delay = " + aDelay);
   },
 
-  _killTimer: function ss_killTimer() {
+  _killTimer() {
     if (this._saveTimer) {
       this._saveTimer.cancel();
       this._saveTimer = null;
       log("killed queued saveTimer");
     }
   },
 
-  _saveState: function ss_saveState(aAsync) {
+  _saveState(aAsync) {
     log("_saveState(aAsync = " + aAsync + ")");
     // Kill any queued timer and save immediately
     this._killTimer();
 
     // Periodically save a "known good" copy of the session store data.
     if (!this._writeInProgress && Date.now() - this._lastBackupTime > this._backupInterval &&
          this._sessionDataIsGood && this._sessionFile.exists()) {
       if (this._sessionFileBackup.exists()) {
@@ -1114,30 +1114,30 @@ SessionStore.prototype = {
     } else {
       log("_saveState() writing empty normal data");
     }
     this._writeFile(this._sessionFile, this._sessionFileTemp, normalData, aAsync);
 
     this._lastSaveTime = Date.now();
   },
 
-  _getCurrentState: function ss_getCurrentState() {
+  _getCurrentState() {
     this._forEachBrowserWindow((aWindow) => {
       this._collectWindowData(aWindow);
     });
 
     let data = { windows: [] };
     for (let index in this._windows) {
       data.windows.push(this._windows[index]);
     }
 
     return data;
   },
 
-  _collectTabData: function ss__collectTabData(aWindow, aBrowser, aHistory) {
+  _collectTabData(aWindow, aBrowser, aHistory) {
     // If this browser is being restored, skip any session save activity
     if (aBrowser.__SS_restore) {
       return;
     }
 
     let tabData = {};
     let tab = aWindow.BrowserApp.getTabForBrowser(aBrowser);
     tabData.entries = aHistory.entries;
@@ -1146,17 +1146,17 @@ SessionStore.prototype = {
     tabData.desktopMode = tab.desktopMode;
     tabData.isPrivate = PrivateBrowsingUtils.isBrowserPrivate(aBrowser);
     tabData.tabId = tab.id;
     tabData.parentId = tab.parentId;
 
     aBrowser.__SS_data = tabData;
   },
 
-  _collectWindowData: function ss__collectWindowData(aWindow) {
+  _collectWindowData(aWindow) {
     // Ignore windows not tracked by SessionStore
     if (!aWindow.__SSID || !this._windows[aWindow.__SSID]) {
       return;
     }
 
     let winData = this._windows[aWindow.__SSID];
     winData.tabs = [];
 
@@ -1174,33 +1174,33 @@ SessionStore.prototype = {
         if (browser.__SS_extdata) {
           tabData.extData = browser.__SS_extdata;
         }
         winData.tabs.push(tabData);
       }
     }
   },
 
-  _forEachBrowserWindow: function ss_forEachBrowserWindow(aFunc) {
+  _forEachBrowserWindow(aFunc) {
     for (let window of Services.wm.getEnumerator("navigator:browser")) {
       if (window.__SSID && !window.closed) {
         aFunc.call(this, window);
       }
     }
   },
 
   /**
    * Writes the session state to a disk file, while doing some telemetry and notification
    * bookkeeping.
    * @param aFile nsIFile used for saving the session
    * @param aFileTemp nsIFile used as a temporary file in writing the data
    * @param aData JSON session state
    * @param aAsync boolelan used to determine the method of saving the state
    */
-  _writeFile: function ss_writeFile(aFile, aFileTemp, aData, aAsync) {
+  _writeFile(aFile, aFileTemp, aData, aAsync) {
     TelemetryStopwatch.start("FX_SESSION_RESTORE_SERIALIZE_DATA_MS");
     let state = JSON.stringify(aData);
     TelemetryStopwatch.finish("FX_SESSION_RESTORE_SERIALIZE_DATA_MS");
 
     // Convert data string to a utf-8 encoded array buffer
     let buffer = new TextEncoder().encode(state);
     Services.telemetry.getHistogramById("FX_SESSION_RESTORE_FILE_SIZE_BYTES").add(buffer.byteLength);
 
@@ -1236,17 +1236,17 @@ SessionStore.prototype = {
   /**
    * Writes the session state to a disk file, using async or sync methods
    * @param aFile nsIFile used for saving the session
    * @param aFileTemp nsIFile used as a temporary file in writing the data
    * @param aBuffer UTF-8 encoded ArrayBuffer of the session state
    * @param aAsync boolelan used to determine the method of saving the state
    * @return Promise that resolves when the file has been written
    */
-  _write: function ss_write(aFile, aFileTemp, aBuffer, aAsync) {
+  _write(aFile, aFileTemp, aBuffer, aAsync) {
     // Use async file writer and just return it's promise
     if (aAsync) {
       log("_write() writing asynchronously");
       return OS.File.writeAtomic(aFile.path, aBuffer, { tmpPath: aFileTemp.path });
     }
 
     // Convert buffer to an encoded string and sync write to disk
     let bytes = String.fromCharCode.apply(null, new Uint16Array(aBuffer));
@@ -1258,17 +1258,17 @@ SessionStore.prototype = {
     // to a temp file which is then renamed at the end.
     aFileTemp.renameTo(null, aFile.leafName);
     log("_write() writing synchronously");
 
     // Return a resolved promise to make the caller happy
     return Promise.resolve();
   },
 
-  _updateCrashReportURL: function ss_updateCrashReportURL(aWindow) {
+  _updateCrashReportURL(aWindow) {
     if (!AppConstants.MOZ_CRASHREPORTER) {
       return;
     }
 
     if (!aWindow.BrowserApp.selectedBrowser) {
       return;
     }
 
@@ -1286,34 +1286,34 @@ SessionStore.prototype = {
       // don't make noise when crashreporter is built but not enabled
       if (ex.result != Cr.NS_ERROR_NOT_INITIALIZED) {
         Cu.reportError("SessionStore:" + ex);
       }
     }
   },
 
   // This function iterates through a list of urls opening a new tab for each.
-  _openTabs: function ss_openTabs(aData) {
+  _openTabs(aData) {
     let window = Services.wm.getMostRecentWindow("navigator:browser");
     for (let i = 0; i < aData.urls.length; i++) {
       let url = aData.urls[i];
       let selected = (i == aData.urls.length - 1);
       let params = {
         selected,
         delayLoad: !selected,
         isPrivate: false,
         desktopMode: false,
       };
 
       window.BrowserApp.addTab(url, params);
     }
   },
 
   // This function iterates through a list of tab data restoring session for each of them.
-  _restoreTabs: function ss_restoreTabs(aData) {
+  _restoreTabs(aData) {
     let window = Services.wm.getMostRecentWindow("navigator:browser");
     for (let i = 0; i < aData.tabs.length; i++) {
       let tabData = JSON.parse(aData.tabs[i]);
       let activeSHEntry = tabData.entries[tabData.index - 1];
       let selected = (i == aData.tabs.length - 1);
       let delayLoad = !selected;
 
       let params = {
@@ -1334,17 +1334,17 @@ SessionStore.prototype = {
       }
     }
   },
 
   /**
   * Starts the restoration process for a browser. History is restored at this
   * point, but text data must be delayed until the content loads.
   */
-  _restoreTab: function ss_restoreTab(aTabData, aBrowser) {
+  _restoreTab(aTabData, aBrowser) {
     // aTabData shouldn't be empty here, but if it is,
     // _restoreHistory() will crash otherwise.
     if (!aTabData || aTabData.entries.length == 0) {
       Cu.reportError("SessionStore.js: Error trying to restore tab with empty tabdata");
       return;
     }
     this._restoreHistory(aBrowser.docShell, aTabData);
 
@@ -1361,79 +1361,79 @@ SessionStore.prototype = {
     aBrowser.__SS_restoreDataOnPageshow = true;
   },
 
   /**
   * A thin wrapper around SessionHistory.jsm's restore function, which
   * takes serialized history data and restores it into the given
   * nsISessionHistory object.
   */
-  _restoreHistory: function ss_restoreHistory(aDocShell, aTabData) {
+  _restoreHistory(aDocShell, aTabData) {
     let history = SessionHistory.restore(aDocShell, aTabData);
 
     // SessionHistory.jsm will have force set the active history item,
     // but we still need to reload it in order to finish the process.
     try {
       history.QueryInterface(Ci.nsISHistory).reloadCurrentEntry();
     } catch (e) {
       // This will throw if the current entry is an error page.
     }
   },
 
   /**
   * Takes serialized form text data and restores it into the given browser.
   */
-  _restoreTextData: function ss_restoreTextData(aFormData, aBrowser) {
+  _restoreTextData(aFormData, aBrowser) {
     if (aFormData) {
       log("_restoreTextData()");
       Utils.restoreFrameTreeData(aBrowser.contentWindow, aFormData, (frame, data) => {
         // restore() will return false, and thus abort restoration for the
         // current |frame| and its descendants, if |data.url| is given but
         // doesn't match the loaded document's URL.
         return FormData.restore(frame, data);
       });
     }
   },
 
   /**
    * Restores the zoom level of the window. This needs to be called before
    * first paint/load (whichever comes first) to take any effect.
    */
-  _restoreZoom: function ss_restoreZoom(aScrollData, aBrowser) {
+  _restoreZoom(aScrollData, aBrowser) {
     if (aScrollData && aScrollData.zoom && aScrollData.zoom.displaySize) {
       log("_restoreZoom(), resolution: " + aScrollData.zoom.resolution +
           ", old displayWidth: " + aScrollData.zoom.displaySize.width);
 
       let utils = aBrowser.contentWindow.windowUtils;
       // Restore zoom level.
       utils.setRestoreResolution(aScrollData.zoom.resolution,
                                  aScrollData.zoom.displaySize.width,
                                  aScrollData.zoom.displaySize.height);
     }
   },
 
   /**
   * Takes serialized scroll positions and restores them into the given browser.
   */
-  _restoreScrollPosition: function ss_restoreScrollPosition(aScrollData, aBrowser) {
+  _restoreScrollPosition(aScrollData, aBrowser) {
     if (aScrollData) {
       log("_restoreScrollPosition()");
       Utils.restoreFrameTreeData(aBrowser.contentWindow, aScrollData, (frame, data) => {
         if (data.scroll) {
           ssu.restoreScrollPosition(frame, data.scroll);
         }
       });
     }
   },
 
-  getBrowserState: function ss_getBrowserState() {
+  getBrowserState() {
     return this._getCurrentState();
   },
 
-  _restoreWindow: function ss_restoreWindow(aData) {
+  _restoreWindow(aData) {
     let state;
     try {
       state = JSON.parse(aData);
     } catch (e) {
       throw "Invalid session JSON: " + aData;
     }
 
     // To do a restore, we must have at least one window with one tab
@@ -1487,33 +1487,33 @@ SessionStore.prototype = {
 
     // Restore the closed tabs array on the current window.
     if (state.windows[0].closedTabs && this._maxTabsUndo > 0) {
       this._windows[window.__SSID].closedTabs = state.windows[0].closedTabs;
       log("_restoreWindow() loaded " + state.windows[0].closedTabs.length + " closed tabs");
     }
   },
 
-  getClosedTabCount: function ss_getClosedTabCount(aWindow) {
+  getClosedTabCount(aWindow) {
     if (!aWindow || !aWindow.__SSID || !this._windows[aWindow.__SSID]) {
       return 0; // not a browser window, or not otherwise tracked by SS.
     }
 
     return this._windows[aWindow.__SSID].closedTabs.length;
   },
 
-  getClosedTabs: function ss_getClosedTabs(aWindow) {
+  getClosedTabs(aWindow) {
     if (!aWindow.__SSID) {
       throw (Components.returnCode = Cr.NS_ERROR_INVALID_ARG);
     }
 
     return this._windows[aWindow.__SSID].closedTabs;
   },
 
-  undoCloseTab: function ss_undoCloseTab(aWindow, aCloseTabData) {
+  undoCloseTab(aWindow, aCloseTabData) {
     if (!aWindow.__SSID) {
       throw (Components.returnCode = Cr.NS_ERROR_INVALID_ARG);
     }
 
     let closedTabs = this._windows[aWindow.__SSID].closedTabs;
     if (!closedTabs) {
       return null;
     }
@@ -1572,17 +1572,17 @@ SessionStore.prototype = {
       this._sendClosedTabsToJava(aWindow);
     }
   },
 
   get canUndoLastCloseTab() {
     return this._lastClosedTabIndex > INVALID_TAB_INDEX;
   },
 
-  _sendClosedTabsToJava: function ss_sendClosedTabsToJava(aWindow) {
+  _sendClosedTabsToJava(aWindow) {
 
     // If the app is shutting down, we don't need to do anything.
     if (this._loadState <= STATE_QUITTING) {
       return;
     }
 
     if (!aWindow.__SSID) {
       throw (Components.returnCode = Cr.NS_ERROR_INVALID_ARG);
@@ -1605,32 +1605,32 @@ SessionStore.prototype = {
 
     log("sending " + tabs.length + " closed tabs to Java");
     EventDispatcher.instance.sendRequest({
       type: "ClosedTabs:Data",
       tabs: tabs,
     });
   },
 
-  getTabValue: function ss_getTabValue(aTab, aKey) {
+  getTabValue(aTab, aKey) {
     let browser = aTab.browser;
     let data = browser.__SS_extdata || {};
     return data[aKey] || "";
   },
 
-  setTabValue: function ss_setTabValue(aTab, aKey, aStringValue) {
+  setTabValue(aTab, aKey, aStringValue) {
     let browser = aTab.browser;
     if (!browser.__SS_extdata) {
       browser.__SS_extdata = {};
     }
     browser.__SS_extdata[aKey] = aStringValue;
     this.saveStateDelayed();
   },
 
-  deleteTabValue: function ss_deleteTabValue(aTab, aKey) {
+  deleteTabValue(aTab, aKey) {
     let browser = aTab.browser;
     if (browser.__SS_extdata && aKey in browser.__SS_extdata) {
       delete browser.__SS_extdata[aKey];
       this.saveStateDelayed();
     }
   },
 
   restoreLastSession(aSessionString) {
@@ -1641,32 +1641,32 @@ SessionStore.prototype = {
     } catch (e) {
       Cu.reportError("SessionStore: " + e);
       notifyMessage = "fail";
     }
 
     Services.obs.notifyObservers(null, "sessionstore-windows-restored", notifyMessage);
   },
 
-  removeWindow: function ss_removeWindow(aWindow) {
+  removeWindow(aWindow) {
     if (!aWindow || !aWindow.__SSID || !this._windows[aWindow.__SSID]) {
       return;
     }
 
     delete this._windows[aWindow.__SSID];
     delete aWindow.__SSID;
 
     if (this._loadState == STATE_RUNNING) {
       // Save the purged state immediately
       this.saveState();
     } else if (this._loadState <= STATE_QUITTING) {
       this.saveStateDelayed();
     }
   },
 
-  setLoadState: function ss_setLoadState(aState) {
+  setLoadState(aState) {
     this.flushPendingState();
     this._loadState = aState;
   },
 
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]);