Changeset 271887 in webkit


Ignore:
Timestamp:
Jan 26, 2021, 10:52:40 AM (4 years ago)
Author:
achristensen@apple.com
Message:

Revert part of r271493
https://bugs.webkit.org/show_bug.cgi?id=220066
<rdar://problem/73615999>

We have an internal app that calls registerSchemeForCustomProtocol on a non-main thread before WebKit initializes.
While this is a problem, we have to not crash on launch until they fix this.

  • UIProcess/API/Cocoa/WKBrowsingContextController.mm:

(+[WKBrowsingContextController registerSchemeForCustomProtocol:]):
(+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r271885 r271887  
     12021-01-26  Alex Christensen  <achristensen@webkit.org>
     2
     3        Revert part of r271493
     4        https://bugs.webkit.org/show_bug.cgi?id=220066
     5        <rdar://problem/73615999>
     6
     7        We have an internal app that calls registerSchemeForCustomProtocol on a non-main thread before WebKit initializes.
     8        While this is a problem, we have to not crash on launch until they fix this.
     9
     10        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
     11        (+[WKBrowsingContextController registerSchemeForCustomProtocol:]):
     12        (+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]):
     13
    1142021-01-26  Per Arne  <pvollan@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm

    r271493 r271887  
    106106        WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme);
    107107    else {
    108         RunLoop::main().dispatch([scheme = retainPtr(scheme)] {
     108        // This cannot be RunLoop::main().dispatch because it is called before the main runloop is initialized.  See rdar://problem/73615999
     109        dispatch_async(dispatch_get_main_queue(), makeBlockPtr([scheme = retainPtr(scheme)] {
    109110            WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme.get());
    110         });
     111        }).get());
    111112    }
    112113}
     
    117118        WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme);
    118119    else {
    119         RunLoop::main().dispatch([scheme = retainPtr(scheme)] {
     120        // This cannot be RunLoop::main().dispatch because it is called before the main runloop is initialized.  See rdar://problem/73615999
     121        dispatch_async(dispatch_get_main_queue(), makeBlockPtr([scheme = retainPtr(scheme)] {
    120122            WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme.get());
    121         });
     123        }).get());
    122124    }
    123125}
Note: See TracChangeset for help on using the changeset viewer.