Clean up after r224952
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2017 21:35:30 +0000 (21:35 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2017 21:35:30 +0000 (21:35 +0000)
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224983 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/MainThread.cpp
Source/WTF/wtf/MainThread.h
Source/WTF/wtf/generic/MainThreadGeneric.cpp
Source/WTF/wtf/mac/MainThreadMac.mm
Source/WTF/wtf/win/MainThreadWin.cpp

index a4bcf68..462b683 100644 (file)
@@ -1,3 +1,24 @@
+2017-11-17  Alex Christensen  <achristensen@webkit.org>
+
+        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.
+
 2017-11-15  Alex Christensen  <achristensen@webkit.org>
 
         Fix fast/events/message-port-postMessage-recursive.html after r224896
index 2ff8ebf..0771c93 100644 (file)
@@ -135,14 +135,14 @@ void dispatchFunctionsFromMainThread()
         // yield so the user input can be processed. Otherwise user may not be able to even close the window.
         // This code has effect only in case the scheduleDispatchFunctionsOnMainThread() is implemented in a way that
         // allows input events to be processed before we are back here.
-        if (MonotonicTime::now() - startTime > maxRunLoopSuspensionTime && currentRunLoopInCommonMode()) {
+        if (MonotonicTime::now() - startTime > maxRunLoopSuspensionTime) {
             scheduleDispatchFunctionsOnMainThread();
             break;
         }
     }
 }
 
-void callOnMainThread(Function<void()>&& function, SchedulePairHashSet* pairs)
+void callOnMainThread(Function<void()>&& function)
 {
     ASSERT(function);
 
@@ -155,7 +155,7 @@ void callOnMainThread(Function<void()>&& function, SchedulePairHashSet* pairs)
     }
 
     if (needToSchedule)
-        scheduleDispatchFunctionsOnMainThread(pairs);
+        scheduleDispatchFunctionsOnMainThread();
 }
 
 void setMainThreadCallbacksPaused(bool paused)
index 859255c..15b3784 100644 (file)
 namespace WTF {
 
 class PrintStream;
-class SchedulePair;
-struct SchedulePairHash;
-typedef HashSet<RefPtr<SchedulePair>, SchedulePairHash> SchedulePairHashSet;
 
 // Must be called from the main thread.
 WTF_EXPORT_PRIVATE void initializeMainThread();
 
-WTF_EXPORT_PRIVATE void callOnMainThread(Function<void()>&&, SchedulePairHashSet* = nullptr);
+WTF_EXPORT_PRIVATE void callOnMainThread(Function<void()>&&);
 
 #if PLATFORM(COCOA)
 WTF_EXPORT_PRIVATE void callOnWebThreadOrDispatchAsyncOnMainThread(void (^block)());
@@ -85,9 +82,8 @@ WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread();
 
 // NOTE: these functions are internal to the callOnMainThread implementation.
 void initializeMainThreadPlatform();
-void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet* = nullptr);
+void scheduleDispatchFunctionsOnMainThread();
 void dispatchFunctionsFromMainThread();
-bool currentRunLoopInCommonMode();
 
 #if OS(DARWIN) && !USE(GLIB)
 #if !USE(WEB_THREAD)
index a7115b7..91ad2e5 100644 (file)
@@ -67,12 +67,7 @@ void initializeMainThreadPlatform()
 {
 }
 
-bool currentRunLoopInCommonMode()
-{
-    return true;
-}
-
-void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet*)
+void scheduleDispatchFunctionsOnMainThread()
 {
     // Use a RunLoop::Timer instead of RunLoop::dispatch() to be able to use a different priority and
     // avoid the double queue because dispatchOnMainThread also queues the functions.
index 5700ccd..31d814b 100644 (file)
@@ -122,14 +122,7 @@ static void postTimer()
     CFRunLoopAddTimer(CFRunLoopGetCurrent(), CFRunLoopTimerCreate(0, 0, 0, 0, 0, timerFired, 0), kCFRunLoopCommonModes);
 }
 
-bool currentRunLoopInCommonMode()
-{
-    NSString *currentMode = [[NSRunLoop currentRunLoop] currentMode];
-    return currentMode == (NSString *)kCFRunLoopCommonModes
-        || currentMode == (NSString *)kCFRunLoopDefaultMode;
-}
-
-void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet* pairs)
+void scheduleDispatchFunctionsOnMainThread()
 {
     ASSERT(staticMainThreadCaller);
 
@@ -137,23 +130,15 @@ void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet* pairs)
         postTimer();
         return;
     }
-
-    RetainPtr<NSArray<NSString *>> modes;
-    if (pairs) {
-        modes = adoptNS([[NSMutableArray alloc] initWithCapacity:pairs->size()]);
-        for (auto& pair : *pairs)
-            [(NSMutableArray *)modes.get() addObject:(NSString *)pair->mode()];
-    } else
-        modes = @[(NSString *)kCFRunLoopCommonModes];
     
     if (mainThreadEstablishedAsPthreadMain) {
         ASSERT(!mainThreadNSThread);
-        [staticMainThreadCaller performSelectorOnMainThread:@selector(call) withObject:nil waitUntilDone:NO modes:modes.get()];
+        [staticMainThreadCaller performSelectorOnMainThread:@selector(call) withObject:nil waitUntilDone:NO];
         return;
     }
 
     ASSERT(mainThreadNSThread);
-    [staticMainThreadCaller performSelector:@selector(call) onThread:mainThreadNSThread withObject:nil waitUntilDone:NO modes:modes.get()];
+    [staticMainThreadCaller performSelector:@selector(call) onThread:mainThreadNSThread withObject:nil waitUntilDone:NO];
 }
 
 void callOnWebThreadOrDispatchAsyncOnMainThread(void (^block)())
index 9fec320..a6473d0 100644 (file)
@@ -49,11 +49,6 @@ LRESULT CALLBACK ThreadingWindowWndProc(HWND hWnd, UINT message, WPARAM wParam,
     return 0;
 }
 
-bool currentRunLoopInCommonMode()
-{
-    return true;
-}
-
 void initializeMainThreadPlatform()
 {
     if (threadingWindowHandle)
@@ -72,7 +67,7 @@ void initializeMainThreadPlatform()
     Thread::initializeCurrentThreadInternal("Main Thread");
 }
 
-void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet*)
+void scheduleDispatchFunctionsOnMainThread()
 {
     ASSERT(threadingWindowHandle);
     PostMessage(threadingWindowHandle, threadingFiredMessage, 0, 0);