Changeset 263580 in webkit


Ignore:
Timestamp:
Jun 26, 2020 1:52:54 PM (4 years ago)
Author:
ggaren@apple.com
Message:

Re-land r262863
https://bugs.webkit.org/show_bug.cgi?id=213654

Reviewed by Tadeu Zagallo.

r263575 should fix the crash we saw.

  • wtf/cocoa/MainThreadCocoa.mm:

(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(-[JSWTFMainThreadCaller call]): Deleted.

Location:
trunk/Source/WTF
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r263575 r263580  
     12020-06-26  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Re-land r262863
     4        https://bugs.webkit.org/show_bug.cgi?id=213654
     5
     6        Reviewed by Tadeu Zagallo.
     7
     8        r263575 should fix the crash we saw.
     9
     10        * wtf/cocoa/MainThreadCocoa.mm:
     11        (WTF::initializeMainThreadPlatform):
     12        (WTF::scheduleDispatchFunctionsOnMainThread):
     13        (-[JSWTFMainThreadCaller call]): Deleted.
     14
    1152020-06-26  Geoffrey Garen  <ggaren@apple.com>
    216
  • trunk/Source/WTF/wtf/RunLoop.cpp

    r263575 r263580  
    6969    ASSERT(s_mainRunLoop);
    7070    return *s_mainRunLoop;
    71 }
    72 
    73 RunLoop* RunLoop::mainIfExists()
    74 {
    75     return s_mainRunLoop;
    7671}
    7772
  • trunk/Source/WTF/wtf/RunLoop.h

    r263575 r263580  
    6767    WTF_EXPORT_PRIVATE static RunLoop& current();
    6868    WTF_EXPORT_PRIVATE static RunLoop& main();
    69     WTF_EXPORT_PRIVATE static RunLoop* mainIfExists();
    7069#if USE(WEB_THREAD)
    7170    WTF_EXPORT_PRIVATE static RunLoop& web();
  • trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm

    r263524 r263580  
    4545#endif
    4646
    47 @interface JSWTFMainThreadCaller : NSObject
    48 - (void)call;
    49 @end
    50 
    51 @implementation JSWTFMainThreadCaller
    52 
    53 - (void)call
    54 {
    55     WTF::dispatchFunctionsFromMainThread();
    56 }
    57 
    58 @end
    59 
    6047#define LOG_CHANNEL_PREFIX Log
    6148
     
    6754WTFLogChannel LogThreading = { WTFLogChannelState::On, "Threading", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
    6855#endif
    69 
    70 static JSWTFMainThreadCaller* staticMainThreadCaller;
    7156
    7257#if USE(WEB_THREAD)
     
    8368        RELEASE_LOG_FAULT(Threading, "WebKit Threading Violation - initial use of WebKit from a secondary thread.");
    8469    ASSERT(pthread_main_np());
    85 
    86     ASSERT(!staticMainThreadCaller);
    87     staticMainThreadCaller = [[JSWTFMainThreadCaller alloc] init];
    8870}
    8971
     
    9779#endif
    9880
    99     if (RunLoop::mainIfExists()) {
    100         RunLoop::main().dispatch(dispatchFunctionsFromMainThread);
    101         return;
    102     }
    103 
    104     [staticMainThreadCaller performSelectorOnMainThread:@selector(call) withObject:nil waitUntilDone:NO];
     81    RunLoop::main().dispatch(dispatchFunctionsFromMainThread);
    10582}
    10683
Note: See TracChangeset for help on using the changeset viewer.