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

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

Issue 2299163003: [Merge to 55.0.2846.2] Revert of Fix memory leak in ThreadWatcher. (patchset #3 id:40001 of https:/… (Closed)
Patch Set: Created 4 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 | 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 a2ecc674589202a7f03bf8603055bbbd664abe1f..a92bae0aca8f86bd398ae56aea8c6bff6050312b 100644
--- a/chrome/browser/metrics/thread_watcher.h
+++ b/chrome/browser/metrics/thread_watcher.h
@@ -102,8 +102,6 @@ class ThreadWatcher {
live_threads_threshold(live_threads_threshold_in) {}
};
- virtual ~ThreadWatcher();
-
// This method starts performing health check on the given |thread_id|. It
// will create ThreadWatcher object for the given |thread_id|, |thread_name|.
// |sleep_time| is the wait time between ping messages. |unresponsive_time| is
@@ -146,6 +144,8 @@ class ThreadWatcher {
// ping message is sent, to check if we have received pong message or not.
explicit ThreadWatcher(const WatchingParams& params);
+ virtual ~ThreadWatcher();
+
// This method activates the thread watching which starts ping/pong messaging.
virtual void ActivateThreadWatching();
@@ -394,8 +394,10 @@ class ThreadWatcherList {
static void StopWatchingAll();
// Register() stores a pointer to the given ThreadWatcher in a global map.
- // Returns true if it was successfully registered.
- static bool Register(std::unique_ptr<ThreadWatcher> watcher);
+ static void Register(ThreadWatcher* watcher);
+
+ // This method returns true if the ThreadWatcher object is registerd.
+ static bool IsRegistered(const content::BrowserThread::ID thread_id);
// This method returns number of responsive and unresponsive watched threads.
static void GetStatusOfThreads(uint32_t* responding_thread_count,
« 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