Title: [275349] trunk/Source/WebKit
- Revision
- 275349
- Author
- [email protected]
- Date
- 2021-04-01 02:04:14 -0700 (Thu, 01 Apr 2021)
Log Message
[GPU Process] Process the pending messages of GPUProcessProxy before its destructor is called
https://bugs.webkit.org/show_bug.cgi?id=224017
Reviewed by Simon Fraser.
Ensure all the pending messages of the singleton GPUProcessProxy are
processed every time a WebProcessPool is about to be deleted. When calling
the completion handlers of these messages, the GPUProcessProxy and the
WebProcessPool have to be valid
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
(WebKit::AuxiliaryProcessProxy::replyToPendingMessages):
* UIProcess/AuxiliaryProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::~WebProcessPool):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (275348 => 275349)
--- trunk/Source/WebKit/ChangeLog 2021-04-01 08:05:48 UTC (rev 275348)
+++ trunk/Source/WebKit/ChangeLog 2021-04-01 09:04:14 UTC (rev 275349)
@@ -1,3 +1,22 @@
+2021-04-01 Said Abou-Hallawa <[email protected]>
+
+ [GPU Process] Process the pending messages of GPUProcessProxy before its destructor is called
+ https://bugs.webkit.org/show_bug.cgi?id=224017
+
+ Reviewed by Simon Fraser.
+
+ Ensure all the pending messages of the singleton GPUProcessProxy are
+ processed every time a WebProcessPool is about to be deleted. When calling
+ the completion handlers of these messages, the GPUProcessProxy and the
+ WebProcessPool have to be valid
+
+ * UIProcess/AuxiliaryProcessProxy.cpp:
+ (WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
+ (WebKit::AuxiliaryProcessProxy::replyToPendingMessages):
+ * UIProcess/AuxiliaryProcessProxy.h:
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::~WebProcessPool):
+
2021-03-31 Simon Fraser <[email protected]>
Feed preferred frames per second back to the UI process for each DisplayRefreshMonitor
Modified: trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp (275348 => 275349)
--- trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp 2021-04-01 08:05:48 UTC (rev 275348)
+++ trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp 2021-04-01 09:04:14 UTC (rev 275349)
@@ -48,11 +48,8 @@
m_processLauncher->invalidate();
m_processLauncher = nullptr;
}
- auto pendingMessages = WTFMove(m_pendingMessages);
- for (auto& pendingMessage : pendingMessages) {
- if (pendingMessage.asyncReplyInfo)
- pendingMessage.asyncReplyInfo->first(nullptr);
- }
+
+ replyToPendingMessages();
}
void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
@@ -249,6 +246,15 @@
}
}
+void AuxiliaryProcessProxy::replyToPendingMessages()
+{
+ auto pendingMessages = WTFMove(m_pendingMessages);
+ for (auto& pendingMessage : pendingMessages) {
+ if (pendingMessage.asyncReplyInfo)
+ pendingMessage.asyncReplyInfo->first(nullptr);
+ }
+}
+
void AuxiliaryProcessProxy::shutDownProcess()
{
switch (state()) {
Modified: trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h (275348 => 275349)
--- trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h 2021-04-01 08:05:48 UTC (rev 275348)
+++ trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h 2021-04-01 09:04:14 UTC (rev 275349)
@@ -119,6 +119,8 @@
bool canSendMessage() const { return state() != State::Terminated;}
bool sendMessage(UniqueRef<IPC::Encoder>&&, OptionSet<IPC::SendOption>, Optional<std::pair<CompletionHandler<void(IPC::Decoder*)>, uint64_t>>&& asyncReplyInfo = WTF::nullopt, ShouldStartProcessThrottlerActivity = ShouldStartProcessThrottlerActivity::Yes);
+ void replyToPendingMessages();
+
void shutDownProcess();
WebCore::ProcessIdentifier coreProcessIdentifier() const { return m_processIdentifier; }
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (275348 => 275349)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2021-04-01 08:05:48 UTC (rev 275348)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2021-04-01 09:04:14 UTC (rev 275349)
@@ -360,6 +360,11 @@
UIGamepadProvider::singleton().processPoolStoppedUsingGamepads(*this);
#endif
+#if ENABLE(GPU_PROCESS)
+ if (m_gpuProcess)
+ m_gpuProcess->replyToPendingMessages();
+#endif
+
// Only remaining processes should be pre-warmed ones as other keep the process pool alive.
while (!m_processes.isEmpty()) {
auto& process = m_processes.first();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes