<!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>[202809] 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/202809">202809</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-07-04 08:30:50 -0700 (Mon, 04 Jul 2016)</dd>
</dl>

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

Reviewed by Alex Christensen.

Source/WebCore:

Covered by new API test.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::didCloseFromServer):
(WebCore::IDBDatabase::connectionToServerLost):
* Modules/indexeddb/IDBDatabase.h:

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost): Notify all IDBDatabase
  connections, as well as all pending IDBOpenDBRequests, with the error about the
  server connection dropping.
* Modules/indexeddb/client/IDBConnectionProxy.h:

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost):
* Modules/indexeddb/client/IDBConnectionToServer.h:

* Modules/indexeddb/shared/IDBError.h:

Source/WebKit2:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::connectionToServerLost):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
(WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
(WebKit::WebToDatabaseProcessConnection::didClose): Notify each connection
  that the database server connection dropped.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill-1.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm: Added.
(-[DatabaseProcessKillNavigationDelegate webView:didFinishNavigation:]):
(-[DatabaseProcessKillMessageHandler userContentController:didReceiveScriptMessage:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBErrorh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesWebToDatabaseProcessConnectioncpp">trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBDatabaseProcessKill1html">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill-1.html</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBDatabaseProcessKillmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/ChangeLog        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-07-04  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        WebProcesses don't handle DatabaseProcess going away uncleanly..
+        https://bugs.webkit.org/show_bug.cgi?id=159371
+
+        Reviewed by Alex Christensen.
+
+        Covered by new API test.
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::didCloseFromServer):
+        (WebCore::IDBDatabase::connectionToServerLost):
+        * Modules/indexeddb/IDBDatabase.h:
+        
+        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+        (WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost): Notify all IDBDatabase
+          connections, as well as all pending IDBOpenDBRequests, with the error about the
+          server connection dropping.
+        * Modules/indexeddb/client/IDBConnectionProxy.h:
+        
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        
+        * Modules/indexeddb/shared/IDBError.h:
+
</ins><span class="cx"> 2016-07-04  Philippe Normand  &lt;pnormand@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Release build with logging enabled fails
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -257,6 +257,15 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBDatabase::didCloseFromServer - %&quot; PRIu64, m_databaseConnectionIdentifier);
</span><span class="cx"> 
</span><ins>+    connectionToServerLost(error);
+
+    m_connectionProxy-&gt;confirmDidCloseFromServer(*this);
+}
+
+void IDBDatabase::connectionToServerLost(const IDBError&amp; error)
+{
+    LOG(IndexedDB, &quot;IDBDatabase::connectionToServerLost - %&quot; PRIu64, m_databaseConnectionIdentifier);
+
</ins><span class="cx">     ASSERT(currentThread() == originThreadID());
</span><span class="cx"> 
</span><span class="cx">     m_closePending = true;
</span><span class="lines">@@ -268,8 +277,6 @@
</span><span class="cx">     Ref&lt;Event&gt; event = Event::create(eventNames().errorEvent, true, false);
</span><span class="cx">     event-&gt;setTarget(this);
</span><span class="cx">     scriptExecutionContext()-&gt;eventQueue().enqueueEvent(WTFMove(event));
</span><del>-
-    m_connectionProxy-&gt;confirmDidCloseFromServer(*this);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBDatabase::maybeCloseInServer()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx"> 
</span><span class="cx">     void fireVersionChangeEvent(const IDBResourceIdentifier&amp; requestIdentifier, uint64_t requestedVersion);
</span><span class="cx">     void didCloseFromServer(const IDBError&amp;);
</span><ins>+    void connectionToServerLost(const IDBError&amp;);
</ins><span class="cx"> 
</span><span class="cx">     IDBClient::IDBConnectionProxy&amp; connectionProxy() { return m_connectionProxy.get(); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -386,6 +386,48 @@
</span><span class="cx">     callConnectionOnMainThread(&amp;IDBConnectionToServer::confirmDidCloseFromServer, database.databaseConnectionIdentifier());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionProxy::connectionToServerLost(const IDBError&amp; error)
+{
+    Vector&lt;uint64_t&gt; databaseConnectionIdentifiers;
+    {
+        Locker&lt;Lock&gt; locker(m_databaseConnectionMapLock);
+        copyKeysToVector(m_databaseConnectionMap, databaseConnectionIdentifiers);
+    }
+
+    for (auto connectionIdentifier : databaseConnectionIdentifiers) {
+        RefPtr&lt;IDBDatabase&gt; database;
+        {
+            Locker&lt;Lock&gt; locker(m_databaseConnectionMapLock);
+            database = m_databaseConnectionMap.get(connectionIdentifier);
+        }
+
+        if (!database)
+            continue;
+
+        database-&gt;performCallbackOnOriginThread(*database, &amp;IDBDatabase::connectionToServerLost, error);
+    }
+
+    Vector&lt;IDBResourceIdentifier&gt; openDBRequestIdentifiers;
+    {
+        Locker&lt;Lock&gt; locker(m_openDBRequestMapLock);
+        copyKeysToVector(m_openDBRequestMap, openDBRequestIdentifiers);
+    }
+
+    for (auto&amp; requestIdentifier : openDBRequestIdentifiers) {
+        RefPtr&lt;IDBOpenDBRequest&gt; request;
+        {
+            Locker&lt;Lock&gt; locker(m_openDBRequestMapLock);
+            request = m_openDBRequestMap.get(requestIdentifier);
+        }
+
+        if (!request)
+            continue;
+
+        auto result = IDBResultData::error(requestIdentifier, error);
+        request-&gt;performCallbackOnOriginThread(*request, &amp;IDBOpenDBRequest::requestCompleted, result);
+    }
+}
+
</ins><span class="cx"> void IDBConnectionProxy::scheduleMainThreadTasks()
</span><span class="cx"> {
</span><span class="cx">     Locker&lt;Lock&gt; locker(m_mainThreadTaskLock);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -97,6 +97,8 @@
</span><span class="cx">     void didCloseFromServer(uint64_t databaseConnectionIdentifier, const IDBError&amp;);
</span><span class="cx">     void confirmDidCloseFromServer(IDBDatabase&amp;);
</span><span class="cx"> 
</span><ins>+    void connectionToServerLost(const IDBError&amp;);
+
</ins><span class="cx">     void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier);
</span><span class="cx"> 
</span><span class="cx">     void completeOperation(const IDBResultData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -332,6 +332,14 @@
</span><span class="cx">     m_delegate-&gt;confirmDidCloseFromServer(databaseConnectionIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToServer::connectionToServerLost(const IDBError&amp; error)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::connectionToServerLost&quot;);
+    ASSERT(isMainThread());
+
+    m_proxy-&gt;connectionToServerLost(error);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::notifyOpenDBRequestBlocked(const IDBResourceIdentifier&amp; requestIdentifier, uint64_t oldVersion, uint64_t newVersion)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBConnectionToServer::didStartTransaction&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -110,6 +110,8 @@
</span><span class="cx">     WEBCORE_EXPORT void didCloseFromServer(uint64_t databaseConnectionIdentifier, const IDBError&amp;);
</span><span class="cx">     void confirmDidCloseFromServer(uint64_t databaseConnectionIdentifier);
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT void connectionToServerLost(const IDBError&amp;);
+
</ins><span class="cx">     WEBCORE_EXPORT void notifyOpenDBRequestBlocked(const IDBResourceIdentifier&amp; requestIdentifier, uint64_t oldVersion, uint64_t newVersion);
</span><span class="cx">     void openDBRequestCancelled(const IDBRequestData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBErrorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> public:
</span><span class="cx">     IDBError() { }
</span><span class="cx">     IDBError(ExceptionCode);
</span><del>-    IDBError(ExceptionCode, const String&amp; message);
</del><ins>+    WEBCORE_EXPORT IDBError(ExceptionCode, const String&amp; message);
</ins><span class="cx"> 
</span><span class="cx">     static IDBError userDeleteError()
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebKit2/ChangeLog        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-07-04  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        WebProcesses don't handle DatabaseProcess going away uncleanly..
+        https://bugs.webkit.org/show_bug.cgi?id=159371
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
+
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::connectionToServerLost):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+
+        * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
+        (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
+        (WebKit::WebToDatabaseProcessConnection::didClose): Notify each connection
+          that the database server connection dropped.
+
</ins><span class="cx"> 2016-07-04  Fujii Hironori  &lt;Hironori.Fujii@sony.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Null WebCore::Range dereference in WebEditorClient::updateGlobalSelection
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -1100,7 +1100,6 @@
</span><span class="cx"> void WebProcessPool::terminateDatabaseProcess()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(DATABASE_PROCESS)
</span><del>-    ASSERT(m_processes.isEmpty());
</del><span class="cx">     if (!m_databaseProcess)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;WebToDatabaseProcessConnection.h&quot;
</span><span class="cx"> #include &lt;WebCore/IDBConnectionToServer.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBCursorInfo.h&gt;
</span><ins>+#include &lt;WebCore/IDBDatabaseException.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IDBError.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBIndexInfo.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBKeyRangeData.h&gt;
</span><span class="lines">@@ -316,6 +317,11 @@
</span><span class="cx">     m_connectionToServer-&gt;didGetAllDatabaseNames(callbackID, databaseNames);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToServer::connectionToServerLost()
+{
+    m_connectionToServer-&gt;connectionToServerLost({ WebCore::IDBDatabaseException::UnknownError, ASCIILiteral(&quot;An internal error was encountered in the Indexed Database server&quot;) });
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -98,6 +98,8 @@
</span><span class="cx"> 
</span><span class="cx">     void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span><span class="cx"> 
</span><ins>+    void connectionToServerLost();
+
</ins><span class="cx"> private:
</span><span class="cx">     WebIDBConnectionToServer();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesWebToDatabaseProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -52,9 +52,9 @@
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">     if (decoder.messageReceiverName() == Messages::WebIDBConnectionToServer::messageReceiverName()) {
</span><del>-        auto iterator = m_webIDBConnectionsByIdentifier.find(decoder.destinationID());
-        if (iterator != m_webIDBConnectionsByIdentifier.end())
-            iterator-&gt;value-&gt;didReceiveMessage(connection, decoder);
</del><ins>+        auto idbConnection = m_webIDBConnectionsByIdentifier.get(decoder.destinationID());
+        if (idbConnection)
+            idbConnection-&gt;didReceiveMessage(connection, decoder);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -64,6 +64,12 @@
</span><span class="cx"> 
</span><span class="cx"> void WebToDatabaseProcessConnection::didClose(IPC::Connection&amp; connection)
</span><span class="cx"> {
</span><ins>+    for (auto&amp; connection : m_webIDBConnectionsByIdentifier.values())
+        connection-&gt;connectionToServerLost();
+
+    m_webIDBConnectionsByIdentifier.clear();
+    m_webIDBConnectionsBySession.clear();
+
</ins><span class="cx">     WebProcess::singleton().webToDatabaseProcessConnectionClosed(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Tools/ChangeLog        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-07-04  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        WebProcesses don't handle DatabaseProcess going away uncleanly..
+        https://bugs.webkit.org/show_bug.cgi?id=159371
+
+        Reviewed by Alex Christensen.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill-1.html: Added.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm: Added.
+        (-[DatabaseProcessKillNavigationDelegate webView:didFinishNavigation:]):
+        (-[DatabaseProcessKillMessageHandler userContentController:didReceiveScriptMessage:]):
+
</ins><span class="cx"> 2016-07-04  Carlos Alberto Lopez Perez  &lt;clopez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][GTK] Layout Test doesn't run on Ubuntu 16.04
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (202808 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-07-04 11:44:11 UTC (rev 202808)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -71,6 +71,8 @@
</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><span class="cx">                 51A5877D1D1B49CD004BA9AF /* IndexedDBMultiProcess-3.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */; };
</span><ins>+                51A587851D2739E3004BA9AF /* IndexedDBDatabaseProcessKill-1.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51A587821D272EB5004BA9AF /* IndexedDBDatabaseProcessKill-1.html */; };
+                51A587861D273AA9004BA9AF /* IndexedDBDatabaseProcessKill.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51A587841D272EF3004BA9AF /* IndexedDBDatabaseProcessKill.mm */; };
</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">@@ -470,6 +472,7 @@
</span><span class="cx">                         dstPath = TestWebKitAPI.resources;
</span><span class="cx">                         dstSubfolderSpec = 7;
</span><span class="cx">                         files = (
</span><ins>+                                51A587851D2739E3004BA9AF /* IndexedDBDatabaseProcessKill-1.html in Copy Resources */,
</ins><span class="cx">                                 51A5877D1D1B49CD004BA9AF /* IndexedDBMultiProcess-3.html in Copy Resources */,
</span><span class="cx">                                 9984FACE1CFFB090008D198C /* editable-body.html in Copy Resources */,
</span><span class="cx">                                 51714EB41CF8C78C004723C4 /* WebProcessKillIDBCleanup-1.html in Copy Resources */,
</span><span class="lines">@@ -700,6 +703,8 @@
</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><span class="cx">                 51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;IndexedDBMultiProcess-3.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                51A587821D272EB5004BA9AF /* IndexedDBDatabaseProcessKill-1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;IndexedDBDatabaseProcessKill-1.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
+                51A587841D272EF3004BA9AF /* IndexedDBDatabaseProcessKill.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IndexedDBDatabaseProcessKill.mm; 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">@@ -1151,6 +1156,7 @@
</span><span class="cx">                                 2D8104CB1BEC13E70020DA46 /* FindInPage.mm */,
</span><span class="cx">                                 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */,
</span><span class="cx">                                 CDE195B31CFE0ADE0053D256 /* FullscreenTopContentInset.mm */,
</span><ins>+                                51A587841D272EF3004BA9AF /* IndexedDBDatabaseProcessKill.mm */,
</ins><span class="cx">                                 51BCEE491C84F4AF0042C82E /* IndexedDBMultiProcess.mm */,
</span><span class="cx">                                 51B1EE8D1C80F5880064FB98 /* IndexedDBPersistence.mm */,
</span><span class="cx">                                 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */,
</span><span class="lines">@@ -1257,6 +1263,7 @@
</span><span class="cx">                                 5714ECB81CA8B58800051AC8 /* DownloadRequestOriginalURL.html */,
</span><span class="cx">                                 5714ECBC1CA8C21800051AC8 /* DownloadRequestOriginalURL2.html */,
</span><span class="cx">                                 5714ECBA1CA8BFD100051AC8 /* DownloadRequestOriginalURLFrame.html */,
</span><ins>+                                51A587821D272EB5004BA9AF /* IndexedDBDatabaseProcessKill-1.html */,
</ins><span class="cx">                                 51BCEE4C1C84F52C0042C82E /* IndexedDBMultiProcess-1.html */,
</span><span class="cx">                                 51BCEE4D1C84F52C0042C82E /* IndexedDBMultiProcess-2.html */,
</span><span class="cx">                                 51A5877C1D1B3D8D004BA9AF /* IndexedDBMultiProcess-3.html */,
</span><span class="lines">@@ -2095,6 +2102,7 @@
</span><span class="cx">                                 7CCE7F241A411AF600447C4C /* Navigation.mm in Sources */,
</span><span class="cx">                                 A14FC5881B8991BF00D107EB /* ContentFiltering.mm in Sources */,
</span><span class="cx">                                 7CCE7F021A411AE600447C4C /* NewFirstVisuallyNonEmptyLayout.cpp in Sources */,
</span><ins>+                                51A587861D273AA9004BA9AF /* IndexedDBDatabaseProcessKill.mm in Sources */,
</ins><span class="cx">                                 7CCE7F031A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutFails.cpp in Sources */,
</span><span class="cx">                                 7CCE7F041A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */,
</span><span class="cx">                                 764322D71B61CCC30024F801 /* WordBoundaryTypingAttributes.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBDatabaseProcessKill1html"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill-1.html (0 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill-1.html                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill-1.html        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;script&gt;
+
+var database;
+
+for (var i = 0; i &lt; 100; ++i) {
+    var request = window.indexedDB.deleteDatabase(&quot;IndexedDBDatabaseProcessKill&quot;);
+    request.onsuccess = function() {
+        window.webkit.messageHandlers.testHandler.postMessage('DeleteRequestDone');
+    }
+    request.onerror = function() {
+        window.webkit.messageHandlers.testHandler.postMessage('DeleteRequestError');
+    }
+
+    request = window.indexedDB.open(&quot;IndexedDBDatabaseProcessKill&quot;);
+    request.onsuccess = function() {
+        window.webkit.messageHandlers.testHandler.postMessage('OpenRequestDone');
+    }
+    request.onerror = function() {
+        window.webkit.messageHandlers.testHandler.postMessage('OpenRequestError');
+    }
+    request.onupgradeneeded = function(e) {
+        database = e.target.result;
+        database.onerror = function() {
+            notifyDatabaseErrorReceived = function() {
+                window.webkit.messageHandlers.testHandler.postMessage('DatabaseErrorReceived');
+            }
+            setTimeout(&quot;setTimeout(notifyDatabaseErrorReceived, 0)&quot;, 0);
+        }
+        window.webkit.messageHandlers.testHandler.postMessage('OpenRequestUpgradeNeeded');
+    }
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaIndexedDBDatabaseProcessKillmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm (0 => 202809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm        2016-07-04 15:30:50 UTC (rev 202809)
</span><span class="lines">@@ -0,0 +1,126 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;Test.h&quot;
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;WebKit/WKUserContentControllerPrivate.h&gt;
+#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
+#import &lt;WebKit/WebKit.h&gt;
+#import &lt;WebKit/_WKProcessPoolConfiguration.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+#if WK_API_ENABLED
+
+static bool isDoneWithNavigation;
+
+@interface DatabaseProcessKillNavigationDelegate : NSObject &lt;WKNavigationDelegate&gt;
+@end
+
+@implementation DatabaseProcessKillNavigationDelegate
+
+- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
+{
+    isDoneWithNavigation = true;
+}
+
+@end
+
+static bool receivedScriptMessage;
+static bool receivedAtLeastOneOpenError;
+static bool receivedAtLeastOneDeleteError;
+static bool openRequestUpgradeNeeded;
+static bool databaseErrorReceived;
+
+@interface DatabaseProcessKillMessageHandler : NSObject &lt;WKScriptMessageHandler&gt;
+@end
+
+@implementation DatabaseProcessKillMessageHandler
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+    receivedScriptMessage = true;
+
+    if ([[message body] isEqualToString:@&quot;DatabaseErrorReceived&quot;]) {
+        databaseErrorReceived = true;
+        return;
+    }
+
+    if ([[message body] isEqualToString:@&quot;OpenRequestUpgradeNeeded&quot;]) {
+        openRequestUpgradeNeeded = true;
+        return;
+    }
+
+    if ([[message body] isEqualToString:@&quot;DeleteRequestError&quot;]) {
+        receivedAtLeastOneDeleteError = true;
+        return;
+    }
+
+    if ([[message body] isEqualToString:@&quot;OpenRequestError&quot;])
+        receivedAtLeastOneOpenError = true;
+}
+
+@end
+
+TEST(IndexedDB, DatabaseProcessKill)
+{
+    RetainPtr&lt;DatabaseProcessKillMessageHandler&gt; handler = adoptNS([[DatabaseProcessKillMessageHandler alloc] init]);
+    RetainPtr&lt;WKWebViewConfiguration&gt; configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    [[configuration userContentController] addScriptMessageHandler:handler.get() name:@&quot;testHandler&quot;];
+
+    // Allow file URLs to load non-file resources
+    [configuration _setAllowUniversalAccessFromFileURLs:YES];
+
+    RetainPtr&lt;WKWebView&gt; webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+
+    DatabaseProcessKillNavigationDelegate *delegate = [[DatabaseProcessKillNavigationDelegate alloc] init];
+    [webView setNavigationDelegate:delegate];
+
+    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@&quot;IndexedDBDatabaseProcessKill-1&quot; withExtension:@&quot;html&quot; subdirectory:@&quot;TestWebKitAPI.resources&quot;]];
+    [webView loadRequest:request];
+
+    TestWebKitAPI::Util::run(&amp;isDoneWithNavigation);
+
+    bool killedDBProcess = false;
+    while (true) {
+        if (databaseErrorReceived)
+            break;
+
+        receivedScriptMessage = false;
+        TestWebKitAPI::Util::run(&amp;receivedScriptMessage);
+        if (!killedDBProcess &amp;&amp; openRequestUpgradeNeeded) {
+            killedDBProcess = true;
+            [configuration.get().processPool _terminateDatabaseProcess];
+        }
+    }
+
+    EXPECT_EQ(receivedAtLeastOneOpenError, true);
+    EXPECT_EQ(receivedAtLeastOneDeleteError, true);
+    EXPECT_EQ(databaseErrorReceived, true);
+}
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>