[tor-commits] [torbutton/master] Bug 4718: Make versioncheck happen on each new window+New Identity

mikeperry at torproject.org mikeperry at torproject.org
Thu May 24 19:23:31 UTC 2012


commit b86512f49378bd01d1c8f0e60033401e193235bd
Author: Mike Perry <mikeperry-git at fscked.org>
Date:   Thu May 24 10:37:28 2012 -0700

    Bug 4718: Make versioncheck happen on each new window+New Identity
    
    We were already pinging check in these cases for the update notice. Might as
    well actually perform a versioncheck then, too.
    
    Also, Roger didn't like the additional TCP connection and dirfetch overhead at
    guards caused by a purely clock-based version check that happened even when
    the browser was not in use.
---
 src/chrome/content/torbutton.js       |    3 ++-
 src/components/cookie-jar-selector.js |   22 ----------------------
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 55b2379..c0c7006 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -4237,7 +4237,8 @@ function torbutton_new_window(event)
 
     torbutton_set_window_size(browser.contentWindow);
 
-    //window.addEventListener("resize", torbutton_do_resize, true);
+    // Check the version on every new window. We're already pinging check in these cases.    
+    torbutton_do_async_versioncheck();
 }
 
 function torbutton_close_window(event) {
diff --git a/src/components/cookie-jar-selector.js b/src/components/cookie-jar-selector.js
index 51e4645..e26493f 100644
--- a/src/components/cookie-jar-selector.js
+++ b/src/components/cookie-jar-selector.js
@@ -494,7 +494,6 @@ function CookieJarSelector() {
   var jarThis = this;
   this.timerCallback = {
     cookie_changed: false,
-    update_counter: 0,
 
     QueryInterface: function(iid) {
        if (!iid.equals(Component.interfaces.nsISupports) &&
@@ -505,27 +504,6 @@ function CookieJarSelector() {
        return this;
     },
     notify: function() {
-       // XXX: ========== WARNING! Ultra-mega hack: ===============
-       // For various reasons, we want to totally refactor Torbutton.
-       // (see #5709). Since there's no great place to place this timer,
-       // I figured we might as well place it here.
-       //
-       // Additionally, mobile should verify that nsITimer.TYPE_REPEATING_SLACK
-       // is smart wrt suspend.
-       //
-       // We want to perform an update check *about* twice per day.
-       // I thought about randomizing it, but the slack will probably
-       // introduce enough noise over the course of 12 hours or so...
-       // Might as well KISS.
-       if (++this.update_counter > 720) {
-           jarThis.logger.log(3, "Performing async version check");
-           this.update_counter = 0;
-           var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
-               .getService(Components.interfaces.nsIWindowMediator);
-           var chrome = wm.getMostRecentWindow("navigator:browser");
-           chrome.torbutton_do_async_versioncheck();
-       }
-
        // this refers to timerCallback object. use jarThis to reference
        // CookieJarSelector object.
        if(!this.cookie_changed) {





More information about the tor-commits mailing list