Title: [252372] branches/safari-608.4.9.0-branch/Source/WebKit
- Revision
- 252372
- Author
- [email protected]
- Date
- 2019-11-12 11:43:40 -0800 (Tue, 12 Nov 2019)
Log Message
Apply patch. rdar://problem/57123575
Modified Paths
Diff
Modified: branches/safari-608.4.9.0-branch/Source/WebKit/ChangeLog (252371 => 252372)
--- branches/safari-608.4.9.0-branch/Source/WebKit/ChangeLog 2019-11-12 19:38:26 UTC (rev 252371)
+++ branches/safari-608.4.9.0-branch/Source/WebKit/ChangeLog 2019-11-12 19:43:40 UTC (rev 252372)
@@ -1,3 +1,45 @@
+2019-11-12 Kocsen Chung <[email protected]>
+
+ Apply patch. rdar://problem/57123575
+
+ 2019-11-12 Chris Dumez <[email protected]>
+
+ Networking loading stalls / partial loading
+ <rdar://problem/57050996>
+
+ Reviewed by Ryosuke Niwa.
+
+ If the UIProcess's background task expires while we're holding a foreground assertion on behalf
+ of the network process, we would fail to release that assertion (i.e. reset the assertion state
+ to "Suspended"). We would send the ProcessWillSuspendImminently IPC to the network process, which
+ would suspend the StorageManager thread and everything would suspend shortly after.
+
+ When MobileSafari would come back to the foreground after this, the WKWebView would become visible and
+ it would indicate it needs a "Foreground" process assertion on behalf of its network process.
+ However, because we did not reset the network process assertion state on suspension, the UIProcess
+ would still think it has a "Foreground" process assertion on behalf of the network process and
+ it would do nothing. As a result, the UIProcess would fail to send the ProcessDidResume to the
+ network process and the network process would still have its StorageManager thread suspended.
+
+ If you then try to do a page load and the WebProcess ends up needing the local storage data for
+ the origin, it would do a synchronous IPC to the network process to get the data. Getting that
+ data is supposed to happen on the StorageManager thread in the network process, which is still
+ suspended / hung. As a result, the network process would fail to respond to the sync IPC and
+ the WebProcess would hang, usually in the middle of a page load.
+
+ To address the issue, we now reset the process assertion state to "Suspended" when
+ uiAssertionWillExpireImminently(), to properly reflect its new state (given that it expired).
+ As a result, if we later need a Foreground assertion for the network process, the UIProcess
+ will know it does not already have one and it will take one.
+
+ Note that this was already fixed on trunk via <rdar://problem/56547883> /
+ <https://trac.webkit.org/changeset/251577>. However, r251577 is fairly large because it
+ refactored the code at the same time. This patch only contains the part of r251577 that we
+ need on the branch to fix the suspension bug.
+
+ * UIProcess/ProcessThrottler.cpp:
+ (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
+
2019-11-11 Kocsen Chung <[email protected]>
Cherry-pick r252248. rdar://problem/57040121
Modified: branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/ProcessThrottler.cpp (252371 => 252372)
--- branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/ProcessThrottler.cpp 2019-11-12 19:38:26 UTC (rev 252371)
+++ branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/ProcessThrottler.cpp 2019-11-12 19:43:40 UTC (rev 252372)
@@ -133,6 +133,8 @@
{
m_process.sendProcessWillSuspendImminently();
m_uiAssertionExpired = true;
+ m_assertion->setState(AssertionState::Suspended);
+ m_process.didSetAssertionState(AssertionState::Suspended);
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes