JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 May 2017 22:56:56 +0000 (22:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 May 2017 22:56:56 +0000 (22:56 +0000)
commit39fde0b133f2cc2357335f91ee33566b2d188d3d
tree95b52c7e4a804c80553d0479dd772584c0541fe3
parentb83c09198d86468d0d065f6c18b47cbc528839a0
JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
https://bugs.webkit.org/show_bug.cgi?id=172664
<rdar://problem/32362933>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-26
Reviewed by Matt Baker.

Source/JavaScriptCore:

Automatically pause on connection was triggering a pause before the
frontend may have initialized. Often during frontend initialization
the frontend may perform an action that clears the pause state requested
by the developer. This change defers the pause until after the frontend
has initialized, right before returning to the application's code.

* inspector/remote/RemoteControllableTarget.h:
* inspector/remote/RemoteInspectionTarget.h:
* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteConnectionToTarget::setup):
* inspector/remote/glib/RemoteConnectionToTargetGlib.cpp:
(Inspector::RemoteConnectionToTarget::setup):
* runtime/JSGlobalObjectDebuggable.cpp:
(JSC::JSGlobalObjectDebuggable::connect):
(JSC::JSGlobalObjectDebuggable::pause): Deleted.
* runtime/JSGlobalObjectDebuggable.h:
Pass an immediatelyPause boolean on to the controller. Remove
the current path that invokes a pause before initialization.

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
(Inspector::JSGlobalObjectInspectorController::disconnectFrontend):
Manage should immediately pause state.

(Inspector::JSGlobalObjectInspectorController::frontendInitialized):
(Inspector::JSGlobalObjectInspectorController::pause): Deleted.
When initialized, trigger a pause if requested.

Source/WebCore:

* inspector/InspectorController.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
* page/PageDebuggable.h:
Pass an immediatelyPause boolean on to the controller.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):
Manage should immediately pause state.

(WebCore::InspectorController::frontendInitialized):
When initialized, trigger a pause if requested.

Source/WebKit2:

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::connect):
* UIProcess/Automation/WebAutomationSession.h:
Special connection options are ignored in automation sessions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h
Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h
Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.h
Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm
Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp
Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp
Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/page/PageDebuggable.cpp
Source/WebCore/page/PageDebuggable.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit2/UIProcess/Automation/WebAutomationSession.h