| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "core/inspector/WorkerRuntimeAgent.h" | 33 #include "core/inspector/WorkerRuntimeAgent.h" |
| 34 | 34 |
| 35 #include "bindings/core/v8/ScriptState.h" | 35 #include "bindings/core/v8/ScriptState.h" |
| 36 #include "core/inspector/InjectedScript.h" | 36 #include "core/inspector/InjectedScript.h" |
| 37 #include "core/inspector/InstrumentingAgents.h" | 37 #include "core/inspector/InstrumentingAgents.h" |
| 38 #include "core/inspector/WorkerDebuggerAgent.h" | 38 #include "core/inspector/WorkerDebuggerAgent.h" |
| 39 #include "core/workers/WorkerGlobalScope.h" | 39 #include "core/workers/WorkerGlobalScope.h" |
| 40 #include "core/workers/WorkerRunLoop.h" |
| 40 #include "core/workers/WorkerThread.h" | 41 #include "core/workers/WorkerThread.h" |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptMana
ger, ScriptDebugServer* scriptDebugServer, WorkerGlobalScope* workerGlobalScope) | 45 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptMana
ger, ScriptDebugServer* scriptDebugServer, WorkerGlobalScope* workerGlobalScope) |
| 45 : InspectorRuntimeAgent(injectedScriptManager, scriptDebugServer) | 46 : InspectorRuntimeAgent(injectedScriptManager, scriptDebugServer) |
| 46 , m_workerGlobalScope(workerGlobalScope) | 47 , m_workerGlobalScope(workerGlobalScope) |
| 47 , m_paused(false) | 48 , m_paused(false) |
| 48 { | 49 { |
| 49 } | 50 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 *out_result = m_paused; | 107 *out_result = m_paused; |
| 107 } | 108 } |
| 108 | 109 |
| 109 void WorkerRuntimeAgent::willEvaluateWorkerScript(WorkerGlobalScope* context, in
t workerThreadStartMode) | 110 void WorkerRuntimeAgent::willEvaluateWorkerScript(WorkerGlobalScope* context, in
t workerThreadStartMode) |
| 110 { | 111 { |
| 111 if (workerThreadStartMode != PauseWorkerGlobalScopeOnStart) | 112 if (workerThreadStartMode != PauseWorkerGlobalScopeOnStart) |
| 112 return; | 113 return; |
| 113 | 114 |
| 114 m_paused = true; | 115 m_paused = true; |
| 115 MessageQueueWaitResult result; | 116 MessageQueueWaitResult result; |
| 116 context->thread()->willEnterNestedLoop(); | |
| 117 do { | 117 do { |
| 118 result = context->thread()->runDebuggerTask(); | 118 result = context->thread()->runLoop().runDebuggerTask(); |
| 119 // Keep waiting until execution is resumed. | 119 // Keep waiting until execution is resumed. |
| 120 } while (result == MessageQueueMessageReceived && m_paused); | 120 } while (result == MessageQueueMessageReceived && m_paused); |
| 121 context->thread()->didLeaveNestedLoop(); | |
| 122 } | 121 } |
| 123 | 122 |
| 124 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |