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

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

Issue 622683002: ThreadWatcher - Disarm the StartupTimeBomb, if we haven't started (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_disk_cache
Patch Set: Created 6 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
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc
index b4f54b8eb1442941950f4e1401187b3e65373f16..5badf2b6bbd2f87909e2d941cfb5f6059c39a8ee 100644
--- a/chrome/browser/metrics/thread_watcher.cc
+++ b/chrome/browser/metrics/thread_watcher.cc
@@ -439,7 +439,7 @@ ThreadWatcherList::CrashDataThresholds::CrashDataThresholds()
// static
void ThreadWatcherList::StartWatchingAll(const CommandLine& command_line) {
- // TODO(rtenneti): Enable ThreadWatcher.
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
uint32 unresponsive_threshold;
CrashOnHangThreadMap crash_on_hang_threads;
ParseCommandLine(command_line,
@@ -453,12 +453,16 @@ void ThreadWatcherList::StartWatchingAll(const CommandLine& command_line) {
FROM_HERE,
base::Bind(&ThreadWatcherList::SetStopped, false));
- WatchDogThread::PostDelayedTask(
- FROM_HERE,
- base::Bind(&ThreadWatcherList::InitializeAndStartWatching,
- unresponsive_threshold,
- crash_on_hang_threads),
- base::TimeDelta::FromSeconds(g_initialize_delay_seconds));
+ if (!WatchDogThread::PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ThreadWatcherList::InitializeAndStartWatching,
+ unresponsive_threshold,
+ crash_on_hang_threads),
+ base::TimeDelta::FromSeconds(g_initialize_delay_seconds))) {
+ // Disarm() the startup timebomb, if we couldn't post the task to start the
+ // ThreadWatcher (becasue WatchDog thread is not running).
+ StartupTimeBomb::DisarmStartupTimeBomb();
+ }
}
// static
« 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