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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 }; | 61 }; |
62 | 62 |
63 } // namespace | 63 } // namespace |
64 | 64 |
65 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) |
66 { | 66 { |
67 return adoptPtrWillBeNoop(new WorkerDebuggerAgent(scriptDebugServer, inspect
edWorkerGlobalScope, injectedScriptManager)); | 67 return adoptPtrWillBeNoop(new WorkerDebuggerAgent(scriptDebugServer, inspect
edWorkerGlobalScope, injectedScriptManager)); |
68 } | 68 } |
69 | 69 |
70 WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerScriptDebugServer* scriptDebugSer
ver, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injec
tedScriptManager) | 70 WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerScriptDebugServer* scriptDebugSer
ver, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injec
tedScriptManager) |
71 : InspectorDebuggerAgent(injectedScriptManager, scriptDebugServer->isolate()
) | 71 : InspectorDebuggerAgent(injectedScriptManager, scriptDebugServer->scriptDeb
ugServer()->isolate()) |
72 , m_scriptDebugServer(scriptDebugServer) | 72 , m_scriptDebugServer(scriptDebugServer) |
73 , m_inspectedWorkerGlobalScope(inspectedWorkerGlobalScope) | 73 , m_inspectedWorkerGlobalScope(inspectedWorkerGlobalScope) |
74 { | 74 { |
75 } | 75 } |
76 | 76 |
77 WorkerDebuggerAgent::~WorkerDebuggerAgent() | 77 WorkerDebuggerAgent::~WorkerDebuggerAgent() |
78 { | 78 { |
79 } | 79 } |
80 | 80 |
81 DEFINE_TRACE(WorkerDebuggerAgent) | 81 DEFINE_TRACE(WorkerDebuggerAgent) |
82 { | 82 { |
83 visitor->trace(m_inspectedWorkerGlobalScope); | 83 visitor->trace(m_inspectedWorkerGlobalScope); |
84 InspectorDebuggerAgent::trace(visitor); | 84 InspectorDebuggerAgent::trace(visitor); |
85 } | 85 } |
86 | 86 |
87 void WorkerDebuggerAgent::interruptAndDispatchInspectorCommands() | 87 void WorkerDebuggerAgent::interruptAndDispatchInspectorCommands() |
88 { | 88 { |
89 scriptDebugServer().interruptAndRun(adoptPtr(new RunInspectorCommandsTask(m_
inspectedWorkerGlobalScope->thread()))); | 89 scriptDebugServer().interruptAndRun(adoptPtr(new RunInspectorCommandsTask(m_
inspectedWorkerGlobalScope->thread()))); |
90 } | 90 } |
91 | 91 |
92 void WorkerDebuggerAgent::startListeningScriptDebugServer() | 92 void WorkerDebuggerAgent::startListeningScriptDebugServer() |
93 { | 93 { |
94 scriptDebugServer().addListener(this); | 94 m_scriptDebugServer->addListener(this); |
95 } | 95 } |
96 | 96 |
97 void WorkerDebuggerAgent::stopListeningScriptDebugServer() | 97 void WorkerDebuggerAgent::stopListeningScriptDebugServer() |
98 { | 98 { |
99 scriptDebugServer().removeListener(this); | 99 m_scriptDebugServer->removeListener(this); |
100 } | 100 } |
101 | 101 |
102 WorkerScriptDebugServer& WorkerDebuggerAgent::scriptDebugServer() | 102 ScriptDebugServer& WorkerDebuggerAgent::scriptDebugServer() |
103 { | 103 { |
104 return *m_scriptDebugServer; | 104 return *(m_scriptDebugServer->scriptDebugServer()); |
105 } | 105 } |
106 | 106 |
107 InjectedScript WorkerDebuggerAgent::injectedScriptForEval(ErrorString* error, co
nst int* executionContextId) | 107 InjectedScript WorkerDebuggerAgent::injectedScriptForEval(ErrorString* error, co
nst int* executionContextId) |
108 { | 108 { |
109 if (!executionContextId) | 109 if (!executionContextId) |
110 return injectedScriptManager()->injectedScriptFor(m_inspectedWorkerGloba
lScope->script()->scriptState()); | 110 return injectedScriptManager()->injectedScriptFor(m_inspectedWorkerGloba
lScope->script()->scriptState()); |
111 | 111 |
112 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId
(*executionContextId); | 112 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId
(*executionContextId); |
113 if (injectedScript.isEmpty()) | 113 if (injectedScript.isEmpty()) |
114 *error = "Execution context with given id not found."; | 114 *error = "Execution context with given id not found."; |
115 return injectedScript; | 115 return injectedScript; |
116 } | 116 } |
117 | 117 |
118 void WorkerDebuggerAgent::muteConsole() | 118 void WorkerDebuggerAgent::muteConsole() |
119 { | 119 { |
120 // We don't need to mute console for workers. | 120 // We don't need to mute console for workers. |
121 } | 121 } |
122 | 122 |
123 void WorkerDebuggerAgent::unmuteConsole() | 123 void WorkerDebuggerAgent::unmuteConsole() |
124 { | 124 { |
125 // We don't need to mute console for workers. | 125 // We don't need to mute console for workers. |
126 } | 126 } |
127 | 127 |
128 } // namespace blink | 128 } // namespace blink |
OLD | NEW |