Changeset 259593 in webkit
- Timestamp:
- Apr 6, 2020 1:48:29 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259592 r259593 1 2020-04-06 Jer Noble <jer.noble@apple.com> 2 3 [ Mac wk2 ] http/tests/media/track-in-band-hls-metadata.html is flaky crashing. 4 https://bugs.webkit.org/show_bug.cgi?id=209490 5 <rdar://problem/60837555> 6 7 Reviewed by Darin Adler. 8 9 * platform/mac-wk2/TestExpectations: 10 1 11 2020-04-06 Manuel Rego Casasnovas <rego@igalia.com> 2 12 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r259570 r259593 1030 1030 webkit.org/b/209483 imported/w3c/web-platform-tests/notifications/event-onclose.html [ Pass Failure ] 1031 1031 1032 webkit.org/b/209490 http/tests/media/track-in-band-hls-metadata.html [ Pass Crash Timeout ]1033 1034 1032 webkit.org/b/209503 [ Debug ] http/tests/referrer-policy-anchor/origin/cross-origin-http.https.html [ Pass Crash ] 1035 1033 -
trunk/Source/WebCore/ChangeLog
r259585 r259593 1 2020-04-06 Jer Noble <jer.noble@apple.com> 2 3 [ Mac wk2 ] http/tests/media/track-in-band-hls-metadata.html is flaky crashing. 4 https://bugs.webkit.org/show_bug.cgi?id=209490 5 <rdar://problem/60837555> 6 7 Reviewed by Darin Adler. 8 9 To ensure the TaskDispatcher doesn't get destroyed on a background thread at the same time it's 10 executing tasks on the main thread, when a GenericTaskQueue is destroyed on a background thread, 11 move the TaskDispatcher into a task, and use the dispatcher itself to destroy itself on the 12 main thread. 13 14 * platform/GenericTaskQueue.h: 15 (WebCore::GenericTaskQueue::GenericTaskQueue): 16 (WebCore::GenericTaskQueue::~GenericTaskQueue): 17 (WebCore::GenericTaskQueue::enqueueTask): 18 1 19 2020-04-06 Antti Koivisto <antti@apple.com> 2 20 -
trunk/Source/WebCore/platform/GenericTaskQueue.h
r259054 r259593 29 29 #include <wtf/Deque.h> 30 30 #include <wtf/Function.h> 31 #include <wtf/MainThread.h> 32 #include <wtf/UniqueRef.h> 31 33 #include <wtf/WeakPtr.h> 32 34 … … 39 41 template <typename T> 40 42 class TaskDispatcher { 43 WTF_MAKE_FAST_ALLOCATED; 41 44 public: 42 45 explicit TaskDispatcher(T* context) … … 57 60 template<> 58 61 class TaskDispatcher<Timer> : public CanMakeWeakPtr<TaskDispatcher<Timer>> { 62 WTF_MAKE_FAST_ALLOCATED; 59 63 public: 60 64 TaskDispatcher(); … … 77 81 public: 78 82 GenericTaskQueue() 79 : m_dispatcher( )83 : m_dispatcher(makeUniqueRef<TaskDispatcher<T>>()) 80 84 { 81 85 } 82 86 83 87 explicit GenericTaskQueue(T& t) 84 : m_dispatcher( &t)88 : m_dispatcher(makeUniqueRef<TaskDispatcher<T>>(&t)) 85 89 { 86 90 } 87 91 88 92 explicit GenericTaskQueue(T* t) 89 : m_dispatcher( t)93 : m_dispatcher(makeUniqueRef<TaskDispatcher<T>>(t)) 90 94 , m_isClosed(!t) 91 95 { 96 } 97 98 ~GenericTaskQueue() 99 { 100 if (!isMainThread()) 101 m_dispatcher->postTask([dispatcher = WTFMove(m_dispatcher)] { }); 92 102 } 93 103 … … 100 110 101 111 ++m_pendingTasks; 102 m_dispatcher .postTask([weakThis = makeWeakPtr(*this), task = WTFMove(task)] {112 m_dispatcher->postTask([weakThis = makeWeakPtr(*this), task = WTFMove(task)] { 103 113 if (!weakThis) 104 114 return; … … 125 135 126 136 private: 127 TaskDispatcher<T> m_dispatcher;137 UniqueRef<TaskDispatcher<T>> m_dispatcher; 128 138 unsigned m_pendingTasks { 0 }; 129 139 bool m_isClosed { false };
Note: See TracChangeset
for help on using the changeset viewer.