Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(937)

Side by Side Diff: Source/core/inspector/WorkerInspectorController.cpp

Issue 1164423007: Make inspector-protocol/debugger/debugger-step-into-dedicated-worker.html not timeout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/WorkerInspectorController.h ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGl obalScope) 119 WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGl obalScope)
120 : m_workerGlobalScope(workerGlobalScope) 120 : m_workerGlobalScope(workerGlobalScope)
121 , m_stateClient(adoptPtr(new WorkerStateClient(workerGlobalScope))) 121 , m_stateClient(adoptPtr(new WorkerStateClient(workerGlobalScope)))
122 , m_state(adoptPtrWillBeNoop(new InspectorCompositeState(m_stateClient.get() ))) 122 , m_state(adoptPtrWillBeNoop(new InspectorCompositeState(m_stateClient.get() )))
123 , m_instrumentingAgents(InstrumentingAgents::create()) 123 , m_instrumentingAgents(InstrumentingAgents::create())
124 , m_injectedScriptManager(InjectedScriptManager::createForWorker()) 124 , m_injectedScriptManager(InjectedScriptManager::createForWorker())
125 , m_workerThreadDebugger(WorkerThreadDebugger::create(workerGlobalScope)) 125 , m_workerThreadDebugger(WorkerThreadDebugger::create(workerGlobalScope))
126 , m_agents(m_instrumentingAgents.get(), m_state.get()) 126 , m_agents(m_instrumentingAgents.get(), m_state.get())
127 , m_inspectorTaskRunner(adoptPtr(new InspectorTaskRunner(v8::Isolate::GetCur rent()))) 127 , m_inspectorTaskRunner(adoptPtr(new InspectorTaskRunner(v8::Isolate::GetCur rent())))
128 , m_beforeInitlizedScope(adoptPtr(new InspectorTaskRunner::IgnoreInterruptsS cope(m_inspectorTaskRunner.get())))
128 , m_paused(false) 129 , m_paused(false)
129 { 130 {
130 OwnPtrWillBeRawPtr<WorkerRuntimeAgent> workerRuntimeAgent = WorkerRuntimeAge nt::create(m_injectedScriptManager.get(), m_workerThreadDebugger->debugger(), wo rkerGlobalScope, this); 131 OwnPtrWillBeRawPtr<WorkerRuntimeAgent> workerRuntimeAgent = WorkerRuntimeAge nt::create(m_injectedScriptManager.get(), m_workerThreadDebugger->debugger(), wo rkerGlobalScope, this);
131 m_workerRuntimeAgent = workerRuntimeAgent.get(); 132 m_workerRuntimeAgent = workerRuntimeAgent.get();
132 m_agents.append(workerRuntimeAgent.release()); 133 m_agents.append(workerRuntimeAgent.release());
133 134
134 OwnPtrWillBeRawPtr<WorkerDebuggerAgent> workerDebuggerAgent = WorkerDebugger Agent::create(m_workerThreadDebugger.get(), workerGlobalScope, m_injectedScriptM anager.get()); 135 OwnPtrWillBeRawPtr<WorkerDebuggerAgent> workerDebuggerAgent = WorkerDebugger Agent::create(m_workerThreadDebugger.get(), workerGlobalScope, m_injectedScriptM anager.get());
135 m_workerDebuggerAgent = workerDebuggerAgent.get(); 136 m_workerDebuggerAgent = workerDebuggerAgent.get();
136 m_agents.append(workerDebuggerAgent.release()); 137 m_agents.append(workerDebuggerAgent.release());
137 m_asyncCallTracker = adoptPtrWillBeNoop(new AsyncCallTracker(m_workerDebugge rAgent, m_instrumentingAgents.get())); 138 m_asyncCallTracker = adoptPtrWillBeNoop(new AsyncCallTracker(m_workerDebugge rAgent, m_instrumentingAgents.get()));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void WorkerInspectorController::resumeStartup() 215 void WorkerInspectorController::resumeStartup()
215 { 216 {
216 m_paused = false; 217 m_paused = false;
217 } 218 }
218 219
219 bool WorkerInspectorController::isRunRequired() 220 bool WorkerInspectorController::isRunRequired()
220 { 221 {
221 return m_paused; 222 return m_paused;
222 } 223 }
223 224
225 void WorkerInspectorController::workerContextInitialized(bool shouldPauseOnStart )
226 {
227 m_beforeInitlizedScope.clear();
228 if (shouldPauseOnStart)
229 pauseOnStart();
230 }
231
224 void WorkerInspectorController::pauseOnStart() 232 void WorkerInspectorController::pauseOnStart()
225 { 233 {
226 m_paused = true; 234 m_paused = true;
227 MessageQueueWaitResult result; 235 MessageQueueWaitResult result;
228 m_workerGlobalScope->thread()->willEnterNestedLoop(); 236 m_workerGlobalScope->thread()->willEnterNestedLoop();
229 do { 237 do {
230 result = m_workerGlobalScope->thread()->runDebuggerTask(); 238 result = m_workerGlobalScope->thread()->runDebuggerTask();
231 // Keep waiting until execution is resumed. 239 // Keep waiting until execution is resumed.
232 } while (result == MessageQueueMessageReceived && m_paused); 240 } while (result == MessageQueueMessageReceived && m_paused);
233 m_workerGlobalScope->thread()->didLeaveNestedLoop(); 241 m_workerGlobalScope->thread()->didLeaveNestedLoop();
234 } 242 }
235 243
236 DEFINE_TRACE(WorkerInspectorController) 244 DEFINE_TRACE(WorkerInspectorController)
237 { 245 {
238 visitor->trace(m_workerGlobalScope); 246 visitor->trace(m_workerGlobalScope);
239 visitor->trace(m_state); 247 visitor->trace(m_state);
240 visitor->trace(m_instrumentingAgents); 248 visitor->trace(m_instrumentingAgents);
241 visitor->trace(m_injectedScriptManager); 249 visitor->trace(m_injectedScriptManager);
242 visitor->trace(m_workerThreadDebugger); 250 visitor->trace(m_workerThreadDebugger);
243 visitor->trace(m_backendDispatcher); 251 visitor->trace(m_backendDispatcher);
244 visitor->trace(m_agents); 252 visitor->trace(m_agents);
245 visitor->trace(m_workerDebuggerAgent); 253 visitor->trace(m_workerDebuggerAgent);
246 visitor->trace(m_asyncCallTracker); 254 visitor->trace(m_asyncCallTracker);
247 visitor->trace(m_workerRuntimeAgent); 255 visitor->trace(m_workerRuntimeAgent);
248 } 256 }
249 257
250 } // namespace blink 258 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/WorkerInspectorController.h ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698