Changeset 264993 in webkit
- Timestamp:
- Jul 28, 2020 10:03:00 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r264955 r264993 1 2020-07-28 Karl Rackler <rackler@apple.com> 2 3 Unreviewed, reverting r264955. 4 5 Reverting because this commit may have caused issues with 6 tests. 7 8 Reverted changeset: 9 10 "WebCoreResourceHandleAsOperationQueueDelegate can use 11 RunLoop::dispatch" 12 https://bugs.webkit.org/show_bug.cgi?id=214771 13 https://trac.webkit.org/changeset/264955 14 1 15 2020-07-27 Geoffrey Garen <ggaren@apple.com> 2 16 -
trunk/Source/WTF/wtf/cf/RunLoopCF.cpp
r264955 r264993 87 87 void RunLoop::dispatch(const SchedulePairHashSet& schedulePairs, Function<void()>&& function) 88 88 { 89 if (schedulePairs.size() == 1) {90 auto& schedulePair = *schedulePairs.begin();91 if (schedulePair->mode() == kCFRunLoopCommonModes && schedulePair->runLoop() == RunLoop::main().m_runLoop)92 return RunLoop::main().dispatch(WTFMove(function));93 }94 95 89 auto timer = createTimer(0_s, false, [] (CFRunLoopTimerRef timer, void* context) { 96 90 AutodrainedPool pool; -
trunk/Source/WebCore/ChangeLog
r264992 r264993 1 2020-07-28 Karl Rackler <rackler@apple.com> 2 3 Unreviewed, reverting r264955. 4 5 Reverting because this commit may have caused issues with 6 tests. 7 8 Reverted changeset: 9 10 "WebCoreResourceHandleAsOperationQueueDelegate can use 11 RunLoop::dispatch" 12 https://bugs.webkit.org/show_bug.cgi?id=214771 13 https://trac.webkit.org/changeset/264955 14 1 15 2020-07-28 Saam Barati <sbarati@apple.com> 2 16 -
trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
r264955 r264993 41 41 #import <wtf/BlockPtr.h> 42 42 #import <wtf/MainThread.h> 43 #import <wtf/RunLoop.h>44 43 45 44 using namespace WebCore; 45 46 static bool scheduledWithCustomRunLoopMode(const Optional<SchedulePairHashSet>& pairs) 47 { 48 if (!pairs) 49 return false; 50 for (auto& pair : *pairs) { 51 auto mode = pair->mode(); 52 if (mode != kCFRunLoopCommonModes && mode != kCFRunLoopDefaultMode) 53 return true; 54 } 55 return false; 56 } 46 57 47 58 @implementation WebCoreResourceHandleAsOperationQueueDelegate … … 53 64 return m_messageQueue->append(makeUnique<Function<void()>>(WTFMove(function))); 54 65 55 if (!m_scheduledPairs) 66 // This is the common case. 67 if (!scheduledWithCustomRunLoopMode(m_scheduledPairs)) 56 68 return callOnMainThread(WTFMove(function)); 57 69 58 RunLoop::dispatch(*m_scheduledPairs, WTFMove(function)); 70 // If we have been scheduled in a custom run loop mode, schedule a block in that mode. 71 auto block = makeBlockPtr([alreadyCalled = false, function = WTFMove(function)] () mutable { 72 if (alreadyCalled) 73 return; 74 alreadyCalled = true; 75 function(); 76 function = nullptr; 77 }); 78 for (auto& pair : *m_scheduledPairs) 79 CFRunLoopPerformBlock(pair->runLoop(), pair->mode(), block.get()); 59 80 } 60 81
Note: See TracChangeset
for help on using the changeset viewer.