OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "core/inspector/WorkerInspectorController.h" | 31 #include "core/inspector/WorkerInspectorController.h" |
32 | 32 |
33 #include "core/InstrumentingAgents.h" | 33 #include "core/InstrumentingAgents.h" |
34 #include "core/inspector/InspectorInstrumentation.h" | 34 #include "core/inspector/InspectorInstrumentation.h" |
35 #include "core/inspector/InspectorLogAgent.h" | 35 #include "core/inspector/InspectorLogAgent.h" |
36 #include "core/inspector/WorkerThreadDebugger.h" | 36 #include "core/inspector/WorkerThreadDebugger.h" |
| 37 #include "core/inspector/protocol/Protocol.h" |
37 #include "core/workers/WorkerBackingThread.h" | 38 #include "core/workers/WorkerBackingThread.h" |
38 #include "core/workers/WorkerReportingProxy.h" | 39 #include "core/workers/WorkerReportingProxy.h" |
39 #include "core/workers/WorkerThread.h" | 40 #include "core/workers/WorkerThread.h" |
40 #include "platform/WebThreadSupportingGC.h" | 41 #include "platform/WebThreadSupportingGC.h" |
41 #include "platform/inspector_protocol/InspectorProtocol.h" | |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 WorkerInspectorController* WorkerInspectorController::create(WorkerThread* threa
d) | 45 WorkerInspectorController* WorkerInspectorController::create(WorkerThread* threa
d) |
46 { | 46 { |
47 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread->isolate(
)); | 47 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread->isolate(
)); |
48 return debugger ? new WorkerInspectorController(thread, debugger) : nullptr; | 48 return debugger ? new WorkerInspectorController(thread, debugger) : nullptr; |
49 } | 49 } |
50 | 50 |
51 WorkerInspectorController::WorkerInspectorController(WorkerThread* thread, Worke
rThreadDebugger* debugger) | 51 WorkerInspectorController::WorkerInspectorController(WorkerThread* thread, Worke
rThreadDebugger* debugger) |
(...skipping 25 matching lines...) Expand all Loading... |
77 return; | 77 return; |
78 m_session->dispose(); | 78 m_session->dispose(); |
79 m_session.clear(); | 79 m_session.clear(); |
80 m_thread->workerBackingThread().backingThread().removeTaskObserver(this); | 80 m_thread->workerBackingThread().backingThread().removeTaskObserver(this); |
81 } | 81 } |
82 | 82 |
83 void WorkerInspectorController::dispatchMessageFromFrontend(const String& messag
e) | 83 void WorkerInspectorController::dispatchMessageFromFrontend(const String& messag
e) |
84 { | 84 { |
85 if (!m_session) | 85 if (!m_session) |
86 return; | 86 return; |
87 protocol::String16 method; | 87 String method; |
88 if (!protocol::DispatcherBase::getCommandName(message, &method)) | 88 if (!protocol::DispatcherBase::getCommandName(message, &method)) |
89 return; | 89 return; |
90 m_session->dispatchProtocolMessage(method, message); | 90 m_session->dispatchProtocolMessage(method, message); |
91 } | 91 } |
92 | 92 |
93 void WorkerInspectorController::dispose() | 93 void WorkerInspectorController::dispose() |
94 { | 94 { |
95 disconnectFrontend(); | 95 disconnectFrontend(); |
96 m_thread = nullptr; | 96 m_thread = nullptr; |
97 } | 97 } |
(...skipping 20 matching lines...) Expand all Loading... |
118 m_session->flushProtocolNotifications(); | 118 m_session->flushProtocolNotifications(); |
119 } | 119 } |
120 | 120 |
121 DEFINE_TRACE(WorkerInspectorController) | 121 DEFINE_TRACE(WorkerInspectorController) |
122 { | 122 { |
123 visitor->trace(m_instrumentingAgents); | 123 visitor->trace(m_instrumentingAgents); |
124 visitor->trace(m_session); | 124 visitor->trace(m_session); |
125 } | 125 } |
126 | 126 |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |