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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "bindings/core/v8/WorkerScriptDebugServer.h" | 32 #include "bindings/core/v8/WorkerScriptDebugServer.h" |
33 | 33 |
34 #include "bindings/core/v8/V8ScriptRunner.h" | 34 #include "bindings/core/v8/V8ScriptRunner.h" |
35 #include "core/inspector/PerIsolateDebuggerClient.h" | 35 #include "core/inspector/PerIsolateDebuggerClient.h" |
36 #include "core/inspector/ScriptDebugListener.h" | 36 #include "core/inspector/ScriptDebugListener.h" |
37 #include "core/inspector/WorkerDebuggerAgent.h" | 37 #include "core/inspector/WorkerDebuggerAgent.h" |
38 #include "core/workers/WorkerGlobalScope.h" | 38 #include "core/workers/WorkerGlobalScope.h" |
39 #include "core/workers/WorkerThread.h" | 39 #include "core/workers/WorkerScript.h" |
40 #include "wtf/MessageQueue.h" | 40 #include "wtf/MessageQueue.h" |
41 #include <v8.h> | 41 #include <v8.h> |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 static const char* workerContextDebugId = "[worker]"; | 45 static const char* workerContextDebugId = "[worker]"; |
46 | 46 |
47 WorkerScriptDebugServer::WorkerScriptDebugServer(WorkerGlobalScope* workerGlobal
Scope) | 47 WorkerScriptDebugServer::WorkerScriptDebugServer(WorkerGlobalScope* workerGlobal
Scope) |
48 : ScriptDebugServer(v8::Isolate::GetCurrent(), adoptPtr(new PerIsolateDebugg
erClient(v8::Isolate::GetCurrent()))) | 48 : ScriptDebugServer(v8::Isolate::GetCurrent(), adoptPtr(new PerIsolateDebugg
erClient(v8::Isolate::GetCurrent()))) |
49 , m_listener(0) | 49 , m_listener(0) |
(...skipping 30 matching lines...) Expand all Loading... |
80 | 80 |
81 ScriptDebugListener* WorkerScriptDebugServer::getDebugListenerForContext(v8::Loc
al<v8::Context>) | 81 ScriptDebugListener* WorkerScriptDebugServer::getDebugListenerForContext(v8::Loc
al<v8::Context>) |
82 { | 82 { |
83 // There is only one worker context in isolate. | 83 // There is only one worker context in isolate. |
84 return m_listener; | 84 return m_listener; |
85 } | 85 } |
86 | 86 |
87 void WorkerScriptDebugServer::runMessageLoopOnPause(v8::Local<v8::Context>) | 87 void WorkerScriptDebugServer::runMessageLoopOnPause(v8::Local<v8::Context>) |
88 { | 88 { |
89 MessageQueueWaitResult result; | 89 MessageQueueWaitResult result; |
90 m_workerGlobalScope->thread()->willEnterNestedLoop(); | 90 m_workerGlobalScope->script()->willEnterNestedLoop(); |
91 do { | 91 do { |
92 result = m_workerGlobalScope->thread()->runDebuggerTask(); | 92 result = m_workerGlobalScope->script()->runDebuggerTask(); |
93 // Keep waiting until execution is resumed. | 93 // Keep waiting until execution is resumed. |
94 } while (result == MessageQueueMessageReceived && isPaused()); | 94 } while (result == MessageQueueMessageReceived && isPaused()); |
95 m_workerGlobalScope->thread()->didLeaveNestedLoop(); | 95 m_workerGlobalScope->script()->didLeaveNestedLoop(); |
96 | 96 |
97 // The listener may have been removed in the nested loop. | 97 // The listener may have been removed in the nested loop. |
98 if (m_listener) | 98 if (m_listener) |
99 m_listener->didContinue(); | 99 m_listener->didContinue(); |
100 } | 100 } |
101 | 101 |
102 void WorkerScriptDebugServer::quitMessageLoopOnPause() | 102 void WorkerScriptDebugServer::quitMessageLoopOnPause() |
103 { | 103 { |
104 // Nothing to do here in case of workers since runMessageLoopOnPause will ch
eck for paused state after each debugger command. | 104 // Nothing to do here in case of workers since runMessageLoopOnPause will ch
eck for paused state after each debugger command. |
105 } | 105 } |
106 | 106 |
107 } // namespace blink | 107 } // namespace blink |
OLD | NEW |