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 20 matching lines...) Expand all Loading... |
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/InspectorConsoleAgent.h" | 34 #include "core/inspector/InspectorConsoleAgent.h" |
35 #include "core/inspector/InspectorInstrumentation.h" | 35 #include "core/inspector/InspectorInstrumentation.h" |
36 #include "core/inspector/WorkerConsoleAgent.h" | 36 #include "core/inspector/WorkerConsoleAgent.h" |
37 #include "core/inspector/WorkerThreadDebugger.h" | 37 #include "core/inspector/WorkerThreadDebugger.h" |
38 #include "core/workers/WorkerGlobalScope.h" | 38 #include "core/workers/WorkerGlobalScope.h" |
39 #include "core/workers/WorkerReportingProxy.h" | 39 #include "core/workers/WorkerReportingProxy.h" |
40 #include "core/workers/WorkerThread.h" | 40 #include "core/workers/WorkerThread.h" |
41 #include "platform/inspector_protocol/Dispatcher.h" | 41 #include "platform/inspector_protocol/DispatcherBase.h" |
42 #include "platform/inspector_protocol/Frontend.h" | |
43 #include "platform/v8_inspector/public/V8Debugger.h" | 42 #include "platform/v8_inspector/public/V8Debugger.h" |
44 #include "platform/v8_inspector/public/V8InspectorSession.h" | 43 #include "platform/v8_inspector/public/V8InspectorSession.h" |
45 #include "wtf/PassOwnPtr.h" | 44 #include "wtf/PassOwnPtr.h" |
46 | 45 |
47 namespace blink { | 46 namespace blink { |
48 | 47 |
49 WorkerInspectorController* WorkerInspectorController::create(WorkerGlobalScope*
workerGlobalScope) | 48 WorkerInspectorController* WorkerInspectorController::create(WorkerGlobalScope*
workerGlobalScope) |
50 { | 49 { |
51 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(workerGlobalScop
e->thread()->isolate()); | 50 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(workerGlobalScop
e->thread()->isolate()); |
52 return debugger ? new WorkerInspectorController(workerGlobalScope, debugger)
: nullptr; | 51 return debugger ? new WorkerInspectorController(workerGlobalScope, debugger)
: nullptr; |
(...skipping 26 matching lines...) Expand all Loading... |
79 return; | 78 return; |
80 m_session->dispose(); | 79 m_session->dispose(); |
81 m_session.clear(); | 80 m_session.clear(); |
82 } | 81 } |
83 | 82 |
84 void WorkerInspectorController::dispatchMessageFromFrontend(const String& messag
e) | 83 void WorkerInspectorController::dispatchMessageFromFrontend(const String& messag
e) |
85 { | 84 { |
86 if (!m_session) | 85 if (!m_session) |
87 return; | 86 return; |
88 protocol::String16 method; | 87 protocol::String16 method; |
89 if (!protocol::Dispatcher::getCommandName(message, &method)) | 88 if (!protocol::DispatcherBase::getCommandName(message, &method)) |
90 return; | 89 return; |
91 m_session->dispatchProtocolMessage(method, message); | 90 m_session->dispatchProtocolMessage(method, message); |
92 } | 91 } |
93 | 92 |
94 void WorkerInspectorController::dispose() | 93 void WorkerInspectorController::dispose() |
95 { | 94 { |
96 disconnectFrontend(); | 95 disconnectFrontend(); |
97 } | 96 } |
98 | 97 |
99 void WorkerInspectorController::resumeStartup() | 98 void WorkerInspectorController::resumeStartup() |
100 { | 99 { |
101 m_workerGlobalScope->thread()->stopRunningDebuggerTasksOnPause(); | 100 m_workerGlobalScope->thread()->stopRunningDebuggerTasksOnPause(); |
102 } | 101 } |
103 | 102 |
104 void WorkerInspectorController::sendProtocolMessage(int sessionId, int callId, c
onst String& response, const String& state) | 103 void WorkerInspectorController::sendProtocolMessage(int sessionId, int callId, c
onst String& response, const String& state) |
105 { | 104 { |
106 // Worker messages are wrapped, no need to handle callId or state. | 105 // Worker messages are wrapped, no need to handle callId or state. |
107 m_workerGlobalScope->thread()->workerReportingProxy().postMessageToPageInspe
ctor(response); | 106 m_workerGlobalScope->thread()->workerReportingProxy().postMessageToPageInspe
ctor(response); |
108 } | 107 } |
109 | 108 |
110 DEFINE_TRACE(WorkerInspectorController) | 109 DEFINE_TRACE(WorkerInspectorController) |
111 { | 110 { |
112 visitor->trace(m_workerGlobalScope); | 111 visitor->trace(m_workerGlobalScope); |
113 visitor->trace(m_instrumentingAgents); | 112 visitor->trace(m_instrumentingAgents); |
114 visitor->trace(m_session); | 113 visitor->trace(m_session); |
115 } | 114 } |
116 | 115 |
117 } // namespace blink | 116 } // namespace blink |
OLD | NEW |