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

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

Issue 188653003: ThreadWatcher: fixes Start/StopWatchingAll. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes TSan Created 6 years, 9 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 | chrome/browser/metrics/thread_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/thread_watcher.h
diff --git a/chrome/browser/metrics/thread_watcher.h b/chrome/browser/metrics/thread_watcher.h
index 2c4b027dcf609e48366401e5795571296e376ffa..7d817f858976640ef550aad04bc6c49e555e2d17 100644
--- a/chrome/browser/metrics/thread_watcher.h
+++ b/chrome/browser/metrics/thread_watcher.h
@@ -406,10 +406,12 @@ class ThreadWatcherList {
private:
// Allow tests to access our innards for testing purposes.
friend class CustomThreadWatcher;
+ friend class ThreadWatcherListTest;
friend class ThreadWatcherTest;
FRIEND_TEST_ALL_PREFIXES(ThreadWatcherTest, ThreadNamesOnlyArgs);
FRIEND_TEST_ALL_PREFIXES(ThreadWatcherTest, ThreadNamesAndLiveThresholdArgs);
FRIEND_TEST_ALL_PREFIXES(ThreadWatcherTest, CrashOnHangThreadsAllArgs);
+ FRIEND_TEST_ALL_PREFIXES(ThreadWatcherListTest, Restart);
ramant (doing other things) 2014/03/07 22:56:41 nit: please consider moving line 414 to before lin
bulach 2014/03/10 12:13:21 Done.
FRIEND_TEST_ALL_PREFIXES(ThreadWatcherAndroidTest,
ramant (doing other things) 2014/03/07 22:56:41 nit: please consider moving lines 415-416 to after
bulach 2014/03/10 12:13:21 Done.
ApplicationStatusNotification);
@@ -464,10 +466,19 @@ class ThreadWatcherList {
// already registered, or to retrieve a pointer to it from the global map.
static ThreadWatcher* Find(const content::BrowserThread::ID& thread_id);
+ // Sets |g_stopped_| on the WatchDogThread. This is necessary to reflect the
+ // state between the delayed |StartWatchingAll| and the immediate
+ // |StopWatchingAll|.
+ static void SetStopped(bool stopped);
+
// The singleton of this class and is used to keep track of information about
// threads that are being watched.
static ThreadWatcherList* g_thread_watcher_list_;
+ // StartWatchingAll() is delayed in relation to StopWatchingAll(), so if
+ // a Stop comes first, prevent further initialization.
+ static bool g_stopped_;
+
// This is the wait time between ping messages.
static const int kSleepSeconds;
« no previous file with comments | « no previous file | chrome/browser/metrics/thread_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698