Web Inspector: Automatic Inspection should continue once all breakpoints are loaded
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Sep 2014 23:25:17 +0000 (23:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Sep 2014 23:25:17 +0000 (23:25 +0000)
commitb451beec0cc54f55702aaf6ea6fd9e8e6e0c18ea
treef1db8292e08c6c29b95b0ef94badbef42ad0de9b
parent733593c91f0cc79d5fc6ec24cf02907e092dcfdf
Web Inspector: Automatic Inspection should continue once all breakpoints are loaded
https://bugs.webkit.org/show_bug.cgi?id=137038

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-09-26
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Add a new protocol command "Inspector.initialized" that signifies to the backend
when the frontend has sent all its initialization messages to the backend. This
can include information like breakpoints, which we would want to have loaded
before any JavaScript evaluates in the context.

* inspector/protocol/InspectorDomain.json:
New protocol command, Inspector.initialized.

* inspector/agents/InspectorAgent.h:
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::InspectorAgent):
(Inspector::InspectorAgent::initialized):
Tell the InspectorEnvironment (the Controller) the frontend has initialized.

* inspector/InspectorEnvironment.h:
Abstract virtual method to handle frontend initialization. To be
implemented by all of the InspectorControllers.

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
(Inspector::JSGlobalObjectInspectorController::disconnectFrontend):
(Inspector::JSGlobalObjectInspectorController::frontendInitialized):
When a frontend is initialized, if it was automatic inspection unpause the debuggable.

* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::unpauseForInitializedInspector):
Complete setup for this debuggable.

* inspector/remote/RemoteInspectorDebuggable.h:
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorDebuggableConnection::setup):
Move the setup complete to later, when the frontend sends an "initialized" message.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::updateDebuggableAutomaticInspectCandidate):
Provide a longer timeout now that the frontend must send messages after the connection
has established. The longest I have seen in  600ms, but the average tends to be 200ms.
So bump the timeout to 800ms for a buffer.

(Inspector::RemoteInspector::setupSucceeded): Deleted.
(Inspector::RemoteInspector::setupCompleted):
Rename, as this happens at a slightly different time.

Source/WebCore:

Handle frontend initialization messages even though pages cannot
be automatically inspected yet.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::frontendInitialized):
* inspector/InspectorController.h:
* inspector/WorkerInspectorController.h:
* page/Page.h:
(WebCore::Page::inspectorDebuggable):

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
Send the initialized message after we have sent all other setup messages,
such as enabling features and setting breakpoints.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InspectorEnvironment.h
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h
Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorAgent.h
Source/JavaScriptCore/inspector/protocol/InspectorDomain.json
Source/JavaScriptCore/inspector/remote/RemoteInspector.h
Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/WorkerInspectorController.h
Source/WebCore/page/Page.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js