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

Unified Diff: third_party/WebKit/public/platform/WebThread.h

Issue 2259013003: Move and rename TaskTimeTracker to public interface exposed to WebThread, use in WebPerf Agent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update missed SetTaskTimeObserver in blink_platform_perftests Created 4 years, 4 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: third_party/WebKit/public/platform/WebThread.h
diff --git a/third_party/WebKit/public/platform/WebThread.h b/third_party/WebKit/public/platform/WebThread.h
index c9a45b6f57ed9ab753eaf8769be1054f4526a3ff..a3da25d1d1b27689c115f1e142677b259ce4a71e 100644
--- a/third_party/WebKit/public/platform/WebThread.h
+++ b/third_party/WebKit/public/platform/WebThread.h
@@ -26,9 +26,14 @@
#define WebThread_h
#include "WebCommon.h"
+
#include <stdint.h>
namespace blink {
+namespace scheduler {
+class TaskTimeObserver;
+}
+
class WebScheduler;
class WebTaskRunner;
@@ -63,9 +68,19 @@ public:
virtual bool isCurrentThread() const = 0;
virtual PlatformThreadId threadId() const { return 0; }
+ // TaskObserver is an object that receives task notifications from the MessageLoop
+ // NOTE: TaskObserver implementation should be extremely fast!
+ // This API is performance sensitive. Use only if you have a compelling reason.
virtual void addTaskObserver(TaskObserver*) { }
virtual void removeTaskObserver(TaskObserver*) { }
+ // TaskTimeObserver is an object that receives notifications for
pfeldman 2016/08/29 17:23:08 Should we instead set the observer to prevent the
panicker 2016/08/29 17:46:23 Sorry, could you elaborate on what you mean by "se
pfeldman 2016/08/29 17:52:54 You are saying here that I need to have a compelli
panicker 2016/08/29 18:01:32 Reflector will also need this imminently as Messag
pfeldman 2016/08/29 18:04:27 Ok, I must say I am not a fan of it (I'd prefer si
+ // CPU time spent in each top-level MessageLoop task.
+ // NOTE: TaskTimeObserver implementation should be extremely fast!
+ // This API is performance sensitive. Use only if you have a compelling reason.
+ virtual void addTaskTimeObserver(scheduler::TaskTimeObserver*) {}
+ virtual void removeTaskTimeObserver(scheduler::TaskTimeObserver*) {}
+
// Returns the scheduler associated with the thread.
virtual WebScheduler* scheduler() const = 0;

Powered by Google App Engine
This is Rietveld 408576698