⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 290128 in webkit


Ignore:
Timestamp:
Feb 18, 2022, 8:41:41 AM (5 years ago)
Author:
Tyler Wilcock
Message:

AX: isAXAuthenticatedCallback must be handled on the main runloop
​https://bugs.webkit.org/show_bug.cgi?id=236789

Reviewed by Chris Fleizach.

isAXAuthenticatedCallback in WebProcessCocoa.mm performs IPC to the UI process
to determine if the given auditToken is valid. This causes a crash with isolated
tree mode enabled as IPC must be performed on the main thread / runloop.

This patch changes this function to dispatch to the main runloop.

  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::isAXAuthenticatedCallback):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r290117 r290128  
     12022-02-18  Tyler Wilcock  <tyler_w@apple.com>
     2
     3        AX: isAXAuthenticatedCallback must be handled on the main runloop
     4        https://bugs.webkit.org/show_bug.cgi?id=236789
     5
     6        Reviewed by Chris Fleizach.
     7
     8        isAXAuthenticatedCallback in WebProcessCocoa.mm performs IPC to the UI process
     9        to determine if the given auditToken is valid. This causes a crash with isolated
     10        tree mode enabled as IPC must be performed on the main thread / runloop.
     11
     12        This patch changes this function to dispatch to the main runloop.
     13
     14        * WebProcess/cocoa/WebProcessCocoa.mm:
     15        (WebKit::isAXAuthenticatedCallback):
     16
    1172022-02-18  Saam Barati  <sbarati@apple.com>
    218
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r289147 r290128  
    225225{
    226226    bool authenticated = false;
    227     WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebProcessProxy::IsAXAuthenticated(auditToken), Messages::WebProcessProxy::IsAXAuthenticated::Reply(authenticated), 0);
     227    // IPC must be done on the main runloop, so dispatch it to avoid crashes when the secondary AX thread handles this callback.
     228    callOnMainRunLoopAndWait([&authenticated, auditToken] {
     229        WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebProcessProxy::IsAXAuthenticated(auditToken), Messages::WebProcessProxy::IsAXAuthenticated::Reply(authenticated), 0);
     230    });
    228231    return authenticated;
    229232}
Note: See TracChangeset for help on using the changeset viewer.