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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 ScriptDebugListener* WorkerScriptDebugServer::getDebugListenerForContext(v8::Han
dle<v8::Context>) | 92 ScriptDebugListener* WorkerScriptDebugServer::getDebugListenerForContext(v8::Han
dle<v8::Context>) |
93 { | 93 { |
94 // There is only one worker context in isolate. | 94 // There is only one worker context in isolate. |
95 return m_listener; | 95 return m_listener; |
96 } | 96 } |
97 | 97 |
98 void WorkerScriptDebugServer::runMessageLoopOnPause(v8::Handle<v8::Context>) | 98 void WorkerScriptDebugServer::runMessageLoopOnPause(v8::Handle<v8::Context>) |
99 { | 99 { |
100 MessageQueueWaitResult result; | 100 MessageQueueWaitResult result; |
| 101 m_workerGlobalScope->thread()->willEnterNestedLoop(); |
101 do { | 102 do { |
102 result = m_workerGlobalScope->thread()->runDebuggerTask(); | 103 result = m_workerGlobalScope->thread()->runDebuggerTask(); |
103 // Keep waiting until execution is resumed. | 104 // Keep waiting until execution is resumed. |
104 } while (result == MessageQueueMessageReceived && isPaused()); | 105 } while (result == MessageQueueMessageReceived && isPaused()); |
| 106 m_workerGlobalScope->thread()->didLeaveNestedLoop(); |
105 | 107 |
106 // The listener may have been removed in the nested loop. | 108 // The listener may have been removed in the nested loop. |
107 if (m_listener) | 109 if (m_listener) |
108 m_listener->didContinue(); | 110 m_listener->didContinue(); |
109 } | 111 } |
110 | 112 |
111 void WorkerScriptDebugServer::quitMessageLoopOnPause() | 113 void WorkerScriptDebugServer::quitMessageLoopOnPause() |
112 { | 114 { |
113 // Nothing to do here in case of workers since runMessageLoopOnPause will ch
eck for paused state after each debugger command. | 115 // Nothing to do here in case of workers since runMessageLoopOnPause will ch
eck for paused state after each debugger command. |
114 } | 116 } |
115 | 117 |
116 } // namespace blink | 118 } // namespace blink |
OLD | NEW |