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(); | |
102 do { | 101 do { |
103 result = m_workerGlobalScope->thread()->runDebuggerTask(); | 102 result = m_workerGlobalScope->thread()->runDebuggerTask(); |
104 // Keep waiting until execution is resumed. | 103 // Keep waiting until execution is resumed. |
105 } while (result == MessageQueueMessageReceived && isPaused()); | 104 } while (result == MessageQueueMessageReceived && isPaused()); |
106 m_workerGlobalScope->thread()->didLeaveNestedLoop(); | |
107 | 105 |
108 // The listener may have been removed in the nested loop. | 106 // The listener may have been removed in the nested loop. |
109 if (m_listener) | 107 if (m_listener) |
110 m_listener->didContinue(); | 108 m_listener->didContinue(); |
111 } | 109 } |
112 | 110 |
113 void WorkerScriptDebugServer::quitMessageLoopOnPause() | 111 void WorkerScriptDebugServer::quitMessageLoopOnPause() |
114 { | 112 { |
115 // Nothing to do here in case of workers since runMessageLoopOnPause will ch
eck for paused state after each debugger command. | 113 // Nothing to do here in case of workers since runMessageLoopOnPause will ch
eck for paused state after each debugger command. |
116 } | 114 } |
117 | 115 |
118 } // namespace blink | 116 } // namespace blink |
OLD | NEW |