ProcessAssertion should also prevent UIApp suspension
https://bugs.webkit.org/show_bug.cgi?id=134563

Reviewed by Dan Bernstein.

If the application suspends then the child processes will, too.
Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
while waiting for background tasks to complete.

* UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::~ProcessAssertion):
    - Added destructor.
* UIProcess/ProcessAssertion.h:
    - Added destructor.
* UIProcess/ios/ProcessAssertionIOS.mm:
(+[WKProcessAssertionBackgroundTaskManager shared]):
    - singleton WKProcessAssertionBackgroundTaskManager.
(-[WKProcessAssertionBackgroundTaskManager init]):
(-[WKProcessAssertionBackgroundTaskManager dealloc]):
    - register/remove notification handlers.
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
    - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
(-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
    - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
(-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
(-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
    - interface to update the count; calls to _updateBackgroundTask.
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::~ProcessAssertion):
    - count ProcessAssertions in and out of existance.
(WebKit::ProcessAssertion::setState):
    - count when the state changes.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(WK2): Undo does not work in text fields in Safari.
https://bugs.webkit.org/show_bug.cgi?id=134572
<rdar://problem/17542238>

Reviewed by Benjamin Poulain.
        
This patch adds for iOS the same implementation we have already for OS X.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(-[WKEditCommandObjC initWithWebEditCommandProxy:]):
(-[WKEditCommandObjC command]):
(-[WKEditorUndoTargetObjC undoEditing:]):
(-[WKEditorUndoTargetObjC redoEditing:]):
(WebKit::PageClientImpl::PageClientImpl):
(WebKit::PageClientImpl::registerEditCommand):
(WebKit::PageClientImpl::clearAllEditCommands):
(WebKit::PageClientImpl::canUndoRedo):
(WebKit::PageClientImpl::executeUndoRedo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170738 268f45cc-cd09-0410-ab3c-d52691b4dbfc