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

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,11 +423,14 @@
// 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.
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+ if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
jar (doing other things) 2011/09/10 19:20:31 I agree. This addition makes the code less fragile
+ channel == chrome::VersionInfo::CHANNEL_BETA) {
+ // Increase the unresponsive_threshold in Stable and Beta channels to
+ // reduce the number of crashes due to ThreadWatcher.
*unresponsive_threshold *= 2;
Mark Mentovai 2011/09/10 18:50:38 I couldn’t figure out why you would want to do thi
- } else {
+ } else if (channel == chrome::VersionInfo::CHANNEL_DEV ||
+ channel == chrome::VersionInfo::CHANNEL_CANARY) {
// 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
@@ -452,7 +455,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";
@@ -734,7 +737,7 @@
} else if (channel == chrome::VersionInfo::CHANNEL_BETA ||
channel == chrome::VersionInfo::CHANNEL_DEV) {
actual_duration *= 25;
- } else {
+ } else if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
// In Canary, for Windows XP, give twice the time for shutdown.
#if defined(OS_WIN)
if (base::win::GetVersion() <= base::win::VERSION_XP)
« 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