diff options
-rw-r--r-- | chrome/browser/upgrade_detector.cc | 10 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 |
3 files changed, 14 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 diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 752736b..5a609ac 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -94,6 +94,10 @@ const char kBrowserCrashTest[] = "crash-test"; // Path to the exe to run for the renderer and plugin subprocesses. const char kBrowserSubprocessPath[] = "browser-subprocess-path"; +// How often (in seconds) to check for updates. Should only be used for +// testing purposes. +const char kCheckForUpdateIntervalSec[] = "check-for-update-interval"; + // Run Chrome in Chrome Frame mode. This means that Chrome expects to be run // as a dependent process of the Chrome Frame plugin. const char kChromeFrame[] = "chrome-frame"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 6f61dfc..984e2d8 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -41,6 +41,7 @@ extern const char kBlockNonSandboxedPlugins[]; extern const char kBrowserAssertTest[]; extern const char kBrowserCrashTest[]; extern const char kBrowserSubprocessPath[]; +extern const char kCheckForUpdateIntervalSec[]; extern const char kChromeFrame[]; extern const char kCloudPrintProxyId[]; extern const char kCloudPrintServiceURL[]; |