[Cocoa] Awaken UIProcess if WebContent process is awakened from suspensions unexpectedly.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 19:37:28 +0000 (19:37 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 19:37:28 +0000 (19:37 +0000)
commit7aa2e717b7aeb32652defe2c0ed8ff4a9785601f
treeb9a7ddb8e8e95a175ae283eda43182a3b118d412
parent0f34e52091286c32cb5e3eff6e4b534b7909a0a0
[Cocoa] Awaken UIProcess if WebContent process is awakened from suspensions unexpectedly.
https://bugs.webkit.org/show_bug.cgi?id=196659

Reviewed by Chris Dumez.

* Platform/IPC/Connection.h:
(IPC::Connection::sendWithAsyncReply):
* Platform/spi/ios/AssertionServicesSPI.h:
* Shared/Cocoa/ProcessTaskStateObserver.h: Added.
(WebKit::ProcessTaskStateObserver::setClient):
(WebKit::ProcessTaskStateObserver::client):
(WebKit::ProcessTaskStateObserver::taskState const):
* Shared/Cocoa/ProcessTaskStateObserver.mm: Added.
(-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
(WebKit::toProcessTaskStateObserverTaskState):
(WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::setTaskState):
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
* UIProcess/ProcessAssertion.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertion):
* UIProcess/ProcessThrottler.h:
(WebKit::ProcessThrottler::shouldBeRunnable const):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::reasonForState):
(WebKit::toBKSProcessAssertionReason):
(WebKit::ProcessAssertion::ProcessAssertion):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::processTaskStateDidChange):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Platform/IPC/Connection.h
Source/WebKit/Platform/spi/ios/AssertionServicesSPI.h
Source/WebKit/Shared/Cocoa/ProcessTaskStateObserver.h [new file with mode: 0644]
Source/WebKit/Shared/Cocoa/ProcessTaskStateObserver.mm [new file with mode: 0644]
Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm
Source/WebKit/UIProcess/ProcessAssertion.cpp
Source/WebKit/UIProcess/ProcessAssertion.h
Source/WebKit/UIProcess/ProcessThrottler.cpp
Source/WebKit/UIProcess/ProcessThrottler.h
Source/WebKit/UIProcess/WebProcessProxy.h
Source/WebKit/UIProcess/WebProcessProxy.messages.in
Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebProcess.h
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm