| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 bool WorkerInspectorController::isRunRequired() | 197 bool WorkerInspectorController::isRunRequired() |
| 198 { | 198 { |
| 199 return m_paused; | 199 return m_paused; |
| 200 } | 200 } |
| 201 | 201 |
| 202 void WorkerInspectorController::pauseOnStart() | 202 void WorkerInspectorController::pauseOnStart() |
| 203 { | 203 { |
| 204 m_paused = true; | 204 m_paused = true; |
| 205 MessageQueueWaitResult result; | 205 MessageQueueWaitResult result; |
| 206 m_workerGlobalScope->thread()->willEnterNestedLoop(); | 206 m_workerGlobalScope->script()->willEnterNestedLoop(); |
| 207 do { | 207 do { |
| 208 result = m_workerGlobalScope->thread()->runDebuggerTask(); | 208 result = m_workerGlobalScope->script()->runDebuggerTask(); |
| 209 // Keep waiting until execution is resumed. | 209 // Keep waiting until execution is resumed. |
| 210 } while (result == MessageQueueMessageReceived && m_paused); | 210 } while (result == MessageQueueMessageReceived && m_paused); |
| 211 m_workerGlobalScope->thread()->didLeaveNestedLoop(); | 211 m_workerGlobalScope->script()->didLeaveNestedLoop(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 DEFINE_TRACE(WorkerInspectorController) | 214 DEFINE_TRACE(WorkerInspectorController) |
| 215 { | 215 { |
| 216 visitor->trace(m_workerGlobalScope); | 216 visitor->trace(m_workerGlobalScope); |
| 217 visitor->trace(m_state); | 217 visitor->trace(m_state); |
| 218 visitor->trace(m_instrumentingAgents); | 218 visitor->trace(m_instrumentingAgents); |
| 219 visitor->trace(m_injectedScriptManager); | 219 visitor->trace(m_injectedScriptManager); |
| 220 visitor->trace(m_debugServer); | 220 visitor->trace(m_debugServer); |
| 221 visitor->trace(m_backendDispatcher); | 221 visitor->trace(m_backendDispatcher); |
| 222 visitor->trace(m_agents); | 222 visitor->trace(m_agents); |
| 223 visitor->trace(m_workerDebuggerAgent); | 223 visitor->trace(m_workerDebuggerAgent); |
| 224 visitor->trace(m_asyncCallTracker); | 224 visitor->trace(m_asyncCallTracker); |
| 225 visitor->trace(m_workerRuntimeAgent); | 225 visitor->trace(m_workerRuntimeAgent); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |