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

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

Issue 2362493002: Stack sampling profiler: set process and thread information (Closed)
Patch Set: address comments 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 | « chrome/browser/chrome_content_browser_client.cc ('k') | 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 ae4d90cd26fe1cb2cac685740aa479bf22061c1f..4c0d414ab0b7d2cea91498500ba2042bec4c667a 100644
--- a/chrome/browser/metrics/thread_watcher.h
+++ b/chrome/browser/metrics/thread_watcher.h
@@ -62,6 +62,7 @@
#include "base/threading/thread.h"
#include "base/threading/watchdog.h"
#include "base/time/time.h"
+#include "components/metrics/call_stack_profile_params.h"
#include "components/omnibox/browser/omnibox_event_global_tracker.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
@@ -646,8 +647,10 @@ class JankTimeBomb {
public:
// This is instantiated when the jank needs to be detected in a method. Posts
// an Alarm callback task on WatchDogThread with |duration| as the delay. This
- // can be called on any thread.
- explicit JankTimeBomb(base::TimeDelta duration);
+ // can be called on any thread, but the thread's identity should be provided
+ // in |thread|.
+ JankTimeBomb(base::TimeDelta duration,
+ metrics::CallStackProfileParams::Thread thread);
virtual ~JankTimeBomb();
// Returns true if JankTimeBomb is enabled.
@@ -659,6 +662,9 @@ class JankTimeBomb {
virtual void Alarm(base::PlatformThreadId thread_id);
private:
+ // The thread that instantiated this object.
+ const metrics::CallStackProfileParams::Thread thread_;
+
// A profiler that periodically samples stack traces. Used to sample jank
// behavior.
std::unique_ptr<base::StackSamplingProfiler> sampling_profiler_;
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/metrics/thread_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698