[iOS] ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImmi...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 00:43:24 +0000 (00:43 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 00:43:24 +0000 (00:43 +0000)
commitc5e78bd506574bc23ed78b2ccd6283b57ba09e14
treee9fe05e4a1ebe0abb8b9e4ec5ce812173dfb1e07
parentf58a3dde4da2be341f3a15539a1633d5c9ca1788
[iOS] ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent
https://bugs.webkit.org/show_bug.cgi?id=195382
<rdar://problem/48642739>

Reviewed by Geoffrey Garen.

ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent. Previously,
we only send ProcessDidResume() to the WebProcess if PrepareToSuspend() was sent, not when the more urgent
ProcessWillSuspendImminently() IPC was sent.

This mismatch has lead to bugs because the WebProcess does not know it got resumed and failed to unfreeze the
layers it froze upon suspension.

* UIProcess/ProcessAssertion.h:
(WebKit::ProcessAssertionClient::~ProcessAssertionClient):

* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertion):
(WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
(WebKit::ProcessThrottler::assertionWillExpireImminently): Deleted.

* UIProcess/ProcessThrottler.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
(WebKit::ProcessAssertion::~ProcessAssertion):
(WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::setClient):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):
Revert change that was landed in r242098 to work around this ProcessThrottler bug.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationWillEnterForeground):
Revert change that was landed in r242554 to work around this ProcessThrottler bug.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ProcessAssertion.h
Source/WebKit/UIProcess/ProcessThrottler.cpp
Source/WebKit/UIProcess/ProcessThrottler.h
Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm