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

Unified Diff: base/tracked_objects.h

Issue 2973543002: Record task durations on Renderer Main & Compositor threads.
Patch Set: Fix layering issues. Created 3 years, 5 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
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);
};

Powered by Google App Engine
This is Rietveld 408576698