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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "core/inspector/InspectorProfilerAgent.h" | 44 #include "core/inspector/InspectorProfilerAgent.h" |
45 #include "core/inspector/InspectorState.h" | 45 #include "core/inspector/InspectorState.h" |
46 #include "core/inspector/InspectorStateClient.h" | 46 #include "core/inspector/InspectorStateClient.h" |
47 #include "core/inspector/InspectorTimelineAgent.h" | 47 #include "core/inspector/InspectorTimelineAgent.h" |
48 #include "core/inspector/InstrumentingAgents.h" | 48 #include "core/inspector/InstrumentingAgents.h" |
49 #include "core/inspector/WorkerConsoleAgent.h" | 49 #include "core/inspector/WorkerConsoleAgent.h" |
50 #include "core/inspector/WorkerDebuggerAgent.h" | 50 #include "core/inspector/WorkerDebuggerAgent.h" |
51 #include "core/inspector/WorkerRuntimeAgent.h" | 51 #include "core/inspector/WorkerRuntimeAgent.h" |
52 #include "core/workers/WorkerGlobalScope.h" | 52 #include "core/workers/WorkerGlobalScope.h" |
53 #include "core/workers/WorkerReportingProxy.h" | 53 #include "core/workers/WorkerReportingProxy.h" |
54 #include "core/workers/WorkerThread.h" | 54 #include "core/workers/WorkerScript.h" |
55 #include "wtf/PassOwnPtr.h" | 55 #include "wtf/PassOwnPtr.h" |
56 | 56 |
57 namespace blink { | 57 namespace blink { |
58 | 58 |
59 namespace { | 59 namespace { |
60 | 60 |
61 class PageInspectorProxy final : public InspectorFrontendChannel { | 61 class PageInspectorProxy final : public InspectorFrontendChannel { |
62 WTF_MAKE_FAST_ALLOCATED(PageInspectorProxy); | 62 WTF_MAKE_FAST_ALLOCATED(PageInspectorProxy); |
63 public: | 63 public: |
64 explicit PageInspectorProxy(WorkerGlobalScope* workerGlobalScope) : m_worker
GlobalScope(workerGlobalScope) { } | 64 explicit PageInspectorProxy(WorkerGlobalScope* workerGlobalScope) : m_worker
GlobalScope(workerGlobalScope) { } |
65 virtual ~PageInspectorProxy() { } | 65 virtual ~PageInspectorProxy() { } |
66 private: | 66 private: |
67 virtual void sendProtocolResponse(int callId, PassRefPtr<JSONObject> message
) override | 67 virtual void sendProtocolResponse(int callId, PassRefPtr<JSONObject> message
) override |
68 { | 68 { |
69 // Worker messages are wrapped, no need to handle callId. | 69 // Worker messages are wrapped, no need to handle callId. |
70 m_workerGlobalScope->thread()->workerReportingProxy().postMessageToPageI
nspector(message->toJSONString()); | 70 m_workerGlobalScope->script()->workerReportingProxy().postMessageToPageI
nspector(message->toJSONString()); |
71 } | 71 } |
72 virtual void sendProtocolNotification(PassRefPtr<JSONObject> message) overri
de | 72 virtual void sendProtocolNotification(PassRefPtr<JSONObject> message) overri
de |
73 { | 73 { |
74 m_workerGlobalScope->thread()->workerReportingProxy().postMessageToPageI
nspector(message->toJSONString()); | 74 m_workerGlobalScope->script()->workerReportingProxy().postMessageToPageI
nspector(message->toJSONString()); |
75 } | 75 } |
76 virtual void flush() override { } | 76 virtual void flush() override { } |
77 WorkerGlobalScope* m_workerGlobalScope; | 77 WorkerGlobalScope* m_workerGlobalScope; |
78 }; | 78 }; |
79 | 79 |
80 class WorkerStateClient final : public InspectorStateClient { | 80 class WorkerStateClient final : public InspectorStateClient { |
81 WTF_MAKE_FAST_ALLOCATED(WorkerStateClient); | 81 WTF_MAKE_FAST_ALLOCATED(WorkerStateClient); |
82 public: | 82 public: |
83 WorkerStateClient(WorkerGlobalScope* context) { } | 83 WorkerStateClient(WorkerGlobalScope* context) { } |
84 virtual ~WorkerStateClient() { } | 84 virtual ~WorkerStateClient() { } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 bool WorkerInspectorController::isRunRequired() | 190 bool WorkerInspectorController::isRunRequired() |
191 { | 191 { |
192 return m_paused; | 192 return m_paused; |
193 } | 193 } |
194 | 194 |
195 void WorkerInspectorController::pauseOnStart() | 195 void WorkerInspectorController::pauseOnStart() |
196 { | 196 { |
197 m_paused = true; | 197 m_paused = true; |
198 MessageQueueWaitResult result; | 198 MessageQueueWaitResult result; |
199 m_workerGlobalScope->thread()->willEnterNestedLoop(); | 199 m_workerGlobalScope->script()->willEnterNestedLoop(); |
200 do { | 200 do { |
201 result = m_workerGlobalScope->thread()->runDebuggerTask(); | 201 result = m_workerGlobalScope->script()->runDebuggerTask(); |
202 // Keep waiting until execution is resumed. | 202 // Keep waiting until execution is resumed. |
203 } while (result == MessageQueueMessageReceived && m_paused); | 203 } while (result == MessageQueueMessageReceived && m_paused); |
204 m_workerGlobalScope->thread()->didLeaveNestedLoop(); | 204 m_workerGlobalScope->script()->didLeaveNestedLoop(); |
205 } | 205 } |
206 | 206 |
207 DEFINE_TRACE(WorkerInspectorController) | 207 DEFINE_TRACE(WorkerInspectorController) |
208 { | 208 { |
209 visitor->trace(m_workerGlobalScope); | 209 visitor->trace(m_workerGlobalScope); |
210 visitor->trace(m_state); | 210 visitor->trace(m_state); |
211 visitor->trace(m_instrumentingAgents); | 211 visitor->trace(m_instrumentingAgents); |
212 visitor->trace(m_injectedScriptManager); | 212 visitor->trace(m_injectedScriptManager); |
213 visitor->trace(m_debugServer); | 213 visitor->trace(m_debugServer); |
214 visitor->trace(m_backendDispatcher); | 214 visitor->trace(m_backendDispatcher); |
215 visitor->trace(m_agents); | 215 visitor->trace(m_agents); |
216 visitor->trace(m_workerDebuggerAgent); | 216 visitor->trace(m_workerDebuggerAgent); |
217 visitor->trace(m_asyncCallTracker); | 217 visitor->trace(m_asyncCallTracker); |
218 visitor->trace(m_workerRuntimeAgent); | 218 visitor->trace(m_workerRuntimeAgent); |
219 } | 219 } |
220 | 220 |
221 } // namespace blink | 221 } // namespace blink |
OLD | NEW |