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 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/inspector/WorkerDebuggerAgent.h" | 32 #include "core/inspector/WorkerDebuggerAgent.h" |
33 | 33 |
34 #include "bindings/core/v8/ScriptDebugServer.h" | 34 #include "bindings/core/v8/ScriptDebugServer.h" |
| 35 #include "core/inspector/EditedResourcesContentManager.h" |
35 #include "core/inspector/WorkerInspectorController.h" | 36 #include "core/inspector/WorkerInspectorController.h" |
36 #include "core/workers/WorkerGlobalScope.h" | 37 #include "core/workers/WorkerGlobalScope.h" |
37 #include "core/workers/WorkerThread.h" | 38 #include "core/workers/WorkerThread.h" |
38 #include "wtf/MessageQueue.h" | 39 #include "wtf/MessageQueue.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 namespace { | 43 namespace { |
43 | 44 |
44 class RunInspectorCommandsTask FINAL : public ScriptDebugServer::Task { | 45 class RunInspectorCommandsTask FINAL : public ScriptDebugServer::Task { |
45 public: | 46 public: |
46 explicit RunInspectorCommandsTask(WorkerThread* thread) | 47 explicit RunInspectorCommandsTask(WorkerThread* thread) |
47 : m_thread(thread) { } | 48 : m_thread(thread) { } |
48 virtual ~RunInspectorCommandsTask() { } | 49 virtual ~RunInspectorCommandsTask() { } |
49 virtual void run() OVERRIDE | 50 virtual void run() OVERRIDE |
50 { | 51 { |
51 // Process all queued debugger commands. WorkerThread is certainly | 52 // Process all queued debugger commands. WorkerThread is certainly |
52 // alive if this task is being executed. | 53 // alive if this task is being executed. |
53 m_thread->willEnterNestedLoop(); | 54 m_thread->willEnterNestedLoop(); |
54 while (MessageQueueMessageReceived == m_thread->runDebuggerTask(WorkerTh
read::DontWaitForMessage)) { } | 55 while (MessageQueueMessageReceived == m_thread->runDebuggerTask(WorkerTh
read::DontWaitForMessage)) { } |
55 m_thread->didLeaveNestedLoop(); | 56 m_thread->didLeaveNestedLoop(); |
56 } | 57 } |
57 | 58 |
58 private: | 59 private: |
59 WorkerThread* m_thread; | 60 WorkerThread* m_thread; |
60 }; | 61 }; |
61 | 62 |
62 } // namespace | 63 } // namespace |
63 | 64 |
64 PassOwnPtrWillBeRawPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(WorkerSc
riptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScop
e, InjectedScriptManager* injectedScriptManager) | 65 PassOwnPtrWillBeRawPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(WorkerSc
riptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScop
e, InjectedScriptManager* injectedScriptManager, EditedResourcesContentManager*
editedResourcesContentManager) |
65 { | 66 { |
66 return adoptPtrWillBeNoop(new WorkerDebuggerAgent(scriptDebugServer, inspect
edWorkerGlobalScope, injectedScriptManager)); | 67 return adoptPtrWillBeNoop(new WorkerDebuggerAgent(scriptDebugServer, inspect
edWorkerGlobalScope, injectedScriptManager, editedResourcesContentManager)); |
67 } | 68 } |
68 | 69 |
69 WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerScriptDebugServer* scriptDebugSer
ver, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injec
tedScriptManager) | 70 WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerScriptDebugServer* scriptDebugSer
ver, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injec
tedScriptManager, EditedResourcesContentManager* editedResourcesContentManager) |
70 : InspectorDebuggerAgent(injectedScriptManager) | 71 : InspectorDebuggerAgent(injectedScriptManager, editedResourcesContentManage
r) |
71 , m_scriptDebugServer(scriptDebugServer) | 72 , m_scriptDebugServer(scriptDebugServer) |
72 , m_inspectedWorkerGlobalScope(inspectedWorkerGlobalScope) | 73 , m_inspectedWorkerGlobalScope(inspectedWorkerGlobalScope) |
73 { | 74 { |
74 } | 75 } |
75 | 76 |
76 WorkerDebuggerAgent::~WorkerDebuggerAgent() | 77 WorkerDebuggerAgent::~WorkerDebuggerAgent() |
77 { | 78 { |
78 } | 79 } |
79 | 80 |
80 void WorkerDebuggerAgent::trace(Visitor* visitor) | 81 void WorkerDebuggerAgent::trace(Visitor* visitor) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 { | 117 { |
117 // We don't need to mute console for workers. | 118 // We don't need to mute console for workers. |
118 } | 119 } |
119 | 120 |
120 void WorkerDebuggerAgent::unmuteConsole() | 121 void WorkerDebuggerAgent::unmuteConsole() |
121 { | 122 { |
122 // We don't need to mute console for workers. | 123 // We don't need to mute console for workers. |
123 } | 124 } |
124 | 125 |
125 } // namespace blink | 126 } // namespace blink |
OLD | NEW |