Bug 157184 - [iOS] Make Database::close() non-blocking
Summary: [iOS] Make Database::close() non-blocking
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2016-04-29 09:35 PDT by Daniel Bates
Modified: 2016-04-29 09:59 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2016-04-29 09:35:42 PDT
We should make Database::close() non-blocking. On iOS we depend on it blocking until it closes a database as part of closing all databases (by calling DatabaseTracker::closeAllDatabases()) in our process assertion expiration handler. Specifically we depend on Database::close() blocking so as to prevent returning from the process assertion expiration handler before all databases are closed as the process will be suspended immediately on completion of the process assertion expiration handler.

In WebKit1 the logic for the process expiration handler happens in -[WebDatabaseManager startBackgroundTask], <http://trac.webkit.org/browser/trunk/Source/WebKit/mac/Storage/WebDatabaseManager.mm?rev=199309#L272>. In WebKit2 this happens in WebProcess::processWillSuspendImminently(), <http://trac.webkit.org/browser/trunk/Source/WebKit2/WebProcess/WebProcess.cpp?rev=199842#L1241>.