Changeset 282489 in webkit
- Timestamp:
- Sep 16, 2021, 12:22:45 AM (5 years ago)
- Location:
- releases/WebKitGTK/webkit-2.32/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
dom/TaskSource.h (modified) (1 diff)
-
page/Performance.cpp (modified) (4 diffs)
-
page/Performance.h (modified) (3 diffs)
-
platform/GenericTaskQueue.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog
r281304 r282489 1 2021-03-30 Ryosuke Niwa <rniwa@webkit.org> 2 3 Occasional debug assert in GenericTaskQueue::~GenericTaskQueue 4 https://bugs.webkit.org/show_bug.cgi?id=223913 5 6 Reviewed by Eric Carlson. 7 8 Eagerly initialize WeakPtrImpl so that we don't hit debug assertions. 9 10 Also made Performance object use EventLoop. 11 12 No new tests since there is no test case that reliably reproduces this issue. 13 14 * dom/TaskSource.h: 15 (TaskSource): Added PerformanceTimeline. 16 * page/Performance.cpp: 17 (WebCore::Performance::Performance): 18 (WebCore::Performance::contextDestroyed): 19 (WebCore::Performance::queueEntry): Use EventLoopTaskGroup instead of GenericTaskQueue to deliver entries. 20 * page/Performance.h: 21 * platform/GenericTaskQueue.h: 22 (WebCore::GenericTaskQueue::GenericTaskQueue): Eagerly initialize WeakPtrImpl. 23 Also assert that we're creating this object in the main thread. 24 1 25 2021-03-29 Chris Dumez <cdumez@apple.com> 2 26 -
releases/WebKitGTK/webkit-2.32/Source/WebCore/dom/TaskSource.h
r269348 r282489 37 37 Microtask, 38 38 Networking, 39 PerformanceTimeline, 39 40 PostedMessageQueue, 40 41 UserInteraction, -
releases/WebKitGTK/webkit-2.32/Source/WebCore/page/Performance.cpp
r267402 r282489 37 37 #include "DocumentLoader.h" 38 38 #include "Event.h" 39 #include "EventLoop.h" 39 40 #include "EventNames.h" 40 41 #include "Frame.h" … … 58 59 Performance::Performance(ScriptExecutionContext* context, MonotonicTime timeOrigin) 59 60 : ContextDestructionObserver(context) 60 , m_resourceTimingBufferFullTimer(*this, &Performance::resourceTimingBufferFullTimerFired) 61 , m_resourceTimingBufferFullTimer(*this, &Performance::resourceTimingBufferFullTimerFired) // FIXME: Migrate this to the event loop as well. 61 62 , m_timeOrigin(timeOrigin) 62 , m_performanceTimelineTaskQueue(context)63 63 { 64 64 ASSERT(m_timeOrigin); 65 ASSERT(context || m_performanceTimelineTaskQueue.isClosed());66 65 } 67 66 … … 70 69 void Performance::contextDestroyed() 71 70 { 72 m_performanceTimelineTaskQueue.close();73 71 m_resourceTimingBufferFullTimer.stop(); 74 72 ContextDestructionObserver::contextDestroyed(); … … 369 367 return; 370 368 371 if (m_performanceTimelineTaskQueue.hasPendingTasks()) 372 return; 373 374 m_performanceTimelineTaskQueue.enqueueTask([this] () { 369 if (m_hasScheduledTimingBufferDeliveryTask) 370 return; 371 372 auto* context = scriptExecutionContext(); 373 if (!context) 374 return; 375 376 m_hasScheduledTimingBufferDeliveryTask = true; 377 context->eventLoop().queueTask(TaskSource::PerformanceTimeline, [protectedThis = makeRef(*this), this] { 378 auto* context = scriptExecutionContext(); 379 if (!context) 380 return; 381 382 m_hasScheduledTimingBufferDeliveryTask = false; 375 383 for (auto& observer : copyToVector(m_observers)) 376 384 observer->deliver(); -
releases/WebKitGTK/webkit-2.32/Source/WebCore/page/Performance.h
r267402 r282489 37 37 #include "EventTarget.h" 38 38 #include "ExceptionOr.h" 39 #include "GenericTaskQueue.h"40 39 #include "ReducedResolutionSeconds.h" 40 #include "ScriptExecutionContext.h" 41 #include "Timer.h" 41 42 #include <wtf/ListHashSet.h> 42 43 #include <wtf/Variant.h> … … 135 136 bool m_resourceTimingBufferFullFlag { false }; 136 137 bool m_waitingForBackupBufferToBeProcessed { false }; 138 bool m_hasScheduledTimingBufferDeliveryTask { false }; 137 139 138 140 MonotonicTime m_timeOrigin; … … 141 143 std::unique_ptr<PerformanceUserTiming> m_userTiming; 142 144 143 GenericTaskQueue<ScriptExecutionContext> m_performanceTimelineTaskQueue;144 145 ListHashSet<RefPtr<PerformanceObserver>> m_observers; 145 146 }; -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/GenericTaskQueue.h
r259593 r282489 59 59 60 60 template<> 61 class TaskDispatcher<Timer> : public CanMakeWeakPtr<TaskDispatcher<Timer> > {61 class TaskDispatcher<Timer> : public CanMakeWeakPtr<TaskDispatcher<Timer>, WeakPtrFactoryInitialization::Eager> { 62 62 WTF_MAKE_FAST_ALLOCATED; 63 63 public: … … 83 83 : m_dispatcher(makeUniqueRef<TaskDispatcher<T>>()) 84 84 { 85 ASSERT(isMainThread()); 85 86 } 86 87 … … 88 89 : m_dispatcher(makeUniqueRef<TaskDispatcher<T>>(&t)) 89 90 { 91 ASSERT(isMainThread()); 90 92 } 91 93 … … 94 96 , m_isClosed(!t) 95 97 { 98 ASSERT(isMainThread()); 96 99 } 97 100
Note:
See TracChangeset
for help on using the changeset viewer.