Sometimes RemoteLayerBackingStore ends up non-volatile while the process is suspended
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Feb 2015 02:30:11 +0000 (02:30 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Feb 2015 02:30:11 +0000 (02:30 +0000)
commit15360a48e51f976fa36117422d04018dd9c618b7
treead419de3b7d199a7afcd5464838b164226dc0835
parent6bd640be56f21539b9fd175e4dbef8b4e75df6c3
Sometimes RemoteLayerBackingStore ends up non-volatile while the process is suspended
<rdar://problem/19842957>
https://bugs.webkit.org/show_bug.cgi?id=141675

Reviewed by Simon Fraser.

Previously, it was possible to get a layer tree flush in between the
process suspension cleanup code making surfaces volatile and the process
actually being suspended (it was racy because the suspension requires
a few IPC round trips). Depending on how far through the flush we got,
we could sometimes end up either making new non-volatile backing store,
or switching some recently-made-volatile backing store back to non-volatile.
We don't want to have any non-volatile backing store while suspended.

* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertion):
Inform the WebProcess when it's going from suspended to runnable state.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendProcessDidResume):
* UIProcess/WebProcessProxy.h:
Forward the message along.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::processWillSuspend):
(WebKit::WebProcess::cancelProcessWillSuspend):
(WebKit::WebProcess::setAllLayerTreeStatesFrozen):
(WebKit::WebProcess::processDidResume):
Freeze all of this process' pages' layer trees when we start trying to suspend,
and un-freeze them when either suspension is cancelled or we resume.

* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ProcessThrottler.cpp
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in