[iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
[WebKit-https.git] / Source / WebKit2 / ChangeLog
index 58e50e0..b4a3462 100644 (file)
@@ -1,3 +1,36 @@
+2015-05-06  Daniel Bates  <dabates@apple.com>
+
+        [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
+        https://bugs.webkit.org/show_bug.cgi?id=144657
+        <rdar://problem/18894598>
+
+        Reviewed by Andy Estes.
+
+        Pause and resume the database thread when the UIProcess enters and leaves the background,
+        respectively, so that we avoid WebProcess termination due to holding a locked SQLite
+        database file when the WebProcess is suspended. This behavior matches the analagous
+        behavior in Legacy WebKit.
+
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView _applicationDidEnterBackground:]): Call WebPageProxy::applicationDidEnterBackground()
+        when the UIProcess enters the background.
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::applicationDidEnterBackground): Added; notify the WebProcess to pause the database thread.
+        We temporarily take out background assertion on the WebProcess before sending this notification to ensure that the
+        WebProcess is running to receive it. We'll release this assertion when the WebProcess replies that it received the
+        notification.
+        * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
+        (WebKit::WebDatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseManager::setPauseAllDatabases().
+        * WebProcess/WebCoreSupport/WebDatabaseManager.h:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in: Add message ApplicationDidEnterBackground(). Also,
+        add empty lines to help demarcate this message and the other UIKit application lifecycle-related
+        messages from the rest of the list of messages.
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::applicationWillEnterForeground): Resume the database thread.
+        (WebKit::WebPage::applicationDidEnterBackground): Pause the database thread.
+
 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
 
         [EFL] ewk_view_page_contents_get() API test is flaky