Chromium Code Reviews| 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..0c95c04b58c8d36d965cd9f76777b2330a817245 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. |
| + metrics::CallStackProfileParams::Thread thread_; |
|
sky
2016/09/21 22:06:16
const
Mike Wittman
2016/09/21 22:26:20
Done.
|
| + |
| // A profiler that periodically samples stack traces. Used to sample jank |
| // behavior. |
| std::unique_ptr<base::StackSamplingProfiler> sampling_profiler_; |