Bug 644424 - Reduce the remote tabs refresh delay and add a pref for it [r=mbrubeck]
authorVivien Nicolas <21@vingtetun.org>
Fri, 25 Mar 2011 18:41:44 +0100
changeset 2943 3f8519dfd4c69b4b94da34ce99304ac6e267e319
parent 2942 c358e083b0ad1424bad1f17320c3b964cab569f3
child 2944 3fc28e63d911caf64a00470013ec68c897847684
push id2481
push uservnicolas@mozilla.com
push dateFri, 25 Mar 2011 17:43:45 +0000
reviewersmbrubeck
bugs644424
Bug 644424 - Reduce the remote tabs refresh delay and add a pref for it [r=mbrubeck]
app/mobile.js
chrome/content/bindings.xml
--- a/app/mobile.js
+++ b/app/mobile.js
@@ -126,16 +126,19 @@ pref("network.autodial-helper.enabled", 
 
 // See bug 545869 for details on why these are set the way they are
 pref("network.buffer.cache.count", 24);
 pref("network.buffer.cache.size",  16384);
 
 /* history max results display */
 pref("browser.display.history.maxresults", 100);
 
+/* How many times should have passed before the remote tabs list is refreshed */
+pref("browser.display.remotetabs.timeout", 10);
+
 /* session history */
 pref("browser.sessionhistory.max_total_viewers", 1);
 pref("browser.sessionhistory.max_entries", 50);
 pref("browser.sessionhistory.optimize_eviction", true);
 
 /* session store */
 pref("browser.sessionstore.resume_session_once", false);
 pref("browser.sessionstore.resume_from_crash", true);
--- a/chrome/content/bindings.xml
+++ b/chrome/content/bindings.xml
@@ -1379,17 +1379,17 @@
           // Don't do anything if the tabs engine isn't ready
           let engine = Weave.Engines.get("tabs");
           if (!engine)
             return [];
 
           // Don't bother refetching tabs if we already did so recently
           let lastFetch = Weave.Svc.Prefs.get("lastTabFetch", 0);
           let now = Math.floor(Date.now() / 1000);
-          if (now - lastFetch >= 30) {
+          if (now - lastFetch >= Services.prefs.getIntPref("browser.display.remotabs.timeout")) {
             // Force a sync only for the tabs engine
             engine.lastModified = null;
             engine.sync();
             Weave.Svc.Prefs.set("lastTabFetch", now);
           };
 
           // Generate the list of tabs
           let tabs = [];