Diff
Modified: trunk/Source/WTF/ChangeLog (224982 => 224983)
--- trunk/Source/WTF/ChangeLog 2017-11-17 21:33:28 UTC (rev 224982)
+++ trunk/Source/WTF/ChangeLog 2017-11-17 21:35:30 UTC (rev 224983)
@@ -1,3 +1,24 @@
+2017-11-17 Alex Christensen <[email protected]>
+
+ 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 <[email protected]>
Fix fast/events/message-port-postMessage-recursive.html after r224896
Modified: trunk/Source/WTF/wtf/MainThread.cpp (224982 => 224983)
--- trunk/Source/WTF/wtf/MainThread.cpp 2017-11-17 21:33:28 UTC (rev 224982)
+++ trunk/Source/WTF/wtf/MainThread.cpp 2017-11-17 21:35:30 UTC (rev 224983)
@@ -135,7 +135,7 @@
// 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;
}
@@ -142,7 +142,7 @@
}
}
-void callOnMainThread(Function<void()>&& function, SchedulePairHashSet* pairs)
+void callOnMainThread(Function<void()>&& function)
{
ASSERT(function);
@@ -155,7 +155,7 @@
}
if (needToSchedule)
- scheduleDispatchFunctionsOnMainThread(pairs);
+ scheduleDispatchFunctionsOnMainThread();
}
void setMainThreadCallbacksPaused(bool paused)
Modified: trunk/Source/WTF/wtf/MainThread.h (224982 => 224983)
--- trunk/Source/WTF/wtf/MainThread.h 2017-11-17 21:33:28 UTC (rev 224982)
+++ trunk/Source/WTF/wtf/MainThread.h 2017-11-17 21:35:30 UTC (rev 224983)
@@ -39,14 +39,11 @@
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 @@
// 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)
Modified: trunk/Source/WTF/wtf/generic/MainThreadGeneric.cpp (224982 => 224983)
--- trunk/Source/WTF/wtf/generic/MainThreadGeneric.cpp 2017-11-17 21:33:28 UTC (rev 224982)
+++ trunk/Source/WTF/wtf/generic/MainThreadGeneric.cpp 2017-11-17 21:35:30 UTC (rev 224983)
@@ -67,13 +67,8 @@
{
}
-bool currentRunLoopInCommonMode()
+void scheduleDispatchFunctionsOnMainThread()
{
- return true;
-}
-
-void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet*)
-{
// 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.
static MainThreadDispatcher dispatcher;
Modified: trunk/Source/WTF/wtf/mac/MainThreadMac.mm (224982 => 224983)
--- trunk/Source/WTF/wtf/mac/MainThreadMac.mm 2017-11-17 21:33:28 UTC (rev 224982)
+++ trunk/Source/WTF/wtf/mac/MainThreadMac.mm 2017-11-17 21:35:30 UTC (rev 224983)
@@ -122,15 +122,8 @@
CFRunLoopAddTimer(CFRunLoopGetCurrent(), CFRunLoopTimerCreate(0, 0, 0, 0, 0, timerFired, 0), kCFRunLoopCommonModes);
}
-bool currentRunLoopInCommonMode()
+void scheduleDispatchFunctionsOnMainThread()
{
- NSString *currentMode = [[NSRunLoop currentRunLoop] currentMode];
- return currentMode == (NSString *)kCFRunLoopCommonModes
- || currentMode == (NSString *)kCFRunLoopDefaultMode;
-}
-
-void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet* pairs)
-{
ASSERT(staticMainThreadCaller);
if (isWebThread()) {
@@ -137,23 +130,15 @@
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)())
Modified: trunk/Source/WTF/wtf/win/MainThreadWin.cpp (224982 => 224983)
--- trunk/Source/WTF/wtf/win/MainThreadWin.cpp 2017-11-17 21:33:28 UTC (rev 224982)
+++ trunk/Source/WTF/wtf/win/MainThreadWin.cpp 2017-11-17 21:35:30 UTC (rev 224983)
@@ -49,11 +49,6 @@
return 0;
}
-bool currentRunLoopInCommonMode()
-{
- return true;
-}
-
void initializeMainThreadPlatform()
{
if (threadingWindowHandle)
@@ -72,7 +67,7 @@
Thread::initializeCurrentThreadInternal("Main Thread");
}
-void scheduleDispatchFunctionsOnMainThread(SchedulePairHashSet*)
+void scheduleDispatchFunctionsOnMainThread()
{
ASSERT(threadingWindowHandle);
PostMessage(threadingWindowHandle, threadingFiredMessage, 0, 0);