Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (217508 => 217509)
--- trunk/Source/_javascript_Core/ChangeLog 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-05-26 22:56:56 UTC (rev 217509)
@@ -1,3 +1,40 @@
+2017-05-26 Joseph Pecoraro <[email protected]>
+
+ JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
+ https://bugs.webkit.org/show_bug.cgi?id=172664
+ <rdar://problem/32362933>
+
+ Reviewed by Matt Baker.
+
+ 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.
+
2017-05-26 Mark Lam <[email protected]>
Temporarily commenting out a JSExportTest test until webkit.org/b/172654 is fixed.
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp (217508 => 217509)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp 2017-05-26 22:56:56 UTC (rev 217509)
@@ -118,11 +118,12 @@
m_agents.discardValues();
}
-void JSGlobalObjectInspectorController::connectFrontend(FrontendChannel* frontendChannel, bool isAutomaticInspection)
+void JSGlobalObjectInspectorController::connectFrontend(FrontendChannel* frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
{
ASSERT_ARG(frontendChannel, frontendChannel);
m_isAutomaticInspection = isAutomaticInspection;
+ m_pauseAfterInitialization = immediatelyPause;
bool connectedFirstFrontend = !m_frontendRouter->hasFrontends();
m_frontendRouter->connectFrontend(frontendChannel);
@@ -155,6 +156,7 @@
m_frontendRouter->disconnectFrontend(frontendChannel);
m_isAutomaticInspection = false;
+ m_pauseAfterInitialization = false;
bool disconnectedLastFrontend = !m_frontendRouter->hasFrontends();
if (!disconnectedLastFrontend)
@@ -175,13 +177,6 @@
m_backendDispatcher->dispatch(message);
}
-void JSGlobalObjectInspectorController::pause()
-{
- ErrorString dummyError;
- m_debuggerAgent->enable(dummyError);
- m_debuggerAgent->pause(dummyError);
-}
-
void JSGlobalObjectInspectorController::appendAPIBacktrace(ScriptCallStack& callStack)
{
#if OS(DARWIN) || (OS(LINUX) && !PLATFORM(GTK))
@@ -265,6 +260,13 @@
void JSGlobalObjectInspectorController::frontendInitialized()
{
+ if (m_pauseAfterInitialization) {
+ m_pauseAfterInitialization = false;
+ ErrorString ignored;
+ m_debuggerAgent->enable(ignored);
+ m_debuggerAgent->pause(ignored);
+ }
+
#if ENABLE(REMOTE_INSPECTOR)
if (m_isAutomaticInspection)
m_globalObject.inspectorDebuggable().unpauseForInitializedInspector();
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h (217508 => 217509)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h 2017-05-26 22:56:56 UTC (rev 217509)
@@ -68,7 +68,7 @@
JSGlobalObjectInspectorController(JSC::JSGlobalObject&);
~JSGlobalObjectInspectorController();
- void connectFrontend(FrontendChannel*, bool isAutomaticInspection);
+ void connectFrontend(FrontendChannel*, bool isAutomaticInspection, bool immediatelyPause);
void disconnectFrontend(FrontendChannel*);
void dispatchMessageFromFrontend(const String&);
@@ -78,7 +78,6 @@
bool includesNativeCallStackWhenReportingExceptions() const { return m_includeNativeCallStackWithExceptions; }
void setIncludesNativeCallStackWhenReportingExceptions(bool includesNativeCallStack) { m_includeNativeCallStackWithExceptions = includesNativeCallStack; }
- void pause();
void reportAPIException(JSC::ExecState*, JSC::Exception*);
JSC::ConsoleClient* consoleClient() const;
@@ -124,6 +123,7 @@
bool m_includeNativeCallStackWithExceptions { true };
bool m_isAutomaticInspection { false };
+ bool m_pauseAfterInitialization { false };
#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
AugmentableInspectorControllerClient* m_augmentingClient { nullptr };
Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteControllableTarget.h (217508 => 217509)
--- trunk/Source/_javascript_Core/inspector/remote/RemoteControllableTarget.h 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteControllableTarget.h 2017-05-26 22:56:56 UTC (rev 217509)
@@ -45,7 +45,7 @@
void init();
void update();
- virtual void connect(FrontendChannel*, bool isAutomaticConnection = false) = 0;
+ virtual void connect(FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) = 0;
virtual void disconnect(FrontendChannel*) = 0;
unsigned targetIdentifier() const { return m_identifier; }
Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectionTarget.h (217508 => 217509)
--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectionTarget.h 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectionTarget.h 2017-05-26 22:56:56 UTC (rev 217509)
@@ -51,7 +51,6 @@
virtual bool hasLocalDebugger() const = 0;
virtual void setIndicating(bool) { } // Default is to do nothing.
- virtual void pause() { };
virtual bool automaticInspectionAllowed() const { return false; }
virtual void pauseWaitingForAutomaticInspection();
Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm (217508 => 217509)
--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm 2017-05-26 22:56:56 UTC (rev 217509)
@@ -171,12 +171,9 @@
m_target = nullptr;
} else if (is<RemoteInspectionTarget>(m_target)) {
auto castedTarget = downcast<RemoteInspectionTarget>(m_target);
- castedTarget->connect(this, isAutomaticInspection);
+ castedTarget->connect(this, isAutomaticInspection, automaticallyPause);
m_connected = true;
- if (automaticallyPause)
- castedTarget->pause();
-
RemoteInspector::singleton().updateTargetListing(targetIdentifier);
} else if (is<RemoteAutomationTarget>(m_target)) {
auto castedTarget = downcast<RemoteAutomationTarget>(m_target);
Modified: trunk/Source/_javascript_Core/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp (217508 => 217509)
--- trunk/Source/_javascript_Core/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp 2017-05-26 22:56:56 UTC (rev 217509)
@@ -56,12 +56,9 @@
m_target = nullptr;
} else if (is<RemoteInspectionTarget>(m_target)) {
auto target = downcast<RemoteInspectionTarget>(m_target);
- target->connect(this, isAutomaticInspection);
+ target->connect(this, isAutomaticInspection, automaticallyPause);
m_connected = true;
- if (automaticallyPause)
- target->pause();
-
RemoteInspector::singleton().updateTargetListing(targetIdentifier);
} else if (is<RemoteAutomationTarget>(m_target)) {
auto target = downcast<RemoteAutomationTarget>(m_target);
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp (217508 => 217509)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp 2017-05-26 22:56:56 UTC (rev 217509)
@@ -49,11 +49,11 @@
return name.isEmpty() ? ASCIILiteral("JSContext") : name;
}
-void JSGlobalObjectDebuggable::connect(FrontendChannel* frontendChannel, bool automaticInspection)
+void JSGlobalObjectDebuggable::connect(FrontendChannel* frontendChannel, bool automaticInspection, bool immediatelyPause)
{
JSLockHolder locker(&m_globalObject.vm());
- m_globalObject.inspectorController().connectFrontend(frontendChannel, automaticInspection);
+ m_globalObject.inspectorController().connectFrontend(frontendChannel, automaticInspection, immediatelyPause);
}
void JSGlobalObjectDebuggable::disconnect(FrontendChannel* frontendChannel)
@@ -63,13 +63,6 @@
m_globalObject.inspectorController().disconnectFrontend(frontendChannel);
}
-void JSGlobalObjectDebuggable::pause()
-{
- JSLockHolder locker(&m_globalObject.vm());
-
- m_globalObject.inspectorController().pause();
-}
-
void JSGlobalObjectDebuggable::dispatchMessageFromRemote(const String& message)
{
JSLockHolder locker(&m_globalObject.vm());
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h (217508 => 217509)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h 2017-05-26 22:56:56 UTC (rev 217509)
@@ -52,10 +52,9 @@
String name() const override;
bool hasLocalDebugger() const override { return false; }
- void connect(Inspector::FrontendChannel*, bool automaticInspection) override;
+ void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) override;
void disconnect(Inspector::FrontendChannel*) override;
void dispatchMessageFromRemote(const String& message) override;
- void pause() override;
bool automaticInspectionAllowed() const override { return true; }
void pauseWaitingForAutomaticInspection() override;
Modified: trunk/Source/WebCore/ChangeLog (217508 => 217509)
--- trunk/Source/WebCore/ChangeLog 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebCore/ChangeLog 2017-05-26 22:56:56 UTC (rev 217509)
@@ -1,3 +1,26 @@
+2017-05-26 Joseph Pecoraro <[email protected]>
+
+ JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
+ https://bugs.webkit.org/show_bug.cgi?id=172664
+ <rdar://problem/32362933>
+
+ Reviewed by Matt Baker.
+
+ * 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.
+
2017-05-26 Don Olmstead <[email protected]>
[CMake] Consolidate CMake code related to FreeType
Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (217508 => 217509)
--- trunk/Source/WebCore/inspector/InspectorController.cpp 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp 2017-05-26 22:56:56 UTC (rev 217509)
@@ -246,7 +246,7 @@
m_inspectorFrontendClient->windowObjectCleared();
}
-void InspectorController::connectFrontend(Inspector::FrontendChannel* frontendChannel, bool isAutomaticInspection)
+void InspectorController::connectFrontend(Inspector::FrontendChannel* frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
{
ASSERT_ARG(frontendChannel, frontendChannel);
ASSERT(m_inspectorClient);
@@ -253,6 +253,7 @@
bool connectedFirstFrontend = !m_frontendRouter->hasFrontends();
m_isAutomaticInspection = isAutomaticInspection;
+ m_pauseAfterInitialization = immediatelyPause;
m_frontendRouter->connectFrontend(frontendChannel);
@@ -272,7 +273,9 @@
void InspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
{
m_frontendRouter->disconnectFrontend(frontendChannel);
+
m_isAutomaticInspection = false;
+ m_pauseAfterInitialization = false;
InspectorInstrumentation::frontendDeleted();
@@ -323,6 +326,7 @@
// Disconnect any remaining remote frontends.
m_frontendRouter->disconnectAllFrontends();
m_isAutomaticInspection = false;
+ m_pauseAfterInitialization = false;
#if ENABLE(REMOTE_INSPECTOR)
m_page.remoteInspectorInformationDidChange();
@@ -455,6 +459,14 @@
void InspectorController::frontendInitialized()
{
+ if (m_pauseAfterInitialization) {
+ m_pauseAfterInitialization = false;
+ if (PageDebuggerAgent* debuggerAgent = m_instrumentingAgents->pageDebuggerAgent()) {
+ ErrorString ignored;
+ debuggerAgent->pause(ignored);
+ }
+ }
+
#if ENABLE(REMOTE_INSPECTOR)
if (m_isAutomaticInspection)
m_page.inspectorDebuggable().unpauseForInitializedInspector();
Modified: trunk/Source/WebCore/inspector/InspectorController.h (217508 => 217509)
--- trunk/Source/WebCore/inspector/InspectorController.h 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebCore/inspector/InspectorController.h 2017-05-26 22:56:56 UTC (rev 217509)
@@ -90,7 +90,7 @@
bool hasLocalFrontend() const;
bool hasRemoteFrontend() const;
- WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection = false);
+ WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection = false, bool immediatelyPause = false);
WEBCORE_EXPORT void disconnectFrontend(Inspector::FrontendChannel*);
WEBCORE_EXPORT void disconnectAllFrontends();
void setProcessId(long);
@@ -147,6 +147,7 @@
bool m_isUnderTest { false };
bool m_isAutomaticInspection { false };
+ bool m_pauseAfterInitialization = { false };
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/PageDebuggable.cpp (217508 => 217509)
--- trunk/Source/WebCore/page/PageDebuggable.cpp 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebCore/page/PageDebuggable.cpp 2017-05-26 22:56:56 UTC (rev 217509)
@@ -70,7 +70,7 @@
return m_page.inspectorController().hasLocalFrontend();
}
-void PageDebuggable::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection)
+void PageDebuggable::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
{
if (!m_page.settings().developerExtrasEnabled()) {
m_forcedDeveloperExtrasEnabled = true;
@@ -79,7 +79,7 @@
m_forcedDeveloperExtrasEnabled = false;
InspectorController& inspectorController = m_page.inspectorController();
- inspectorController.connectFrontend(channel, isAutomaticConnection);
+ inspectorController.connectFrontend(channel, isAutomaticConnection, immediatelyPause);
}
void PageDebuggable::disconnect(Inspector::FrontendChannel* channel)
Modified: trunk/Source/WebCore/page/PageDebuggable.h (217508 => 217509)
--- trunk/Source/WebCore/page/PageDebuggable.h 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebCore/page/PageDebuggable.h 2017-05-26 22:56:56 UTC (rev 217509)
@@ -47,7 +47,7 @@
String url() const override;
bool hasLocalDebugger() const override;
- void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false) override;
+ void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) override;
void disconnect(Inspector::FrontendChannel*) override;
void dispatchMessageFromRemote(const String& message) override;
void setIndicating(bool) override;
Modified: trunk/Source/WebKit2/ChangeLog (217508 => 217509)
--- trunk/Source/WebKit2/ChangeLog 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebKit2/ChangeLog 2017-05-26 22:56:56 UTC (rev 217509)
@@ -1,3 +1,16 @@
+2017-05-26 Joseph Pecoraro <[email protected]>
+
+ JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
+ https://bugs.webkit.org/show_bug.cgi?id=172664
+ <rdar://problem/32362933>
+
+ Reviewed by Matt Baker.
+
+ * UIProcess/Automation/WebAutomationSession.cpp:
+ (WebKit::WebAutomationSession::connect):
+ * UIProcess/Automation/WebAutomationSession.h:
+ Special connection options are ignored in automation sessions.
+
2017-05-26 Commit Queue <[email protected]>
Unreviewed, rolling out r217479.
Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp (217508 => 217509)
--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp 2017-05-26 22:56:56 UTC (rev 217509)
@@ -91,9 +91,10 @@
m_backendDispatcher->dispatch(message);
}
-void WebAutomationSession::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection)
+void WebAutomationSession::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
{
UNUSED_PARAM(isAutomaticConnection);
+ UNUSED_PARAM(immediatelyPause);
m_remoteChannel = channel;
m_frontendRouter->connectFrontend(channel);
Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h (217508 => 217509)
--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h 2017-05-26 21:41:19 UTC (rev 217508)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h 2017-05-26 22:56:56 UTC (rev 217509)
@@ -94,7 +94,7 @@
// Inspector::RemoteAutomationTarget API
String name() const override { return m_sessionIdentifier; }
void dispatchMessageFromRemote(const String& message) override;
- void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false) override;
+ void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) override;
void disconnect(Inspector::FrontendChannel*) override;
#endif
void terminate();