Cleanup ProcessAssertion RunInBackground management
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2016 18:15:47 +0000 (18:15 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2016 18:15:47 +0000 (18:15 +0000)
commitcb08b45c9619ddc5b2967c655b5aa7914e3c47f6
treedb07ec6d8942aceaaa993dba79419d65ac69a0d3
parent6e286d3099b5e3cafcca38884aef1534eeec888b
Cleanup ProcessAssertion RunInBackground management
https://bugs.webkit.org/show_bug.cgi?id=159284

Reviewed by Chris Dumez.

Factor out code that handles taking a background assertion on the UI app into
ProcessAndUIAssertion::updateRunInBackgroundCount helper.

This patch just cleanup to enable a futher fix.

* UIProcess/ProcessAssertion.h:
(WebKit::ProcessAssertion::state):
    - Added ProcessAndUIAssertion::updateRunInBackgroundCount
    - Added ProcessAndUIAssertion::m_isHoldingBackgroundAssertionOnApp
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
    - helper to manage calls to incrementNeedsToRunInBackgroundCount/decrementNeedsToRunInBackgroundCount
(WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
    - call updateRunInBackgroundCount
(WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
    changed to use m_isHoldingBackgroundAssertionOnApp
(WebKit::ProcessAndUIAssertion::setState):
    - call updateRunInBackgroundCount

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ProcessAssertion.h
Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm