Bug 518958 - Only sync tabs if there has been tab activity
authorEdward Lee <edilee@mozilla.com>
Fri, 25 Sep 2009 16:14:26 -0700
changeset 45782 e5836deaeacabef9d9f0f03d64a00f50698921d9
parent 45781 785d2be209b54dd1e49f9207294fbe1f37d42cde
child 45783 326adbfb1780679c0060fe980a6c6ed934dc774d
push idunknown
push userunknown
push dateunknown
bugs518958
Bug 518958 - Only sync tabs if there has been tab activity Check the score, which gets bumped up on tab open/close/select, to decide if tabs should be marked as changed.
services/sync/modules/engines/tabs.js
--- a/services/sync/modules/engines/tabs.js
+++ b/services/sync/modules/engines/tabs.js
@@ -440,25 +440,15 @@ TabTracker.prototype = {
     //this._log.trace("Tab selected.\n");
     event.target.setAttribute(TAB_TIME_ATTR, event.timeStamp);
     //this._log.debug("Tab timestamp set to " + event.target.getAttribute(TAB_TIME_ATTR) + "\n");
     this._score += 10;
   },
   // TODO: Also listen for tabs loading new content?
 
   get changedIDs() {
-    // The record for my own client is always the only changed record.
+    // Only mark the current client as changed if we tracked changes
     let obj = {};
-    obj[Clients.clientID] = true;
+    if (this._score > 0)
+      obj[Clients.clientID] = true;
     return obj;
-  },
-
-  /* Score is pegged to 100, which means tabs are always synced.
-   * Is this the right thing to do?  Or should we be using the score
-   * calculated from tab open/close/select events (see above)?  Note that
-   * we should definitely listen for tabs loading new content if we want to
-   * go that way.  But tabs loading new content happens so often that it
-   * might be easier to just always sync.
-   */
-  get score() {
-    return 100;
   }
 }