summaryrefslogtreecommitdiffstats
path: root/chrome/browser/upgrade_detector.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-18 10:56:48 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-18 10:56:48 +0000
commit96f249f0e3ddde67a407b5b0dc7eb0e17376adea (patch)
tree3364650078677000071094c35cce2fbeb0bd8bb2 /chrome/browser/upgrade_detector.cc
parent67700a92e622aebd70e72b8dbe4cee4efdf9878a (diff)
downloadchromium_src-96f249f0e3ddde67a407b5b0dc7eb0e17376adea.zip
chromium_src-96f249f0e3ddde67a407b5b0dc7eb0e17376adea.tar.gz
chromium_src-96f249f0e3ddde67a407b5b0dc7eb0e17376adea.tar.bz2
Add a command line switch to allow testers to test the upgrade detection
without having to wait 24 hrs. BUG=None TEST=To check every 10 seconds, use: --check-for-update-interval=10 Review URL: http://codereview.chromium.org/3419004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/upgrade_detector.cc')
-rw-r--r--chrome/browser/upgrade_detector.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/upgrade_detector.cc b/chrome/browser/upgrade_detector.cc
index ae21a23..0dde1e9 100644
--- a/chrome/browser/upgrade_detector.cc
+++ b/chrome/browser/upgrade_detector.cc
@@ -10,6 +10,7 @@
#include "base/scoped_ptr.h"
#include "base/time.h"
#include "base/task.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/chrome_thread.h"
@@ -146,8 +147,15 @@ UpgradeDetector::UpgradeDetector()
if (keystone_glue::KeystoneEnabled())
#endif
{
+ int interval_ms = kCheckForUpgradeEveryMs;
+ const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
+ std::string interval =
+ cmd_line.GetSwitchValueASCII(switches::kCheckForUpdateIntervalSec);
+ if (!interval.empty() && base::StringToInt(interval, &interval_ms))
+ interval_ms *= 1000; // Command line value is in seconds.
+
detect_upgrade_timer_.Start(
- base::TimeDelta::FromMilliseconds(kCheckForUpgradeEveryMs),
+ base::TimeDelta::FromMilliseconds(interval_ms),
this, &UpgradeDetector::CheckForUpgrade);
}
#endif