Changeset 230675 in webkit


Ignore:
Timestamp:
Apr 16, 2018 11:53:50 AM (6 years ago)
Author:
BJ Burg
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]):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r230673 r230675  
     12018-04-16  Brian Burg  <bburg@apple.com>
     2
     3        [Cocoa] Web Automation: add SPI to terminate automation session and disconnect the remote end
     4        https://bugs.webkit.org/show_bug.cgi?id=184523
     5        <rdar://problem/39368599>
     6
     7        Reviewed by Simon Fraser.
     8
     9        When a user breaks the automation glass pane and chooses "Stop Session", there is no way
     10        for Safari to actually disconnect the remote connection using automation-related ObjC SPI.
     11        This can lead to sessions getting stuck and safaridriver is unable to request a new session.
     12
     13        Expose the -terminate method as SPI. This disconnects the remote connection and then notifies
     14        the session delegate that the remote disconnected. At that point, Safari can uninstall
     15        the session from the process pool and tear down other session state.
     16
     17        * UIProcess/API/Cocoa/_WKAutomationSession.h:
     18        * UIProcess/API/Cocoa/_WKAutomationSession.mm:
     19        (-[_WKAutomationSession terminate]):
     20
    1212018-04-16  Timothy Hatcher  <timothy@apple.com>
    222
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h

    r230121 r230675  
    4848- (instancetype)initWithConfiguration:(_WKAutomationSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
    4949
     50- (void)terminate WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
     51
    5052#if !TARGET_OS_IPHONE
    5153- (BOOL)wasEventSynthesizedForAutomation:(NSEvent *)event;
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.mm

    r223880 r230675  
    103103}
    104104
     105- (void)terminate
     106{
     107    _session->terminate();
     108}
     109
    105110#if PLATFORM(MAC)
    106111- (BOOL)wasEventSynthesizedForAutomation:(NSEvent *)event
Note: See TracChangeset for help on using the changeset viewer.