Changeset 224983 in webkit


Ignore:
Timestamp:
Nov 17, 2017, 1:35:30 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Clean up after r224952
https://bugs.webkit.org/show_bug.cgi?id=179809

Reviewed by Brady Eidson.

  • wtf/MainThread.cpp:

(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):

  • wtf/MainThread.h:
  • wtf/generic/MainThreadGeneric.cpp:

(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::currentRunLoopInCommonMode): Deleted.

  • wtf/mac/MainThreadMac.mm:

(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::currentRunLoopInCommonMode): Deleted.

  • wtf/win/MainThreadWin.cpp:

(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::currentRunLoopInCommonMode): Deleted.

Location:
trunk/Source/WTF
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r224907 r224983  
     12017-11-17  Alex Christensen  <achristensen@webkit.org>
     2
     3        Clean up after r224952
     4        https://bugs.webkit.org/show_bug.cgi?id=179809
     5
     6        Reviewed by Brady Eidson.
     7
     8        * wtf/MainThread.cpp:
     9        (WTF::dispatchFunctionsFromMainThread):
     10        (WTF::callOnMainThread):
     11        * wtf/MainThread.h:
     12        * wtf/generic/MainThreadGeneric.cpp:
     13        (WTF::scheduleDispatchFunctionsOnMainThread):
     14        (WTF::currentRunLoopInCommonMode): Deleted.
     15        * wtf/mac/MainThreadMac.mm:
     16        (WTF::scheduleDispatchFunctionsOnMainThread):
     17        (WTF::currentRunLoopInCommonMode): Deleted.
     18        * wtf/win/MainThreadWin.cpp:
     19        (WTF::scheduleDispatchFunctionsOnMainThread):
     20        (WTF::currentRunLoopInCommonMode): Deleted.
     21
    1222017-11-15  Alex Christensen  <achristensen@webkit.org>
    223
  • trunk/Source/WTF/wtf/MainThread.cpp

    r224896 r224983  
    136136        // This code has effect only in case the scheduleDispatchFunctionsOnMainThread() is implemented in a way that
    137137        // allows input events to be processed before we are back here.
    138         if (MonotonicTime::now() - startTime > maxRunLoopSuspensionTime && currentRunLoopInCommonMode()) {
     138        if (MonotonicTime::now() - startTime > maxRunLoopSuspensionTime) {
    139139            scheduleDispatchFunctionsOnMainThread();
    140140            break;
     
    143143}
    144144
    145 void callOnMainThread(Function<void()>&& function, SchedulePairHashSet* pairs)
     145void callOnMainThread(Function<void()>&& function)
    146146{
    147147    ASSERT(function);
     
    156156
    157157    if (needToSchedule)
    158         scheduleDispatchFunctionsOnMainThread(pairs);
     158        scheduleDispatchFunctionsOnMainThread();
    159159}
    160160
  • trunk/Source/WTF/wtf/MainThread.h

    r224896 r224983  
    4040
    4141class PrintStream;
    42 class SchedulePair;
    43 struct SchedulePairHash;
    44 typedef HashSet<RefPtr<SchedulePair>, SchedulePairHash> SchedulePairHashSet;
    4542
    4643// Must be called from the main thread.
    4744WTF_EXPORT_PRIVATE void initializeMainThread();
    4845
    49 WTF_EXPORT_PRIVATE void callOnMainThread(Function<void()>&&, SchedulePairHashSet* = nullptr);
     46WTF_EXPORT_PRIVATE void callOnMainThread(Function<void()>&&);
    5047
    5148#if PLATFORM(COCOA)
     
    8683// NOTE: these functions are internal to the callOnMainThread implementation.
    8784void initializeMainThreadPlatform();
    88 void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet* = nullptr);
     85void scheduleDispatchFunctionsOnMainThread();
    8986void dispatchFunctionsFromMainThread();
    90 bool currentRunLoopInCommonMode();
    9187
    9288#if OS(DARWIN) && !USE(GLIB)
  • trunk/Source/WTF/wtf/generic/MainThreadGeneric.cpp

    r224896 r224983  
    6868}
    6969
    70 bool currentRunLoopInCommonMode()
    71 {
    72     return true;
    73 }
    74 
    75 void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet*)
     70void scheduleDispatchFunctionsOnMainThread()
    7671{
    7772    // Use a RunLoop::Timer instead of RunLoop::dispatch() to be able to use a different priority and
  • trunk/Source/WTF/wtf/mac/MainThreadMac.mm

    r224907 r224983  
    123123}
    124124
    125 bool currentRunLoopInCommonMode()
    126 {
    127     NSString *currentMode = [[NSRunLoop currentRunLoop] currentMode];
    128     return currentMode == (NSString *)kCFRunLoopCommonModes
    129         || currentMode == (NSString *)kCFRunLoopDefaultMode;
    130 }
    131 
    132 void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet* pairs)
     125void scheduleDispatchFunctionsOnMainThread()
    133126{
    134127    ASSERT(staticMainThreadCaller);
     
    138131        return;
    139132    }
    140 
    141     RetainPtr<NSArray<NSString *>> modes;
    142     if (pairs) {
    143         modes = adoptNS([[NSMutableArray alloc] initWithCapacity:pairs->size()]);
    144         for (auto& pair : *pairs)
    145             [(NSMutableArray *)modes.get() addObject:(NSString *)pair->mode()];
    146     } else
    147         modes = @[(NSString *)kCFRunLoopCommonModes];
    148133   
    149134    if (mainThreadEstablishedAsPthreadMain) {
    150135        ASSERT(!mainThreadNSThread);
    151         [staticMainThreadCaller performSelectorOnMainThread:@selector(call) withObject:nil waitUntilDone:NO modes:modes.get()];
     136        [staticMainThreadCaller performSelectorOnMainThread:@selector(call) withObject:nil waitUntilDone:NO];
    152137        return;
    153138    }
    154139
    155140    ASSERT(mainThreadNSThread);
    156     [staticMainThreadCaller performSelector:@selector(call) onThread:mainThreadNSThread withObject:nil waitUntilDone:NO modes:modes.get()];
     141    [staticMainThreadCaller performSelector:@selector(call) onThread:mainThreadNSThread withObject:nil waitUntilDone:NO];
    157142}
    158143
  • trunk/Source/WTF/wtf/win/MainThreadWin.cpp

    r224896 r224983  
    5050}
    5151
    52 bool currentRunLoopInCommonMode()
    53 {
    54     return true;
    55 }
    56 
    5752void initializeMainThreadPlatform()
    5853{
     
    7368}
    7469
    75 void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet*)
     70void scheduleDispatchFunctionsOnMainThread()
    7671{
    7772    ASSERT(threadingWindowHandle);
Note: See TracChangeset for help on using the changeset viewer.