Clean up layer tree freezing logic in WebPage
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2018 09:40:49 +0000 (09:40 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2018 09:40:49 +0000 (09:40 +0000)
commit822ec982169955317c24665edd1b00db6bbb16ce
tree53f13098c1eb93e7565c22e54360a979d5df77ee
parentc6446826f94812d601d70ddc8a6365c98421febd
Clean up layer tree freezing logic in WebPage
https://bugs.webkit.org/show_bug.cgi?id=191826

Reviewed by Dean Jackson.

Use OptionSet<LayerTreeFreezeReason> to track various reasons that can cause layer tree to get frozen.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):

Layer tree is unfrozen when there there are no reasons to freeze it.

(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::WebPage::beginPrinting):
(WebKit::WebPage::endPrinting):
(WebKit::WebPage::setIsSuspended):
(WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationDidEnterBackground):
(WebKit::WebPage::applicationWillEnterForeground):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::freezeAllLayerTrees):
(WebKit::WebProcess::unfreezeAllLayerTrees):
(WebKit::WebProcess::processDidResume):
(WebKit::WebProcess::setAllLayerTreeStatesFrozen): Deleted.
* WebProcess/WebProcess.h:

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