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" | |
41 #include "core/workers/WorkerThread.h" | 40 #include "core/workers/WorkerThread.h" |
42 | 41 |
43 namespace blink { | 42 namespace blink { |
44 | 43 |
45 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptMana
ger, ScriptDebugServer* scriptDebugServer, WorkerGlobalScope* workerGlobalScope) | 44 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptMana
ger, ScriptDebugServer* scriptDebugServer, WorkerGlobalScope* workerGlobalScope) |
46 : InspectorRuntimeAgent(injectedScriptManager, scriptDebugServer) | 45 : InspectorRuntimeAgent(injectedScriptManager, scriptDebugServer) |
47 , m_workerGlobalScope(workerGlobalScope) | 46 , m_workerGlobalScope(workerGlobalScope) |
48 , m_paused(false) | 47 , m_paused(false) |
49 { | 48 { |
50 } | 49 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 *out_result = m_paused; | 106 *out_result = m_paused; |
108 } | 107 } |
109 | 108 |
110 void WorkerRuntimeAgent::willEvaluateWorkerScript(WorkerGlobalScope* context, in
t workerThreadStartMode) | 109 void WorkerRuntimeAgent::willEvaluateWorkerScript(WorkerGlobalScope* context, in
t workerThreadStartMode) |
111 { | 110 { |
112 if (workerThreadStartMode != PauseWorkerGlobalScopeOnStart) | 111 if (workerThreadStartMode != PauseWorkerGlobalScopeOnStart) |
113 return; | 112 return; |
114 | 113 |
115 m_paused = true; | 114 m_paused = true; |
116 MessageQueueWaitResult result; | 115 MessageQueueWaitResult result; |
| 116 context->thread()->willEnterNestedLoop(); |
117 do { | 117 do { |
118 result = context->thread()->runLoop().runDebuggerTask(); | 118 result = context->thread()->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(); |
121 } | 122 } |
122 | 123 |
123 } // namespace blink | 124 } // namespace blink |
OLD | NEW |