Title: [291383] trunk/Source/WebKit
- Revision
- 291383
- Author
- sihui_...@apple.com
- Date
- 2022-03-16 19:51:04 -0700 (Wed, 16 Mar 2022)
Log Message
Always update assertion state for existing default network process
https://bugs.webkit.org/show_bug.cgi?id=237965
Reviewed by Chris Dumez.
In our current implementation, we only update process assertion state for network process if it's being used by
some WebsiteDataStore. An problematic case with this impelmentation found by Tim: when a network process is
created for some WebsiteDataStore, and the WebsiteDataStore is gone (WebView gets destroyed), then network
process will get suspended. At this time, if a new WebsiteDataStore is created, some activities happen and we
update assertion state, we don't resume the network process, since it's not actively being used (the new
WebsiteDataStore has not invoked networkProcess() yet). Later on if the WebsiteDataStore starts to use network
process (it reuses existing process as network process is a singleton on Cocoa platforms), the network process
will be numb and not respond any message because it is suspended.
To fix this issue, let's always update assertion state for existing network process.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateProcessAssertions):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (291382 => 291383)
--- trunk/Source/WebKit/ChangeLog 2022-03-17 02:30:20 UTC (rev 291382)
+++ trunk/Source/WebKit/ChangeLog 2022-03-17 02:51:04 UTC (rev 291383)
@@ -1,3 +1,24 @@
+2022-03-16 Sihui Liu <sihui_...@apple.com>
+
+ Always update assertion state for existing default network process
+ https://bugs.webkit.org/show_bug.cgi?id=237965
+
+ Reviewed by Chris Dumez.
+
+ In our current implementation, we only update process assertion state for network process if it's being used by
+ some WebsiteDataStore. An problematic case with this impelmentation found by Tim: when a network process is
+ created for some WebsiteDataStore, and the WebsiteDataStore is gone (WebView gets destroyed), then network
+ process will get suspended. At this time, if a new WebsiteDataStore is created, some activities happen and we
+ update assertion state, we don't resume the network process, since it's not actively being used (the new
+ WebsiteDataStore has not invoked networkProcess() yet). Later on if the WebsiteDataStore starts to use network
+ process (it reuses existing process as network process is a singleton on Cocoa platforms), the network process
+ will be numb and not respond any message because it is suspended.
+
+ To fix this issue, let's always update assertion state for existing network process.
+
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::updateProcessAssertions):
+
2022-03-16 Chris Dumez <cdu...@apple.com>
Don't build WebPageProxy::writePromisedAttachmentToPasteboard() and its IPC on macOS
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (291382 => 291383)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2022-03-17 02:30:20 UTC (rev 291382)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2022-03-17 02:51:04 UTC (rev 291383)
@@ -1778,10 +1778,9 @@
void WebProcessPool::updateProcessAssertions()
{
- WebsiteDataStore::forEachWebsiteDataStore([] (WebsiteDataStore& dataStore) {
- if (auto* networkProcess = dataStore.networkProcessIfExists())
- networkProcess->updateProcessAssertion();
- });
+ if (auto& networkProcess = NetworkProcessProxy::defaultNetworkProcess())
+ networkProcess->updateProcessAssertion();
+
#if ENABLE(GPU_PROCESS)
if (auto* gpuProcess = GPUProcessProxy::singletonIfCreated())
gpuProcess->updateProcessAssertion();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes