Bug 458963 - persistTabAttribute isn't a no-op when the attribute has already been registered, r=dietrich
authorSimon Bünzli <zeniko@gmail.com>
Sat, 11 Oct 2008 22:39:38 +0330
changeset 20318 1b73194028238b3c68a5cc00cd7001cc859faec2
parent 20317 98f6214e28d0adf5cafba2ba58c7f5eec51c2d9e
child 20319 ac1e09aa72ab8ecae21b30567ef4c9a3daef64f1
push id2803
push userehsan.akhgari@gmail.com
push dateSat, 11 Oct 2008 19:22:40 +0000
treeherdermozilla-central@57a08a2acc51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich
bugs458963
milestone1.9.1b2pre
Bug 458963 - persistTabAttribute isn't a no-op when the attribute has already been registered, r=dietrich
browser/components/sessionstore/src/nsSessionStore.js
--- a/browser/components/sessionstore/src/nsSessionStore.js
+++ b/browser/components/sessionstore/src/nsSessionStore.js
@@ -882,16 +882,19 @@ SessionStoreService.prototype = {
     if (aTab.__SS_extdata[aKey])
       delete aTab.__SS_extdata[aKey];
     else
       Components.returnCode = Cr.NS_ERROR_INVALID_ARG;
   },
 
 
   persistTabAttribute: function sss_persistTabAttribute(aName) {
+    if (this.xulAttributes.indexOf(aName) != -1)
+      return; // this attribute is already being tracked
+    
     this.xulAttributes.push(aName);
     this.saveStateDelayed();
   },
 
 /* ........ Saving Functionality .............. */
 
   /**
    * Store all session data for a window