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

Side by Side Diff: Source/core/workers/WorkerInspectorProxy.cpp

Issue 552323002: DevTools: log worker thread ids on the main thread when Timeline recording is enabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 gStartedInWorker", "data", InspectorTracingStartedInWorkerEvent::data(sessionId, m_workerThread));
loislo 2014/09/09 13:59:44 I think with this schema the event should have dif
yurys 2014/09/09 14:46:34 Done. Renamed to TracingSessionIdForWorker
99 } 95 }
100 96
101 } // namespace blink 97 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698