Chromium Code Reviews| Index: base/tracked_objects.h |
| diff --git a/base/tracked_objects.h b/base/tracked_objects.h |
| index b3aed63434e827b5bb46ac3046dd888536863e11..f429deb36cad51c08ab4f294264ba88ca71b395d 100644 |
| --- a/base/tracked_objects.h |
| +++ b/base/tracked_objects.h |
| @@ -622,6 +622,12 @@ class BASE_EXPORT ThreadData { |
| return sanitized_thread_name_; |
| } |
| + void EnableTaskDurationRecordingForUMA(); |
| + // Whether this thread records task lengths for UMA. |
| + bool task_length_recording_enabled_for_uma() const { |
| + return task_length_recording_enabled_for_uma_; |
| + }; |
| + |
| // Initializes all statics if needed (this initialization call should be made |
| // while we are single threaded). |
| static void EnsureTlsInitialization(); |
| @@ -646,6 +652,10 @@ class BASE_EXPORT ThreadData { |
| // the code). |
| static base::TimeTicks Now(); |
| + // If the provided thread is enabled for task duration tracking, returns the |
|
Sami
2017/07/26 20:36:38
nit: "UMA task duration tracking" (I had to re-rea
|
| + // current time. Otherwise, this is equivalent to Now(). |
| + static base::TimeTicks Now(const ThreadData* thread_data); |
| + |
| // This function can be called at process termination to validate that thread |
| // cleanup routines have been called for at least some number of named |
| // threads. |
| @@ -823,6 +833,8 @@ class BASE_EXPORT ThreadData { |
| // if it exists; NULL otherwise. |
| TaskStopwatch* current_stopwatch_; |
| + bool task_length_recording_enabled_for_uma_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ThreadData); |
| }; |