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

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: Merge with master and disable mangle Created 6 years, 3 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
« no previous file with comments | « Source/platform/scheduler/Scheduler.cpp ('k') | Source/platform/scheduler/TracedTask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..87f18beec58d5ffefd0d73a249b2ac30771980f6
--- /dev/null
+++ b/Source/platform/scheduler/TracedTask.h
@@ -0,0 +1,43 @@
+// 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/TraceEvent.h"
+#include "platform/TraceLocation.h"
+
+namespace blink {
+
+#ifdef MANGLE_COMPILES_ON_WIN_OK
+// TODO: Once win version compiles correctly when using TRACE_ID_MANGLE remove
+// the ifdef to always mangle
+#define MANGLE(id) TRACE_ID_MANGLE(id)
+#else
+#define MANGLE(id) (id)
+#endif
+
+class TracedTask {
+public:
+ typedef Function<void()> Task;
+
+ void run() const;
+
+private:
+ friend class Scheduler;
+ TracedTask(const Task&, const TraceLocation&, const char* traceName);
+
+ // Declared volatile as it is atomically incremented.
+ static volatile int s_nextFlowTraceID;
+
+ uint64_t m_flowTraceID;
+ Task m_task;
+ TraceLocation m_location;
+ const char* m_traceName;
+};
+
+} // namespace blink
+
+#endif // TracedTask_h
« no previous file with comments | « Source/platform/scheduler/Scheduler.cpp ('k') | Source/platform/scheduler/TracedTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698