12015-05-05 Daniel Bates <dabates@apple.com>
2
3 [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
4 https://bugs.webkit.org/show_bug.cgi?id=144657
5
6 Reviewed by NOBODY (OOPS!).
7
8 Pause and resume the database thread when the UIProcess enters and leaves the background,
9 respectively, so that we avoid WebProcess termination due to holding a locked SQLite
10 database file when the WebProcess is suspended. This behavior matches the analagous
11 behavior in Legacy WebKit.
12
13 * UIProcess/WebPageProxy.h:
14 * UIProcess/ios/WKContentView.mm:
15 (-[WKContentView _applicationDidEnterBackground:]): Call WebPageProxy::applicationDidEnterBackground()
16 when the UIProcess enters the background.
17 * UIProcess/ios/WebPageProxyIOS.mm:
18 (WebKit::WebPageProxy::applicationDidEnterBackground): Added; pause the database thread.
19 * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
20 (WebKit::WebDatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseManager::setPauseAllDatabases().
21 * WebProcess/WebCoreSupport/WebDatabaseManager.h:
22 * WebProcess/WebPage/WebPage.h:
23 * WebProcess/WebPage/WebPage.messages.in: Add message ApplicationDidEnterBackground(). Also,
24 add empty lines to help demarcate this message and the other UIKit application lifecycle-related
25 messages from the rest of the list of messages.
26 * WebProcess/WebPage/ios/WebPageIOS.mm:
27 (WebKit::WebPage::applicationWillEnterForeground): Resume the database thread.
28 (WebKit::WebPage::applicationDidEnterBackground): Pause the database thread.
29