<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [iOS] Make Database::close() non-blocking"
   href="https://bugs.webkit.org/show_bug.cgi?id=157184">157184</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[iOS] Make Database::close() non-blocking
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Local Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>iOS
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit Misc.
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dbates&#64;webkit.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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], &lt;<a href="http://trac.webkit.org/browser/trunk/Source/WebKit/mac/Storage/WebDatabaseManager.mm?rev=199309#L272">http://trac.webkit.org/browser/trunk/Source/WebKit/mac/Storage/WebDatabaseManager.mm?rev=199309#L272</a>&gt;. In WebKit2 this happens in WebProcess::processWillSuspendImminently(), &lt;<a href="http://trac.webkit.org/browser/trunk/Source/WebKit2/WebProcess/WebProcess.cpp?rev=199842#L1241">http://trac.webkit.org/browser/trunk/Source/WebKit2/WebProcess/WebProcess.cpp?rev=199842#L1241</a>&gt;.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>