Changeset 284681 in webkit
- Timestamp:
- Oct 22, 2021, 7:38:42 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
GPUProcess/graphics/RemoteRenderingBackend.cpp (modified) (1 diff)
-
Platform/IPC/StreamConnectionWorkQueue.cpp (modified) (3 diffs)
-
Platform/IPC/StreamConnectionWorkQueue.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r284679 r284681 1 2021-10-22 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 StreamConnectionWorkQueue::processStreams() has a incorrect protection ref 4 https://bugs.webkit.org/show_bug.cgi?id=232070 5 6 Reviewed by Wenson Hsieh. 7 8 * GPUProcess/graphics/RemoteRenderingBackend.cpp: 9 (WebKit::RemoteRenderingBackend::~RemoteRenderingBackend): 10 Additionally remove redundant protection ref from `RemoteRenderingBackend` 11 cleanup task. Since `m_workQueue->stop()` is run after dispatching the 12 task, and since `stop()` waits until queue has executed the 13 all the tasks, the `m_workQueue` ref outlives the protection ref. 14 15 * Platform/IPC/StreamConnectionWorkQueue.cpp: 16 (IPC::StreamConnectionWorkQueue::processStreams): 17 Remove the redundant protection ref so it does not cause confusion. 18 The protection ref cannot hold the last ref, as that would mean 19 that the `StreamConnectionWorkQueue` thread would run the code to 20 destroy the work queue itself. There has to be a external ref for 21 `queue->stop()` that outlives the protection ref, as the `stop()` will 22 wait until the queue thread stops. 23 24 (IPC::StreamConnectionWorkQueue::stopAndWaitForCompletion): 25 (IPC::StreamConnectionWorkQueue::stop): Deleted. 26 * Platform/IPC/StreamConnectionWorkQueue.h: 27 Rename `stop()` to `stopAndWaitForCompletion()` to signify what 28 the function does. 29 1 30 2021-10-22 Alberto Garcia <berto@igalia.com> 2 31 -
trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp
r284476 r284681 99 99 // Make sure we destroy the ResourceCache on the WorkQueue since it gets populated on the WorkQueue. 100 100 // Make sure rendering resource request is released after destroying the cache. 101 m_workQueue->dispatch([ workQueue = m_workQueue.copyRef(),renderingResourcesRequest = WTFMove(m_renderingResourcesRequest), remoteResourceCache = WTFMove(m_remoteResourceCache)] { });102 m_workQueue->stop ();101 m_workQueue->dispatch([renderingResourcesRequest = WTFMove(m_renderingResourcesRequest), remoteResourceCache = WTFMove(m_remoteResourceCache)] { }); 102 m_workQueue->stopAndWaitForCompletion(); 103 103 } 104 104 -
trunk/Source/WebKit/Platform/IPC/StreamConnectionWorkQueue.cpp
r284671 r284681 36 36 StreamConnectionWorkQueue::~StreamConnectionWorkQueue() 37 37 { 38 // `StreamConnectionWorkQueue::stop ()` should be called if anything has been dispatched or listened to.38 // `StreamConnectionWorkQueue::stopAndWaitForCompletion()` should be called if anything has been dispatched or listened to. 39 39 ASSERT(!m_processingThread); 40 40 } … … 76 76 } 77 77 78 void StreamConnectionWorkQueue::stop ()78 void StreamConnectionWorkQueue::stopAndWaitForCompletion() 79 79 { 80 80 m_shouldQuit = true; … … 118 118 void StreamConnectionWorkQueue::processStreams() 119 119 { 120 Ref protectedThis = *this;121 120 constexpr size_t defaultMessageLimit = 1000; 122 121 bool hasMoreToProcess = false; -
trunk/Source/WebKit/Platform/IPC/StreamConnectionWorkQueue.h
r284671 r284681 50 50 51 51 void dispatch(WTF::Function<void()>&&) final; 52 void stop ();52 void stopAndWaitForCompletion(); 53 53 54 54 void wakeUp();
Note:
See TracChangeset
for help on using the changeset viewer.