Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1657)

Unified Diff: chrome/browser/metrics/thread_watcher.cc

Issue 7780022: Fix GetChannel interface misuse in ThreadWatcher and ShutdownWatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/thread_watcher.cc
===================================================================
--- chrome/browser/metrics/thread_watcher.cc (revision 100589)
+++ chrome/browser/metrics/thread_watcher.cc (working copy)
@@ -423,20 +423,22 @@
// Determine |unresponsive_threshold| based on switches::kCrashOnHangSeconds.
*unresponsive_threshold = kUnresponsiveCount;
- if (chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_BETA) {
- // Increase the unresponsive_threshold in Beta channel to reduce the number
- // of crashes due to ThreadWatcher.
+ // Increase the unresponsive_threshold on the Stable and Beta channels to
+ // reduce the number of crashes due to ThreadWatcher.
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+ if (channel == chrome::VersionInfo::CHANNEL_STABLE) {
+ *unresponsive_threshold *= 4;
+ } else if (channel == chrome::VersionInfo::CHANNEL_BETA) {
*unresponsive_threshold *= 2;
- } else {
- // In Canary and Dev channels, for Windows XP (old systems), double the
- // unresponsive_threshold to give OS a chance to schedule UI/IO threads a
- // time slice to respond with a pong message (to get around limitations with
- // the OS).
+ }
+
#if defined(OS_WIN)
- if (base::win::GetVersion() <= base::win::VERSION_XP)
- *unresponsive_threshold *= 2;
+ // For Windows XP (old systems), double the unresponsive_threshold to give
+ // the OS a chance to schedule UI/IO threads a time slice to respond with a
+ // pong message (to get around limitations with the OS).
+ if (base::win::GetVersion() <= base::win::VERSION_XP)
+ *unresponsive_threshold *= 2;
#endif
- }
std::string crash_on_hang_seconds =
command_line.GetSwitchValueASCII(switches::kCrashOnHangSeconds);
@@ -452,7 +454,7 @@
// Default to crashing the browser if UI or IO threads are not responsive
// except in stable channel.
- if (chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_STABLE)
+ if (channel == chrome::VersionInfo::CHANNEL_STABLE)
crash_on_hang_threads = "";
else
crash_on_hang_threads = "UI,IO";
@@ -728,19 +730,21 @@
void ShutdownWatcherHelper::Arm(const base::TimeDelta& duration) {
DCHECK(!shutdown_watchdog_);
base::TimeDelta actual_duration = duration;
+
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
if (channel == chrome::VersionInfo::CHANNEL_STABLE) {
actual_duration *= 50;
} else if (channel == chrome::VersionInfo::CHANNEL_BETA ||
channel == chrome::VersionInfo::CHANNEL_DEV) {
actual_duration *= 25;
- } else {
- // In Canary, for Windows XP, give twice the time for shutdown.
+ }
+
#if defined(OS_WIN)
- if (base::win::GetVersion() <= base::win::VERSION_XP)
- actual_duration *= 2;
+ // On Windows XP, give twice the time for shutdown.
+ if (base::win::GetVersion() <= base::win::VERSION_XP)
+ actual_duration *= 2;
#endif
- }
+
shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration);
shutdown_watchdog_->Arm();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698