Changeset 292282 in webkit
- Timestamp:
- Apr 4, 2022, 12:53:56 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
Platform/IPC/StreamClientConnection.h (modified) (2 diffs)
-
WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp (modified) (2 diffs)
-
WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h (modified) (1 diff)
-
WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp (modified) (4 diffs)
-
WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h (modified) (1 diff)
-
WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r292280 r292282 1 2022-04-04 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 StreamClientConnection should have waitForAndDispatchImmediately 4 https://bugs.webkit.org/show_bug.cgi?id=238622 5 6 Reviewed by Simon Fraser. 7 8 IPC::StreamClientConnection should have the same communication methods 9 as the IPC::Connection. The stream connection will forward 10 the calls to underlying IPC::Connection, if needed. 11 Add missing IPC::StreamClientConnection::waitForAndDispatchImmediately() 12 and use it. 13 Remove conveinence accessor methods for the IPC::Connection, as that should be 14 accessed by accessing the stream connection in the respective classes. 15 16 No new tests, refactor. 17 18 * Platform/IPC/StreamClientConnection.h: 19 (IPC::StreamClientConnection::waitForAndDispatchImmediately): 20 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: 21 (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): 22 (WebKit::RemoteGraphicsContextGLProxy::waitUntilInitialized): 23 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: 24 (WebKit::RemoteGraphicsContextGLProxy::sendSync): 25 * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: 26 (WebKit::RemoteRenderingBackendProxy::waitForDidCreateImageBufferBackend): 27 (WebKit::RemoteRenderingBackendProxy::waitForDidFlush): 28 (WebKit::RemoteRenderingBackendProxy::streamConnection): 29 * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h: 30 * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp: 31 (WebKit::RemoteGPUProxy::RemoteGPUProxy): 32 (WebKit::RemoteGPUProxy::waitUntilInitialized): 33 1 34 2022-04-04 Kimmo Kinnunen <kkinnunen@apple.com> 2 35 -
trunk/Source/WebKit/Platform/IPC/StreamClientConnection.h
r291428 r292282 75 75 template<typename T, typename U> 76 76 SendSyncResult sendSync(T&& message, typename T::Reply&&, ObjectIdentifier<U> destinationID, Timeout); 77 78 template<typename T, typename U> 79 bool waitForAndDispatchImmediately(ObjectIdentifier<U> destinationID, Timeout, OptionSet<WaitForOption> = { }); 80 77 81 StreamConnectionBuffer& bufferForTesting(); 78 82 … … 178 182 sendProcessOutOfStreamMessage(WTFMove(*span)); 179 183 return m_connection.sendSync(WTFMove(message), WTFMove(reply), destinationID.toUInt64(), timeout); 184 } 185 186 template<typename T, typename U> 187 bool StreamClientConnection::waitForAndDispatchImmediately(ObjectIdentifier<U> destinationID, Timeout timeout, OptionSet<WaitForOption> waitForOptions) 188 { 189 return m_connection.waitForAndDispatchImmediately<T>(destinationID, timeout, waitForOptions); 180 190 } 181 191 -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp
r291902 r292282 55 55 m_gpuProcessConnection->addClient(*this); 56 56 m_gpuProcessConnection->messageReceiverMap().addMessageReceiver(Messages::RemoteGraphicsContextGLProxy::messageReceiverName(), m_graphicsContextGLIdentifier.toUInt64(), *this); 57 connection().send(Messages::GPUConnectionToWebProcess::CreateGraphicsContextGL(attributes, m_graphicsContextGLIdentifier, renderingBackend, m_streamConnection.streamBuffer()), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);57 m_gpuProcessConnection->connection().send(Messages::GPUConnectionToWebProcess::CreateGraphicsContextGL(attributes, m_graphicsContextGLIdentifier, renderingBackend, m_streamConnection.streamBuffer()), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply); 58 58 // TODO: We must wait until initialized, because at the moment we cannot receive IPC messages 59 59 // during wait while in synchronous stream send. Should be fixed as part of https://bugs.webkit.org/show_bug.cgi?id=217211. … … 315 315 if (m_didInitialize) 316 316 return; 317 if ( connection().waitForAndDispatchImmediately<Messages::RemoteGraphicsContextGLProxy::WasCreated>(m_graphicsContextGLIdentifier, defaultSendTimeout))317 if (m_streamConnection.waitForAndDispatchImmediately<Messages::RemoteGraphicsContextGLProxy::WasCreated>(m_graphicsContextGLIdentifier, defaultSendTimeout)) 318 318 return; 319 319 markContextLost(); -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h
r291749 r292282 343 343 return m_streamConnection.sendSync(WTFMove(message), WTFMove(reply), m_graphicsContextGLIdentifier, defaultSendTimeout); 344 344 } 345 IPC::Connection& connection() const { return m_gpuProcessConnection->connection(); }346 345 347 346 GraphicsContextGLIdentifier m_graphicsContextGLIdentifier { GraphicsContextGLIdentifier::generate() }; -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp
r292143 r292282 86 86 } 87 87 88 IPC::Connection& RemoteRenderingBackendProxy::gpuProcessConnection()89 {90 return ensureGPUProcessConnection().connection();91 }92 93 88 void RemoteRenderingBackendProxy::gpuProcessConnectionDidClose(GPUProcessConnection& previousConnection) 94 89 { … … 108 103 RemoteRenderingBackendProxy::DidReceiveBackendCreationResult RemoteRenderingBackendProxy::waitForDidCreateImageBufferBackend() 109 104 { 110 if (! gpuProcessConnection().waitForAndDispatchImmediately<Messages::RemoteRenderingBackendProxy::DidCreateImageBufferBackend>(renderingBackendIdentifier(), 1_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives))105 if (!streamConnection().waitForAndDispatchImmediately<Messages::RemoteRenderingBackendProxy::DidCreateImageBufferBackend>(renderingBackendIdentifier(), 1_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives)) 111 106 return DidReceiveBackendCreationResult::TimeoutOrIPCFailure; 112 107 return DidReceiveBackendCreationResult::ReceivedAnyResponse; … … 115 110 bool RemoteRenderingBackendProxy::waitForDidFlush() 116 111 { 117 return gpuProcessConnection().waitForAndDispatchImmediately<Messages::RemoteRenderingBackendProxy::DidFlush>(renderingBackendIdentifier(), 1_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);112 return streamConnection().waitForAndDispatchImmediately<Messages::RemoteRenderingBackendProxy::DidFlush>(renderingBackendIdentifier(), 1_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives); 118 113 } 119 114 … … 418 413 ensureGPUProcessConnection(); 419 414 if (UNLIKELY(m_needsWakeUpSemaphoreForDisplayListStream)) 420 gpuProcessConnection().waitForAndDispatchImmediately<Messages::RemoteRenderingBackendProxy::DidCreateWakeUpSemaphoreForDisplayListStream>(renderingBackendIdentifier(), 3_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);415 m_streamConnection->waitForAndDispatchImmediately<Messages::RemoteRenderingBackendProxy::DidCreateWakeUpSemaphoreForDisplayListStream>(renderingBackendIdentifier(), 3_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives); 421 416 return *m_streamConnection; 422 417 } -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h
r291733 r292282 162 162 163 163 GPUProcessConnection& ensureGPUProcessConnection(); 164 IPC::Connection& gpuProcessConnection();165 164 166 165 // Returns std::nullopt if no update is needed or allocation failed. -
trunk/Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp
r291323 r292282 51 51 m_gpuProcessConnection->addClient(*this); 52 52 m_gpuProcessConnection->messageReceiverMap().addMessageReceiver(Messages::RemoteGPUProxy::messageReceiverName(), identifier.toUInt64(), *this); 53 connection().send(Messages::GPUConnectionToWebProcess::CreateRemoteGPU(identifier, renderingBackend, m_streamConnection.streamBuffer()), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);53 m_gpuProcessConnection->connection().send(Messages::GPUConnectionToWebProcess::CreateRemoteGPU(identifier, renderingBackend, m_streamConnection.streamBuffer()), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply); 54 54 // TODO: We must wait until initialized, because at the moment we cannot receive IPC messages 55 55 // during wait while in synchronous stream send. Should be fixed as part of https://bugs.webkit.org/show_bug.cgi?id=217211. … … 86 86 if (m_didInitialize) 87 87 return; 88 if ( connection().waitForAndDispatchImmediately<Messages::RemoteGPUProxy::WasCreated>(m_backing, defaultSendTimeout))88 if (m_streamConnection.waitForAndDispatchImmediately<Messages::RemoteGPUProxy::WasCreated>(m_backing, defaultSendTimeout)) 89 89 return; 90 90 m_lost = true;
Note:
See TracChangeset
for help on using the changeset viewer.