| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 { | 79 { |
| 80 ASSERT(m_listener == listener); | 80 ASSERT(m_listener == listener); |
| 81 continueProgram(); | 81 continueProgram(); |
| 82 discardDebuggerScript(); | 82 discardDebuggerScript(); |
| 83 m_listener = 0; | 83 m_listener = 0; |
| 84 v8::Debug::SetDebugEventListener(0); | 84 v8::Debug::SetDebugEventListener(0); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void WorkerScriptDebugServer::interruptAndRunTask(PassOwnPtr<Task> task) | 87 void WorkerScriptDebugServer::interruptAndRunTask(PassOwnPtr<Task> task) |
| 88 { | 88 { |
| 89 interruptAndRun(task, m_isolate); | 89 interruptAndRun(m_isolate, task); |
| 90 } | 90 } |
| 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 m_workerGlobalScope->thread()->willEnterNestedLoop(); |
| 102 do { | 102 do { |
| 103 result = m_workerGlobalScope->thread()->runDebuggerTask(); | 103 result = m_workerGlobalScope->thread()->runDebuggerTask(); |
| 104 // Keep waiting until execution is resumed. | 104 // Keep waiting until execution is resumed. |
| 105 } while (result == MessageQueueMessageReceived && isPaused()); | 105 } while (result == MessageQueueMessageReceived && isPaused()); |
| 106 m_workerGlobalScope->thread()->didLeaveNestedLoop(); | 106 m_workerGlobalScope->thread()->didLeaveNestedLoop(); |
| 107 | 107 |
| 108 // The listener may have been removed in the nested loop. | 108 // The listener may have been removed in the nested loop. |
| 109 if (m_listener) | 109 if (m_listener) |
| 110 m_listener->didContinue(); | 110 m_listener->didContinue(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void WorkerScriptDebugServer::quitMessageLoopOnPause() | 113 void WorkerScriptDebugServer::quitMessageLoopOnPause() |
| 114 { | 114 { |
| 115 // 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. |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |