Title: [230675] trunk/Source/WebKit
Revision
230675
Author
bb...@apple.com
Date
2018-04-16 11:53:50 -0700 (Mon, 16 Apr 2018)

Log Message

[Cocoa] Web Automation: add SPI to terminate automation session and disconnect the remote end
https://bugs.webkit.org/show_bug.cgi?id=184523
<rdar://problem/39368599>

Reviewed by Simon Fraser.

When a user breaks the automation glass pane and chooses "Stop Session", there is no way
for Safari to actually disconnect the remote connection using automation-related ObjC SPI.
This can lead to sessions getting stuck and safaridriver is unable to request a new session.

Expose the -terminate method as SPI. This disconnects the remote connection and then notifies
the session delegate that the remote disconnected. At that point, Safari can uninstall
the session from the process pool and tear down other session state.

* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKAutomationSession.mm:
(-[_WKAutomationSession terminate]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (230674 => 230675)


--- trunk/Source/WebKit/ChangeLog	2018-04-16 18:33:13 UTC (rev 230674)
+++ trunk/Source/WebKit/ChangeLog	2018-04-16 18:53:50 UTC (rev 230675)
@@ -1,3 +1,23 @@
+2018-04-16  Brian Burg  <bb...@apple.com>
+
+        [Cocoa] Web Automation: add SPI to terminate automation session and disconnect the remote end
+        https://bugs.webkit.org/show_bug.cgi?id=184523
+        <rdar://problem/39368599>
+
+        Reviewed by Simon Fraser.
+
+        When a user breaks the automation glass pane and chooses "Stop Session", there is no way
+        for Safari to actually disconnect the remote connection using automation-related ObjC SPI.
+        This can lead to sessions getting stuck and safaridriver is unable to request a new session.
+
+        Expose the -terminate method as SPI. This disconnects the remote connection and then notifies
+        the session delegate that the remote disconnected. At that point, Safari can uninstall
+        the session from the process pool and tear down other session state.
+
+        * UIProcess/API/Cocoa/_WKAutomationSession.h:
+        * UIProcess/API/Cocoa/_WKAutomationSession.mm:
+        (-[_WKAutomationSession terminate]):
+
 2018-04-16  Timothy Hatcher  <timo...@apple.com>
 
         Clean up OTHER_LDFLAGS for WebKit processes

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h (230674 => 230675)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h	2018-04-16 18:33:13 UTC (rev 230674)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h	2018-04-16 18:53:50 UTC (rev 230675)
@@ -47,6 +47,8 @@
 
 - (instancetype)initWithConfiguration:(_WKAutomationSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
 
+- (void)terminate WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+
 #if !TARGET_OS_IPHONE
 - (BOOL)wasEventSynthesizedForAutomation:(NSEvent *)event;
 - (void)markEventAsSynthesizedForAutomation:(NSEvent *)event;

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.mm (230674 => 230675)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.mm	2018-04-16 18:33:13 UTC (rev 230674)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.mm	2018-04-16 18:53:50 UTC (rev 230675)
@@ -102,6 +102,11 @@
     return _session->isSimulatingUserInteraction();
 }
 
+- (void)terminate
+{
+    _session->terminate();
+}
+
 #if PLATFORM(MAC)
 - (BOOL)wasEventSynthesizedForAutomation:(NSEvent *)event
 {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to