<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[202359] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/202359">202359</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-06-22 16:46:05 -0700 (Wed, 22 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>DatabaseProcess doesn't handle WebProcesses going away uncleanly.
https://bugs.webkit.org/show_bug.cgi?id=158894

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by additions to existing API test).

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::registerDatabaseConnection):
(WebCore::IDBServer::IDBConnectionToClient::unregisterDatabaseConnection):
(WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
* Modules/indexeddb/server/IDBConnectionToClient.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::unregisterConnection): Call connectionToClientClosed() on
  the connection, which cleans up after it in the server.

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):

Source/WebKit2:

* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
(WebKit::DatabaseToWebProcessConnection::didClose):

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Actually unregister this connection
  from the IDBServer so it can clean up.
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessDatabaseToWebProcessConnectioncpp">trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBMultiProcess2html">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBMultiProcessmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBMultiProcess3html">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebCore/ChangeLog        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-06-22  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        DatabaseProcess doesn't handle WebProcesses going away uncleanly.
+        https://bugs.webkit.org/show_bug.cgi?id=158894
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Covered by additions to existing API test).
+
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::registerDatabaseConnection):
+        (WebCore::IDBServer::IDBConnectionToClient::unregisterDatabaseConnection):
+        (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::unregisterConnection): Call connectionToClientClosed() on
+          the connection, which cleans up after it in the server.
+        
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
+
</ins><span class="cx"> 2016-06-22  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Add support for CSS4 :focus-within pseudo
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -148,6 +148,29 @@
</span><span class="cx">     m_delegate-&gt;didGetAllDatabaseNames(callbackID, databaseNames);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToClient::registerDatabaseConnection(UniqueIDBDatabaseConnection&amp; connection)
+{
+    ASSERT(!m_databaseConnections.contains(&amp;connection));
+    m_databaseConnections.add(&amp;connection);
+}
+
+void IDBConnectionToClient::unregisterDatabaseConnection(UniqueIDBDatabaseConnection&amp; connection)
+{
+    m_databaseConnections.remove(&amp;connection);
+}
+
+void IDBConnectionToClient::connectionToClientClosed()
+{
+    auto databaseConnections = m_databaseConnections;
+
+    for (auto connection : databaseConnections) {
+        if (m_databaseConnections.contains(connection))
+            connection-&gt;connectionClosedFromClient();
+    }
+
+    m_databaseConnections.clear();
+}
+
</ins><span class="cx"> } // namespace IDBServer
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBConnectionToClientDelegate.h&quot;
</span><ins>+#include &lt;wtf/HashSet.h&gt;
</ins><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -72,10 +73,15 @@
</span><span class="cx"> 
</span><span class="cx">     void didGetAllDatabaseNames(uint64_t callbackID, const Vector&lt;String&gt;&amp; databaseNames);
</span><span class="cx"> 
</span><ins>+    void registerDatabaseConnection(UniqueIDBDatabaseConnection&amp;);
+    void unregisterDatabaseConnection(UniqueIDBDatabaseConnection&amp;);
+    void connectionToClientClosed();
+
</ins><span class="cx"> private:
</span><span class="cx">     IDBConnectionToClient(IDBConnectionToClientDelegate&amp;);
</span><span class="cx">     
</span><span class="cx">     Ref&lt;IDBConnectionToClientDelegate&gt; m_delegate;
</span><ins>+    HashSet&lt;UniqueIDBDatabaseConnection*&gt; m_databaseConnections;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBServer
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -80,6 +80,8 @@
</span><span class="cx">     ASSERT(m_connectionMap.contains(connection.identifier()));
</span><span class="cx">     ASSERT(m_connectionMap.get(connection.identifier()) == &amp;connection);
</span><span class="cx"> 
</span><ins>+    connection.connectionToClientClosed();
+
</ins><span class="cx">     m_connectionMap.remove(connection.identifier());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -56,11 +56,13 @@
</span><span class="cx">     , m_openRequestIdentifier(request.requestData().requestIdentifier())
</span><span class="cx"> {
</span><span class="cx">     m_database.server().registerDatabaseConnection(*this);
</span><ins>+    m_connectionToClient.registerDatabaseConnection(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection()
</span><span class="cx"> {
</span><span class="cx">     m_database.server().unregisterDatabaseConnection(*this);
</span><ins>+    m_connectionToClient.unregisterDatabaseConnection(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool UniqueIDBDatabaseConnection::hasNonFinishedTransactions() const
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-06-22  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        DatabaseProcess doesn't handle WebProcesses going away uncleanly.
+        https://bugs.webkit.org/show_bug.cgi?id=158894
+
+        Reviewed by Alex Christensen.
+
+        * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
+        (WebKit::DatabaseToWebProcessConnection::didClose):
+        
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+        (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Actually unregister this connection
+          from the IDBServer so it can clean up.
+        (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
+        
</ins><span class="cx"> 2016-06-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Stop using PassRefPtr in ShareableResource
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessDatabaseToWebProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -85,7 +85,11 @@
</span><span class="cx"> void DatabaseToWebProcessConnection::didClose(IPC::Connection&amp;)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><del>-    // FIXME: (Modern IDB) The WebProcess has disconnected, close all of the connections associated with it
</del><ins>+    auto connections = m_webIDBConnections;
+    for (auto&amp; connection : connections.values())
+        connection-&gt;disconnectedFromWebProcess();
+
+    m_webIDBConnections.clear();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -58,11 +58,11 @@
</span><span class="cx"> 
</span><span class="cx"> WebIDBConnectionToClient::~WebIDBConnectionToClient()
</span><span class="cx"> {
</span><del>-    DatabaseProcess::singleton().idbServer().unregisterConnection(*m_connectionToClient);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebIDBConnectionToClient::disconnectedFromWebProcess()
</span><span class="cx"> {
</span><ins>+    DatabaseProcess::singleton().idbServer().unregisterConnection(*m_connectionToClient);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IPC::Connection* WebIDBConnectionToClient::messageSenderConnection()
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Tools/ChangeLog        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-06-22  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        DatabaseProcess doesn't handle WebProcesses going away uncleanly.
+        https://bugs.webkit.org/show_bug.cgi?id=158894
+
+        Reviewed by Alex Christensen.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html: Added.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm:
+
</ins><span class="cx"> 2016-06-22  Jon Lee  &lt;jonlee@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update animometer.plan
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx">                 51714EB51CF8C78C004723C4 /* WebProcessKillIDBCleanup-2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51714EB31CF8C761004723C4 /* WebProcessKillIDBCleanup-2.html */; };
</span><span class="cx">                 51714EB81CF8CA17004723C4 /* WebProcessKillIDBCleanup.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51714EB61CF8C7A4004723C4 /* WebProcessKillIDBCleanup.mm */; };
</span><span class="cx">                 517E7E04151119C100D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 517E7E031511187500D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html */; };
</span><ins>+                51A5877D1D1B49CD004BA9AF /* IndexedDBMultiProcess-3.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */; };
</ins><span class="cx">                 51B1EE961C80FAEF0064FB98 /* IndexedDBPersistence-1.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51B1EE941C80FADD0064FB98 /* IndexedDBPersistence-1.html */; };
</span><span class="cx">                 51B1EE971C80FAEF0064FB98 /* IndexedDBPersistence-2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51B1EE951C80FADD0064FB98 /* IndexedDBPersistence-2.html */; };
</span><span class="cx">                 51BCEE4E1C84F53B0042C82E /* IndexedDBMultiProcess-1.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51BCEE4C1C84F52C0042C82E /* IndexedDBMultiProcess-1.html */; };
</span><span class="lines">@@ -468,6 +469,7 @@
</span><span class="cx">                         dstPath = TestWebKitAPI.resources;
</span><span class="cx">                         dstSubfolderSpec = 7;
</span><span class="cx">                         files = (
</span><ins>+                                51A5877D1D1B49CD004BA9AF /* IndexedDBMultiProcess-3.html in Copy Resources */,
</ins><span class="cx">                                 9984FACE1CFFB090008D198C /* editable-body.html in Copy Resources */,
</span><span class="cx">                                 51714EB41CF8C78C004723C4 /* WebProcessKillIDBCleanup-1.html in Copy Resources */,
</span><span class="cx">                                 51714EB51CF8C78C004723C4 /* WebProcessKillIDBCleanup-2.html in Copy Resources */,
</span><span class="lines">@@ -696,6 +698,7 @@
</span><span class="cx">                 51714EB91D087416004723C4 /* CrossThreadTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossThreadTask.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517E7DFB15110EA600D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCachePruneWithinResourceLoadDelegate.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517E7E031511187500D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MemoryCachePruneWithinResourceLoadDelegate.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;IndexedDBMultiProcess-3.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 51B1EE8D1C80F5880064FB98 /* IndexedDBPersistence.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IndexedDBPersistence.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51B1EE941C80FADD0064FB98 /* IndexedDBPersistence-1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;IndexedDBPersistence-1.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51B1EE951C80FADD0064FB98 /* IndexedDBPersistence-2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;IndexedDBPersistence-2.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1254,6 +1257,7 @@
</span><span class="cx">                                 5714ECBA1CA8BFD100051AC8 /* DownloadRequestOriginalURLFrame.html */,
</span><span class="cx">                                 51BCEE4C1C84F52C0042C82E /* IndexedDBMultiProcess-1.html */,
</span><span class="cx">                                 51BCEE4D1C84F52C0042C82E /* IndexedDBMultiProcess-2.html */,
</span><ins>+                                51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */,
</ins><span class="cx">                                 51B1EE941C80FADD0064FB98 /* IndexedDBPersistence-1.html */,
</span><span class="cx">                                 51B1EE951C80FADD0064FB98 /* IndexedDBPersistence-2.html */,
</span><span class="cx">                                 51714EB21CF8C761004723C4 /* WebProcessKillIDBCleanup-1.html */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBMultiProcess2html"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx">     req.onsuccess = function(event)
</span><span class="cx">     {
</span><span class="cx">         window.webkit.messageHandlers.testHandler.postMessage('Value of foo: ' + req.result);
</span><ins>+        continueTest1();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     req.onerror = function(event)
</span><span class="lines">@@ -29,4 +30,63 @@
</span><span class="cx">     // Unexpected upgrade needed
</span><span class="cx">     window.webkit.messageHandlers.testHandler.postMessage('Unexpected UpgradeNeeded');
</span><span class="cx"> }
</span><ins>+
+function continueTest1()
+{
+    var request = window.indexedDB.deleteDatabase(&quot;ProcessCloseIDBCleanup&quot;);
+    request.onsuccess = function(e)
+    {
+        continueTest2();
+    }
+    request.onerror = function(e)
+    {
+        // Unexpected error
+        window.webkit.messageHandlers.testHandler.postMessage('Error deleting ProcessCloseIDBCleanup database');
+    }
+}
+
+function startGetLoop()
+{
+    var request = window.indexedDB.open(&quot;ProcessCloseIDBCleanup&quot;);
+    request.onsuccess = function(e)
+    {
+        var req = e.target.result.transaction([&quot;TestObjectStore&quot;]).objectStore(&quot;TestObjectStore&quot;).get(&quot;foo&quot;);
+        req.onsuccess = startGetLoop;
+        req.onerror = function(e)
+        {
+            // Unexpected error
+            window.webkit.messageHandlers.testHandler.postMessage('Error with a get loop');
+        }
+    }
+
+    request.onerror = function(e)
+    {
+        // Unexpected error
+        window.webkit.messageHandlers.testHandler.postMessage('Error with a get loop');
+    }
+}
+
+function continueTest2()
+{
+    var request = window.indexedDB.open(&quot;ProcessCloseIDBCleanup&quot;);
+    request.onsuccess = function(e)
+    {
+        for (var i = 0; i &lt; 75; ++i)
+            startGetLoop();
+
+        setTimeout(&quot;window.webkit.messageHandlers.testHandler.postMessage('Get loops started');&quot;, 0);
+    }
+
+    request.onerror = function(e)
+    {
+        // Unexpected error
+        window.webkit.messageHandlers.testHandler.postMessage('Error opening ProcessCloseIDBCleanup database');
+    }
+
+    request.onupgradeneeded = function(e)
+    {
+        e.target.result.createObjectStore(&quot;TestObjectStore&quot;).put(&quot;bar&quot;, &quot;foo&quot;);
+    }
+}
+
</ins><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBMultiProcess3html"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html (0 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;script&gt;
+
+var request = window.indexedDB.deleteDatabase(&quot;ProcessCloseIDBCleanup&quot;);
+
+request.onsuccess = function(event)
+{
+    window.webkit.messageHandlers.testHandler.postMessage('Deleted!');
+}
+
+request.onerror = function()
+{
+    // Unexpected error
+    window.webkit.messageHandlers.testHandler.postMessage('Unexpected error opening database');
+}
+
+request.onblocked = function(event)
+{
+    window.webkit.messageHandlers.testHandler.postMessage('Blocked!');
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBMultiProcessmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm (202358 => 202359)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm        2016-06-22 23:35:25 UTC (rev 202358)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm        2016-06-22 23:46:05 UTC (rev 202359)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     receivedScriptMessage = false;
</span><span class="cx">     RetainPtr&lt;NSString&gt; string3 = (NSString *)[lastScriptMessage body];
</span><span class="cx"> 
</span><del>-    // Make a new web view with a new web process to finish the test
</del><ins>+    // Make a new web view with a new web process to continue the test
</ins><span class="cx">     RetainPtr&lt;WKWebView&gt; webView2 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
</span><span class="cx"> 
</span><span class="cx">     request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@&quot;IndexedDBMultiProcess-2&quot; withExtension:@&quot;html&quot; subdirectory:@&quot;TestWebKitAPI.resources&quot;]];
</span><span class="lines">@@ -95,6 +95,29 @@
</span><span class="cx">     EXPECT_WK_STREQ(@&quot;Transaction complete&quot;, string2.get());
</span><span class="cx">     EXPECT_WK_STREQ(@&quot;Open success&quot;, string3.get());
</span><span class="cx">     EXPECT_WK_STREQ(@&quot;Value of foo: bar&quot;, string4.get());
</span><ins>+
+    TestWebKitAPI::Util::run(&amp;receivedScriptMessage);
+    receivedScriptMessage = false;
+    RetainPtr&lt;NSString&gt; string5 = (NSString *)[lastScriptMessage body];
+    EXPECT_WK_STREQ(@&quot;Get loops started&quot;, string5.get());
+
+    // Make a new web view with a new web process to continue the test
+    RetainPtr&lt;WKWebView&gt; webView3 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+    request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@&quot;IndexedDBMultiProcess-3&quot; withExtension:@&quot;html&quot; subdirectory:@&quot;TestWebKitAPI.resources&quot;]];
+    [webView3 loadRequest:request];
+
+    TestWebKitAPI::Util::run(&amp;receivedScriptMessage);
+    receivedScriptMessage = false;
+    RetainPtr&lt;NSString&gt; string6 = (NSString *)[lastScriptMessage body];
+    EXPECT_WK_STREQ(@&quot;Blocked!&quot;, string6.get());
+
+    // Kill the blocking web process
+    webView2 = nil;
+
+    TestWebKitAPI::Util::run(&amp;receivedScriptMessage);
+    receivedScriptMessage = false;
+    RetainPtr&lt;NSString&gt; string7 = (NSString *)[lastScriptMessage body];
+    EXPECT_WK_STREQ(@&quot;Deleted!&quot;, string7.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>