<!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 <beidson@apple.com>
+
+ 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 <bpoulain@apple.com>
</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->didGetAllDatabaseNames(callbackID, databaseNames);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToClient::registerDatabaseConnection(UniqueIDBDatabaseConnection& connection)
+{
+ ASSERT(!m_databaseConnections.contains(&connection));
+ m_databaseConnections.add(&connection);
+}
+
+void IDBConnectionToClient::unregisterDatabaseConnection(UniqueIDBDatabaseConnection& connection)
+{
+ m_databaseConnections.remove(&connection);
+}
+
+void IDBConnectionToClient::connectionToClientClosed()
+{
+ auto databaseConnections = m_databaseConnections;
+
+ for (auto connection : databaseConnections) {
+ if (m_databaseConnections.contains(connection))
+ connection->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 "IDBConnectionToClientDelegate.h"
</span><ins>+#include <wtf/HashSet.h>
</ins><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</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<String>& databaseNames);
</span><span class="cx">
</span><ins>+ void registerDatabaseConnection(UniqueIDBDatabaseConnection&);
+ void unregisterDatabaseConnection(UniqueIDBDatabaseConnection&);
+ void connectionToClientClosed();
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBConnectionToClient(IDBConnectionToClientDelegate&);
</span><span class="cx">
</span><span class="cx"> Ref<IDBConnectionToClientDelegate> m_delegate;
</span><ins>+ HashSet<UniqueIDBDatabaseConnection*> 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()) == &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 <beidson@apple.com>
+
+ 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 <cdumez@apple.com>
</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&)
</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& connection : connections.values())
+ connection->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 <beidson@apple.com>
+
+ 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 <jonlee@apple.com>
</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 = "<group>"; };
</span><span class="cx">                 517E7DFB15110EA600D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCachePruneWithinResourceLoadDelegate.mm; sourceTree = "<group>"; };
</span><span class="cx">                 517E7E031511187500D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MemoryCachePruneWithinResourceLoadDelegate.html; sourceTree = "<group>"; };
</span><ins>+                51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "IndexedDBMultiProcess-3.html"; sourceTree = "<group>"; };
</ins><span class="cx">                 51B1EE8D1C80F5880064FB98 /* IndexedDBPersistence.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IndexedDBPersistence.mm; sourceTree = "<group>"; };
</span><span class="cx">                 51B1EE941C80FADD0064FB98 /* IndexedDBPersistence-1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "IndexedDBPersistence-1.html"; sourceTree = "<group>"; };
</span><span class="cx">                 51B1EE951C80FADD0064FB98 /* IndexedDBPersistence-2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "IndexedDBPersistence-2.html"; sourceTree = "<group>"; };
</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("ProcessCloseIDBCleanup");
+ 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("ProcessCloseIDBCleanup");
+ request.onsuccess = function(e)
+ {
+ var req = e.target.result.transaction(["TestObjectStore"]).objectStore("TestObjectStore").get("foo");
+ 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("ProcessCloseIDBCleanup");
+ request.onsuccess = function(e)
+ {
+ for (var i = 0; i < 75; ++i)
+ startGetLoop();
+
+ setTimeout("window.webkit.messageHandlers.testHandler.postMessage('Get loops started');", 0);
+ }
+
+ request.onerror = function(e)
+ {
+ // Unexpected error
+ window.webkit.messageHandlers.testHandler.postMessage('Error opening ProcessCloseIDBCleanup database');
+ }
+
+ request.onupgradeneeded = function(e)
+ {
+ e.target.result.createObjectStore("TestObjectStore").put("bar", "foo");
+ }
+}
+
</ins><span class="cx"> </script>
</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>+<script>
+
+var request = window.indexedDB.deleteDatabase("ProcessCloseIDBCleanup");
+
+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!');
+}
+
+</script>
</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<NSString> 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<WKWebView> 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:@"IndexedDBMultiProcess-2" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
</span><span class="lines">@@ -95,6 +95,29 @@
</span><span class="cx"> EXPECT_WK_STREQ(@"Transaction complete", string2.get());
</span><span class="cx"> EXPECT_WK_STREQ(@"Open success", string3.get());
</span><span class="cx"> EXPECT_WK_STREQ(@"Value of foo: bar", string4.get());
</span><ins>+
+ TestWebKitAPI::Util::run(&receivedScriptMessage);
+ receivedScriptMessage = false;
+ RetainPtr<NSString> string5 = (NSString *)[lastScriptMessage body];
+ EXPECT_WK_STREQ(@"Get loops started", string5.get());
+
+ // Make a new web view with a new web process to continue the test
+ RetainPtr<WKWebView> webView3 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+ request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"IndexedDBMultiProcess-3" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+ [webView3 loadRequest:request];
+
+ TestWebKitAPI::Util::run(&receivedScriptMessage);
+ receivedScriptMessage = false;
+ RetainPtr<NSString> string6 = (NSString *)[lastScriptMessage body];
+ EXPECT_WK_STREQ(@"Blocked!", string6.get());
+
+ // Kill the blocking web process
+ webView2 = nil;
+
+ TestWebKitAPI::Util::run(&receivedScriptMessage);
+ receivedScriptMessage = false;
+ RetainPtr<NSString> string7 = (NSString *)[lastScriptMessage body];
+ EXPECT_WK_STREQ(@"Deleted!", string7.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>