Index: Source/platform/scheduler/TracedTask.cpp |
diff --git a/Source/platform/scheduler/TracedTask.cpp b/Source/platform/scheduler/TracedTask.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7bf70b5cb95f661ea6d114282c11ab69777dc7cc |
--- /dev/null |
+++ b/Source/platform/scheduler/TracedTask.cpp |
@@ -0,0 +1,35 @@ |
+// 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. |
+ |
+#include "config.h" |
+#include "platform/scheduler/TracedTask.h" |
+ |
+#include "platform/TraceEvent.h" |
+ |
+namespace blink { |
+ |
+void TracedTask::run() const |
+{ |
+ TRACE_EVENT_FLOW_END0("blink", m_name, TRACE_ID_MANGLE(m_FlowTraceID)); |
+ |
+ TRACE_EVENT2("blink", m_name, |
+ "src_file", m_location.fileName(), |
+ "src_func", m_location.functionName()); |
+ |
+ m_task(); |
+} |
+ |
+TracedTask::TracedTask(const Task& task, const TraceLocation& location, const char* name, int flowTraceID) |
+ : m_FlowTraceID(flowTraceID) |
+ , m_task(task) |
+ , m_location(location) |
+ , m_name(name) |
+{ |
+ TRACE_EVENT_FLOW_BEGIN2("blink", m_name, TRACE_ID_MANGLE(m_FlowTraceID), |
+ "src_file", m_location.fileName(), |
+ "src_func", m_location.functionName()); |
+} |
+ |
+ |
+} // namespace blink |