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

Unified Diff: Source/platform/scheduler/TracedTask.h

Issue 490913002: Adding flow traces for blink scheduler events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Straggling uin64 turned into an int Created 6 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: Source/platform/scheduler/TracedTask.h
diff --git a/Source/platform/scheduler/TracedTask.h b/Source/platform/scheduler/TracedTask.h
new file mode 100644
index 0000000000000000000000000000000000000000..cd6c9ae0880824717999d281dafbb4bea17e9de2
--- /dev/null
+++ b/Source/platform/scheduler/TracedTask.h
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TracedTask_h
+#define TracedTask_h
+
+#include "platform/Task.h"
+#include "platform/TraceLocation.h"
+
+namespace blink {
+
+class Scheduler;
+
+class TracedTask {
+public:
+ typedef Function<void()> Task;
+
+ void run() const;
+
+private:
+
+ // Constructor is private, with scheduler as a friend, to keep this
+ // class hidden to everyone apart from the scheduler.
Sami 2014/08/29 14:50:25 This is a fairly common pattern in Blink so I don'
picksi1 2014/09/01 11:06:51 Done.
+ friend Scheduler;
Sami 2014/08/29 14:50:25 nit: People tend to write "friend class Scheduler"
picksi1 2014/09/01 11:06:51 Done.
+ TracedTask(const Task&, const TraceLocation&, const char*, int);
Sami 2014/08/29 14:50:25 Both const char* and int should have a name here.
picksi1 2014/09/01 11:06:51 I'm keen to encapsulate the fact that a task ID en
+
+ unsigned long long m_FlowTraceID;
Sami 2014/08/29 14:50:25 Lower caps for members: m_flowTraceID This should
picksi1 2014/09/01 11:06:51 Done.
+ Task m_task;
+ TraceLocation m_location;
+ const char * m_name;
Sami 2014/08/29 14:50:25 No space before "*".
picksi1 2014/09/01 11:06:51 Done.
+
+};
+
+} // namespace blink
+
+#endif // TracedTask_h

Powered by Google App Engine
This is Rietveld 408576698