OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "core/workers/WorkerInspectorProxy.h" | 7 #include "core/workers/WorkerInspectorProxy.h" |
8 | 8 |
9 #include "core/dom/CrossThreadTask.h" | 9 #include "core/dom/CrossThreadTask.h" |
10 #include "core/inspector/InspectorInstrumentation.h" | 10 #include "core/inspector/InspectorInstrumentation.h" |
| 11 #include "core/inspector/InspectorTraceEvents.h" |
11 #include "core/inspector/WorkerInspectorController.h" | 12 #include "core/inspector/WorkerInspectorController.h" |
12 #include "core/workers/WorkerThread.h" | 13 #include "core/workers/WorkerThread.h" |
13 #include "platform/TraceEvent.h" | 14 #include "platform/TraceEvent.h" |
14 #include "platform/weborigin/KURL.h" | 15 #include "platform/weborigin/KURL.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
18 WorkerInspectorProxy::WorkerInspectorProxy() | 19 WorkerInspectorProxy::WorkerInspectorProxy() |
19 : m_workerThread(0) | 20 : m_workerThread(0) |
20 , m_executionContext(0) | 21 , m_executionContext(0) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 80 } |
80 | 81 |
81 void WorkerInspectorProxy::sendMessageToInspector(const String& message) | 82 void WorkerInspectorProxy::sendMessageToInspector(const String& message) |
82 { | 83 { |
83 if (!m_workerThread) | 84 if (!m_workerThread) |
84 return; | 85 return; |
85 m_workerThread->postDebuggerTask(createCrossThreadTask(dispatchOnInspectorBa
ckendTask, String(message))); | 86 m_workerThread->postDebuggerTask(createCrossThreadTask(dispatchOnInspectorBa
ckendTask, String(message))); |
86 m_workerThread->interruptAndDispatchInspectorCommands(); | 87 m_workerThread->interruptAndDispatchInspectorCommands(); |
87 } | 88 } |
88 | 89 |
89 static void dispatchWriteTimelineStartedEvent(ExecutionContext* context, const S
tring& sessionId) | |
90 { | |
91 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Tracin
gStartedInWorker", "sessionId", sessionId.utf8()); | |
92 } | |
93 | |
94 void WorkerInspectorProxy::writeTimelineStartedEvent(const String& sessionId) | 90 void WorkerInspectorProxy::writeTimelineStartedEvent(const String& sessionId) |
95 { | 91 { |
96 if (!m_workerThread) | 92 if (!m_workerThread) |
97 return; | 93 return; |
98 m_workerThread->postTask(createCrossThreadTask(dispatchWriteTimelineStartedE
vent, String(sessionId))); | 94 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Tracin
gSessionIdForWorker", "data", InspectorTracingSessionIdForWorkerEvent::data(sess
ionId, m_workerThread)); |
99 } | 95 } |
100 | 96 |
101 } // namespace blink | 97 } // namespace blink |
OLD | NEW |