Web Inspector: allow to start WorkerContext paused
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2011 09:33:18 +0000 (09:33 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2011 09:33:18 +0000 (09:33 +0000)
commitc8b535affe238baabaa4a7b48d95fb7a967506ec
treefd7eaf9b7ec48420431aee87f548be0fe049455e
parent1733f67c4d991716e065dfa28e951bd146fd5ae3
Web Inspector: allow to start WorkerContext paused
https://bugs.webkit.org/show_bug.cgi?id=69635

Source/WebCore:

Allow to pause WorkerContext on start.

Reviewed by Pavel Feldman.

* bindings/v8/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::setPauseOnNextStatement):
* bindings/v8/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::runMessageLoopOnPause):
* bindings/v8/WorkerScriptDebugServer.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willEvaluateWorkerScript):
* inspector/InspectorInstrumentation.h:
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
(WebCore::InspectorRuntimeAgent::~InspectorRuntimeAgent):
(WebCore::InspectorRuntimeAgent::pauseWorkerContext): this method will start
running worker message loop in "debug" mode, i.e. it will process only inspector
tasks until method InspectorRuntimeAgent::resume is called.
(WebCore::InspectorRuntimeAgent::resume):
* inspector/InspectorRuntimeAgent.h:
* inspector/WorkerDebuggerAgent.cpp:
* inspector/WorkerDebuggerAgent.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::resume): method which is called from WebKit layer
when it is known that inspector state was restored and it is OK to resume worker execution.
* inspector/WorkerInspectorController.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::create):
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
* workers/DedicatedWorkerThread.h:
* workers/SharedWorkerThread.cpp:
(WebCore::SharedWorkerThread::create):
(WebCore::SharedWorkerThread::SharedWorkerThread):
* workers/SharedWorkerThread.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerContext):
(WebCore::WorkerMessagingProxy::disconnectFromInspector):
(WebCore::WorkerMessagingProxy::sendMessageToInspector):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::create):
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread): WorkerThread is passed a booleand flag indicating
whether the context should be paused and wait for explicit resume command before it
starts running its script.
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:

Source/WebKit/chromium:

Expose methods for pausing shared worker on start.

Reviewed by Pavel Feldman.

* public/WebSharedWorker.h:
(WebKit::WebSharedWorker::pauseWorkerContextOnStart): specifies that the worker
context should be paused and weit for explicit call to resumeWorkerContext before
running its script.
(WebKit::WebSharedWorker::resumeWorkerContext):
* src/WebSharedWorkerImpl.cpp:
(WebKit::WebSharedWorkerImpl::WebSharedWorkerImpl):
(WebKit::WebSharedWorkerImpl::startWorkerContext):
(WebKit::WebSharedWorkerImpl::pauseWorkerContextOnStart):
(WebKit::resumeWorkerContextTask):
(WebKit::WebSharedWorkerImpl::resumeWorkerContext):
(WebKit::WebSharedWorkerImpl::attachDevTools):
(WebKit::reconnectToWorkerContextInspectorTask):
(WebKit::WebSharedWorkerImpl::reattachDevTools):
(WebKit::WebSharedWorkerImpl::detachDevTools):
(WebKit::WebSharedWorkerImpl::dispatchDevToolsMessage):
* src/WebSharedWorkerImpl.h:
* src/WebWorkerClientImpl.cpp:
(WebKit::WebWorkerClientImpl::startWorkerContext):
(WebKit::WebWorkerClientImpl::updateInspectorStateCookie):
* src/WebWorkerClientImpl.h:
* src/WebWorkerImpl.cpp:
(WebKit::WebWorkerImpl::startWorkerContext):
(WebKit::WebWorkerImpl::detachDevTools):
(WebKit::WebWorkerImpl::dispatchDevToolsMessage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/ScriptDebugServer.cpp
Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp
Source/WebCore/bindings/v8/WorkerScriptDebugServer.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorRuntimeAgent.cpp
Source/WebCore/inspector/InspectorRuntimeAgent.h
Source/WebCore/inspector/WorkerDebuggerAgent.cpp
Source/WebCore/inspector/WorkerDebuggerAgent.h
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebCore/inspector/WorkerInspectorController.h
Source/WebCore/workers/DedicatedWorkerThread.cpp
Source/WebCore/workers/DedicatedWorkerThread.h
Source/WebCore/workers/DefaultSharedWorkerRepository.cpp
Source/WebCore/workers/SharedWorkerThread.cpp
Source/WebCore/workers/SharedWorkerThread.h
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/workers/WorkerThread.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSharedWorker.h
Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp
Source/WebKit/chromium/src/WebSharedWorkerImpl.h
Source/WebKit/chromium/src/WebWorkerClientImpl.cpp
Source/WebKit/chromium/src/WebWorkerClientImpl.h
Source/WebKit/chromium/src/WebWorkerImpl.cpp