<!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>[236035] 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/236035">236035</a></dd>
<dt>Author</dt> <dd>sihui_liu@apple.com</dd>
<dt>Date</dt> <dd>2018-09-17 00:11:55 -0700 (Mon, 17 Sep 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move IndexedDB to Network Process
https://bugs.webkit.org/show_bug.cgi?id=189415
<rdar://problem/44396973>

Reviewed by Chris Dumez.

Source/WebKit:

We are going to eliminate storage process and move its functionality to network process.
The reasons why we want to do this:
1. Lower resource usage of having an additional process for storage operations, especially
memory. Single storage process takes about 5MB memory on macOS.
2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
regression in app launch. The launch time of storage process is partly attributed to this:
Service Workers delay page loading until receiving response from storage process.
3. We choose network process because UI process may have broader access in file system
that we don't want the storage operations to have.

This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
to corresponding components of network process. Moving of Service Worker and stopping to
launch storage process will be done in following patches.

We expect to see the higher cpu and memory usage of network process as it is taking more work,
but the overall gain in memory and latency after we completely remove storage process should be
positive.

* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didRenameObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didRenameIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::didCloseFromServer):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
(WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):

Code moved from StorageToWebProcessConnection::didReceiveMessage.

(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

Network process receives and stores sandbox extension of temporary files for later indexedDB
use.

(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::generateIDBConnectionToServerIdentifier):
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
(WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::ensurePathExists):
(WebKit::NetworkProcess::postStorageTask):
(WebKit::NetworkProcess::performNextStorageTask):
(WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
(WebKit::NetworkProcess::accessToTemporaryFileComplete):
(WebKit::NetworkProcess::indexedDatabaseOrigins):
(WebKit::NetworkProcess::addIndexedDatabaseSession):
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):

Instead of asking UI process to grant sandbox extension to storage process, now network
process just asks for sandbox extension fot itself.

(WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
(WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
(WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/Storage/StorageProcessCreationParameters.cpp:
(WebKit::StorageProcessCreationParameters::encode const):
(WebKit::StorageProcessCreationParameters::decode):
* Shared/Storage/StorageProcessCreationParameters.h:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Shared/WebsiteDataStoreParameters.h:
* Sources.txt:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::fetchWebsiteData):
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::idbServer): Deleted.
(WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
(WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
(WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
(WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
(WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
(WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
* StorageProcess/StorageProcess.h:
(WebKit::StorageProcess::queue): Deleted.
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::didClose):
(WebKit::generateIDBConnectionToServerIdentifier): Deleted.
(WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
(WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::storageProcessParameters):
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier const):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::didClose):
(WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):
(WebKit::WebProcess::webToStorageProcessConnectionClosed):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
(TEST):

LayoutTests:

* storage/indexeddb/modern/opendatabase-after-storage-crash.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernopendatabaseafterstoragecrashhtml">trunk/LayoutTests/storage/indexeddb/modern/opendatabase-after-storage-crash.html</a></li>
<li><a href="#trunkSourceWebKitCMakeListstxt">trunk/Source/WebKit/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitDerivedSourcesmake">trunk/Source/WebKit/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessh">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessmessagesin">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessh">trunk/Source/WebKit/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessmessagesin">trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessCreationParameterscpp">trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessCreationParametersh">trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKitSharedStorageStorageProcessCreationParameterscpp">trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedStorageStorageProcessCreationParametersh">trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKitSharedWebsiteDataStoreParameterscpp">trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebsiteDataStoreParametersh">trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h</a></li>
<li><a href="#trunkSourceWebKitSourcestxt">trunk/Source/WebKit/Sources.txt</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageProcesscpp">trunk/Source/WebKit/StorageProcess/StorageProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageProcessh">trunk/Source/WebKit/StorageProcess/StorageProcess.h</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageProcessmessagesin">trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageToWebProcessConnectioncpp">trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageToWebProcessConnectionh">trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageToWebProcessConnectionmessagesin">trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxyh">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxymessagesin">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitUIProcessStorageStorageProcessProxycpp">trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessStorageStorageProcessProxyh">trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessStorageStorageProcessProxymessagesin">trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebProcessPoolcpp">trunk/Source/WebKit/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm">trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessDatabasesIndexedDBWebIDBConnectionToServercpp">trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessDatabasesWebDatabaseProvidercpp">trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkNetworkProcessConnectioncpp">trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkNetworkProcessConnectionh">trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageWebToStorageProcessConnectioncpp">trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageWebToStorageProcessConnectionh">trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcesscpp">trunk/Source/WebKit/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaIDBDeleteRecoverymm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaIDBIndexUpgradeToV2mm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaIndexedDBDatabaseProcessKillmm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaIndexedDBMultiProcessmm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaIndexedDBPersistencemm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebKit/NetworkProcess/IndexedDB/</li>
<li><a href="#trunkSourceWebKitNetworkProcessIndexedDBWebIDBConnectionToClientcpp">trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessIndexedDBWebIDBConnectionToClienth">trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessIndexedDBWebIDBConnectionToClientmessagesin">trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/Source/WebKit/StorageProcess/IndexedDB/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/LayoutTests/ChangeLog 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2018-09-17  Sihui Liu  <sihui_liu@apple.com>
+
+        Move IndexedDB to Network Process
+        https://bugs.webkit.org/show_bug.cgi?id=189415
+        <rdar://problem/44396973>
+
+        Reviewed by Chris Dumez.
+
+        * storage/indexeddb/modern/opendatabase-after-storage-crash.html:
+
</ins><span class="cx"> 2018-09-16  Ryan Haddad  <ryanhaddad@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed test gardening, mark fast/text/variations/ipc2.html as slow.
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernopendatabaseafterstoragecrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/opendatabase-after-storage-crash.html (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/opendatabase-after-storage-crash.html 2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/LayoutTests/storage/indexeddb/modern/opendatabase-after-storage-crash.html    2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx">  if (window.testRunner) {
</span><span class="cx">          testRunner.waitUntilDone();
</span><del>-               testRunner.terminateStorageProcess();
</del><ins>+                testRunner.terminateNetworkProcess();
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/CMakeLists.txt (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/CMakeLists.txt       2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/CMakeLists.txt  2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx">     "${WEBKIT_DIR}/NetworkProcess/CustomProtocols"
</span><span class="cx">     "${WEBKIT_DIR}/NetworkProcess/Downloads"
</span><span class="cx">     "${WEBKIT_DIR}/NetworkProcess/FileAPI"
</span><ins>+    "${WEBKIT_DIR}/NetworkProcess/IndexedDB"
</ins><span class="cx">     "${WEBKIT_DIR}/NetworkProcess/cache"
</span><span class="cx">     "${WEBKIT_DIR}/NetworkProcess/capture"
</span><span class="cx">     "${WEBKIT_DIR}/NetworkProcess/watchos"
</span><span class="lines">@@ -32,7 +33,6 @@
</span><span class="cx">     "${WEBKIT_DIR}/Shared/Storage"
</span><span class="cx">     "${WEBKIT_DIR}/Shared/WebsiteData"
</span><span class="cx">     "${WEBKIT_DIR}/StorageProcess"
</span><del>-    "${WEBKIT_DIR}/StorageProcess/IndexedDB"
</del><span class="cx">     "${WEBKIT_DIR}/StorageProcess/ServiceWorker"
</span><span class="cx">     "${WEBKIT_DIR}/UIProcess"
</span><span class="cx">     "${WEBKIT_DIR}/UIProcess/API"
</span><span class="lines">@@ -110,6 +110,8 @@
</span><span class="cx">     NetworkProcess/NetworkResourceLoader.messages.in
</span><span class="cx">     NetworkProcess/NetworkSocketStream.messages.in
</span><span class="cx"> 
</span><ins>+    NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in
+
</ins><span class="cx">     NetworkProcess/cache/CacheStorageEngineConnection.messages.in
</span><span class="cx"> 
</span><span class="cx">     NetworkProcess/webrtc/NetworkMDNSRegister.messages.in
</span><span class="lines">@@ -131,8 +133,6 @@
</span><span class="cx">     StorageProcess/StorageProcess.messages.in
</span><span class="cx">     StorageProcess/StorageToWebProcessConnection.messages.in
</span><span class="cx"> 
</span><del>-    StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in
-
</del><span class="cx">     StorageProcess/ServiceWorker/WebSWServerConnection.messages.in
</span><span class="cx">     StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/ChangeLog       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -1,3 +1,217 @@
</span><ins>+2018-09-17  Sihui Liu  <sihui_liu@apple.com>
+
+        Move IndexedDB to Network Process
+        https://bugs.webkit.org/show_bug.cgi?id=189415
+        <rdar://problem/44396973>
+
+        Reviewed by Chris Dumez.
+
+        We are going to eliminate storage process and move its functionality to network process. 
+        The reasons why we want to do this:
+        1. Lower resource usage of having an additional process for storage operations, especially
+        memory. Single storage process takes about 5MB memory on macOS.
+        2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
+        regression in app launch. The launch time of storage process is partly attributed to this:
+        Service Workers delay page loading until receiving response from storage process.
+        3. We choose network process because UI process may have broader access in file system
+        that we don't want the storage operations to have.
+
+        This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
+        to corresponding components of network process. Moving of Service Worker and stopping to 
+        launch storage process will be done in following patches.
+
+        We expect to see the higher cpu and memory usage of network process as it is taking more work,
+        but the overall gain in memory and latency after we completely remove storage process should be 
+        positive.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
+        (WebKit::WebIDBConnectionToClient::create):
+        (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
+        (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
+        (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
+        (WebKit::WebIDBConnectionToClient::messageSenderConnection):
+        (WebKit::WebIDBConnectionToClient::connectionToClient):
+        (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
+        (WebKit::WebIDBConnectionToClient::didOpenDatabase):
+        (WebKit::WebIDBConnectionToClient::didAbortTransaction):
+        (WebKit::WebIDBConnectionToClient::didCommitTransaction):
+        (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
+        (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
+        (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
+        (WebKit::WebIDBConnectionToClient::didClearObjectStore):
+        (WebKit::WebIDBConnectionToClient::didCreateIndex):
+        (WebKit::WebIDBConnectionToClient::didDeleteIndex):
+        (WebKit::WebIDBConnectionToClient::didRenameIndex):
+        (WebKit::WebIDBConnectionToClient::didPutOrAdd):
+        (WebKit::WebIDBConnectionToClient::handleGetResult):
+        (WebKit::WebIDBConnectionToClient::didGetRecord):
+        (WebKit::WebIDBConnectionToClient::didGetAllRecords):
+        (WebKit::WebIDBConnectionToClient::didGetCount):
+        (WebKit::WebIDBConnectionToClient::didDeleteRecord):
+        (WebKit::WebIDBConnectionToClient::didOpenCursor):
+        (WebKit::WebIDBConnectionToClient::didIterateCursor):
+        (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
+        (WebKit::WebIDBConnectionToClient::didStartTransaction):
+        (WebKit::WebIDBConnectionToClient::didCloseFromServer):
+        (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
+        (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
+        (WebKit::WebIDBConnectionToClient::deleteDatabase):
+        (WebKit::WebIDBConnectionToClient::openDatabase):
+        (WebKit::WebIDBConnectionToClient::abortTransaction):
+        (WebKit::WebIDBConnectionToClient::commitTransaction):
+        (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
+        (WebKit::WebIDBConnectionToClient::createObjectStore):
+        (WebKit::WebIDBConnectionToClient::deleteObjectStore):
+        (WebKit::WebIDBConnectionToClient::renameObjectStore):
+        (WebKit::WebIDBConnectionToClient::clearObjectStore):
+        (WebKit::WebIDBConnectionToClient::createIndex):
+        (WebKit::WebIDBConnectionToClient::deleteIndex):
+        (WebKit::WebIDBConnectionToClient::renameIndex):
+        (WebKit::WebIDBConnectionToClient::putOrAdd):
+        (WebKit::WebIDBConnectionToClient::getRecord):
+        (WebKit::WebIDBConnectionToClient::getAllRecords):
+        (WebKit::WebIDBConnectionToClient::getCount):
+        (WebKit::WebIDBConnectionToClient::deleteRecord):
+        (WebKit::WebIDBConnectionToClient::openCursor):
+        (WebKit::WebIDBConnectionToClient::iterateCursor):
+        (WebKit::WebIDBConnectionToClient::establishTransaction):
+        (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
+        (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
+        (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
+        (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
+        (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
+        (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
+        (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
+        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
+        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
+
+        Code moved from StorageToWebProcessConnection::didReceiveMessage.
+
+        (WebKit::NetworkConnectionToWebProcess::didClose):
+        (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
+
+        Network process receives and stores sandbox extension of temporary files for later indexedDB
+        use.
+
+        (WebKit::NetworkConnectionToWebProcess::didClose):
+        (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
+        (WebKit::generateIDBConnectionToServerIdentifier):
+        (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
+        (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::NetworkProcess):
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        (WebKit::NetworkProcess::addWebsiteDataStore):
+        (WebKit::NetworkProcess::fetchWebsiteData):
+        (WebKit::NetworkProcess::deleteWebsiteData):
+        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
+        (WebKit::NetworkProcess::idbServer):
+        (WebKit::NetworkProcess::ensurePathExists):
+        (WebKit::NetworkProcess::postStorageTask):
+        (WebKit::NetworkProcess::performNextStorageTask):
+        (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
+        (WebKit::NetworkProcess::accessToTemporaryFileComplete):
+        (WebKit::NetworkProcess::indexedDatabaseOrigins):
+        (WebKit::NetworkProcess::addIndexedDatabaseSession):
+        (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
+
+        Instead of asking UI process to grant sandbox extension to storage process, now network 
+        process just asks for sandbox extension fot itself.
+
+        (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
+        (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
+        (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
+        (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode const):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * Shared/Storage/StorageProcessCreationParameters.cpp:
+        (WebKit::StorageProcessCreationParameters::encode const):
+        (WebKit::StorageProcessCreationParameters::decode):
+        * Shared/Storage/StorageProcessCreationParameters.h:
+        * Shared/WebsiteDataStoreParameters.cpp:
+        (WebKit::WebsiteDataStoreParameters::encode const):
+        (WebKit::WebsiteDataStoreParameters::decode):
+        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
+        * Shared/WebsiteDataStoreParameters.h:
+        * Sources.txt:
+        * StorageProcess/StorageProcess.cpp:
+        (WebKit::StorageProcess::initializeWebsiteDataStore):
+        (WebKit::StorageProcess::fetchWebsiteData):
+        (WebKit::StorageProcess::deleteWebsiteData):
+        (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
+        (WebKit::StorageProcess::idbServer): Deleted.
+        (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
+        (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
+        (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
+        (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
+        (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
+        (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
+        * StorageProcess/StorageProcess.h:
+        (WebKit::StorageProcess::queue): Deleted.
+        * StorageProcess/StorageProcess.messages.in:
+        * StorageProcess/StorageToWebProcessConnection.cpp:
+        (WebKit::StorageToWebProcessConnection::didReceiveMessage):
+        (WebKit::StorageToWebProcessConnection::didClose):
+        (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
+        (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
+        (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
+        * StorageProcess/StorageToWebProcessConnection.h:
+        * StorageProcess/StorageToWebProcessConnection.messages.in:
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
+        (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Network/NetworkProcessProxy.messages.in:
+        * UIProcess/Storage/StorageProcessProxy.cpp:
+        (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
+        * UIProcess/Storage/StorageProcessProxy.h:
+        * UIProcess/Storage/StorageProcessProxy.messages.in:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::ensureNetworkProcess):
+        (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
+        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::parameters):
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::computeNetworkProcessAccessTypeForDataFetch):
+        (WebKit::WebsiteDataStore::fetchDataAndApply):
+        (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
+        (WebKit::WebsiteDataStore::removeData):
+        (WebKit::WebsiteDataStore::storageProcessParameters):
+        (WebKit::WebsiteDataStore::parameters):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
+        (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
+        (WebKit::WebIDBConnectionToServer::messageSenderConnection):
+        * WebProcess/Databases/WebDatabaseProvider.cpp:
+        (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
+        * WebProcess/Network/NetworkProcessConnection.cpp:
+        (WebKit::NetworkProcessConnection::didReceiveMessage):
+        (WebKit::NetworkProcessConnection::didClose):
+        (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
+        * WebProcess/Network/NetworkProcessConnection.h:
+        (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier const):
+        * WebProcess/Storage/WebToStorageProcessConnection.cpp:
+        (WebKit::WebToStorageProcessConnection::didReceiveMessage):
+        (WebKit::WebToStorageProcessConnection::didClose):
+        (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
+        * WebProcess/Storage/WebToStorageProcessConnection.h:
+        (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::networkProcessConnectionClosed):
+        (WebKit::WebProcess::webToStorageProcessConnectionClosed):
+
</ins><span class="cx"> 2018-09-08  Darin Adler  <darin@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources.make (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources.make  2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/DerivedSources.make     2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">     $(WebKit2)/NetworkProcess/CustomProtocols \
</span><span class="cx">     $(WebKit2)/NetworkProcess/mac \
</span><span class="cx">     $(WebKit2)/NetworkProcess/webrtc \
</span><ins>+    $(WebKit2)/NetworkProcess/IndexedDB \
</ins><span class="cx">     $(WebKit2)/PluginProcess \
</span><span class="cx">     $(WebKit2)/PluginProcess/mac \
</span><span class="cx">     $(WebKit2)/Shared/Plugins \
</span><span class="lines">@@ -36,7 +37,6 @@
</span><span class="cx">     $(WebKit2)/Shared/Authentication \
</span><span class="cx">     $(WebKit2)/Shared/mac \
</span><span class="cx">     $(WebKit2)/StorageProcess \
</span><del>-    $(WebKit2)/StorageProcess/IndexedDB \
</del><span class="cx">     $(WebKit2)/StorageProcess/ServiceWorker \
</span><span class="cx">     $(WebKit2)/StorageProcess/mac \
</span><span class="cx">     $(WebKit2)/WebProcess/ApplePay \
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessIndexedDBWebIDBConnectionToClientcppfromrev236034trunkSourceWebKitStorageProcessIndexedDBWebIDBConnectionToClientcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp (from rev 236034, trunk/Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp) (0 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp                                (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp   2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -0,0 +1,371 @@
</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.
+ */
+
+#include "config.h"
+#include "WebIDBConnectionToClient.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "DataReference.h"
+#include "NetworkProcess.h"
+#include "WebCoreArgumentCoders.h"
+#include "WebIDBConnectionToServerMessages.h"
+#include "WebIDBResult.h"
+#include <WebCore/IDBError.h>
+#include <WebCore/IDBGetAllRecordsData.h>
+#include <WebCore/IDBGetRecordData.h>
+#include <WebCore/IDBResultData.h>
+#include <WebCore/IDBValue.h>
+#include <WebCore/ThreadSafeDataBuffer.h>
+#include <WebCore/UniqueIDBDatabaseConnection.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+Ref<WebIDBConnectionToClient> WebIDBConnectionToClient::create(NetworkConnectionToWebProcess& connection, uint64_t serverConnectionIdentifier, PAL::SessionID sessionID)
+{
+    return adoptRef(*new WebIDBConnectionToClient(connection, serverConnectionIdentifier, sessionID));
+}
+
+WebIDBConnectionToClient::WebIDBConnectionToClient(NetworkConnectionToWebProcess& connection, uint64_t serverConnectionIdentifier, PAL::SessionID sessionID)
+    : m_connection(connection)
+    , m_identifier(serverConnectionIdentifier)
+    , m_sessionID(sessionID)
+{
+    relaxAdoptionRequirement();
+    m_connectionToClient = IDBServer::IDBConnectionToClient::create(*this);
+    NetworkProcess::singleton().idbServer(m_sessionID).registerConnection(*m_connectionToClient);
+}
+
+WebIDBConnectionToClient::~WebIDBConnectionToClient()
+{
+}
+
+void WebIDBConnectionToClient::disconnectedFromWebProcess()
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).unregisterConnection(*m_connectionToClient);
+}
+
+IPC::Connection* WebIDBConnectionToClient::messageSenderConnection()
+{
+    return &m_connection->connection();
+}
+
+WebCore::IDBServer::IDBConnectionToClient& WebIDBConnectionToClient::connectionToClient()
+{
+    return *m_connectionToClient;
+}
+
+void WebIDBConnectionToClient::didDeleteDatabase(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidDeleteDatabase(resultData));
+}
+
+void WebIDBConnectionToClient::didOpenDatabase(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidOpenDatabase(resultData));
+}
+
+void WebIDBConnectionToClient::didAbortTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError& error)
+{
+    send(Messages::WebIDBConnectionToServer::DidAbortTransaction(transactionIdentifier, error));
+}
+
+void WebIDBConnectionToClient::didCommitTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError& error)
+{
+    send(Messages::WebIDBConnectionToServer::DidCommitTransaction(transactionIdentifier, error));
+}
+
+void WebIDBConnectionToClient::didCreateObjectStore(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidCreateObjectStore(resultData));
+}
+
+void WebIDBConnectionToClient::didDeleteObjectStore(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidDeleteObjectStore(resultData));
+}
+
+void WebIDBConnectionToClient::didRenameObjectStore(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidRenameObjectStore(resultData));
+}
+
+void WebIDBConnectionToClient::didClearObjectStore(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidClearObjectStore(resultData));
+}
+
+void WebIDBConnectionToClient::didCreateIndex(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidCreateIndex(resultData));
+}
+
+void WebIDBConnectionToClient::didDeleteIndex(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidDeleteIndex(resultData));
+}
+
+void WebIDBConnectionToClient::didRenameIndex(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidRenameIndex(resultData));
+}
+
+void WebIDBConnectionToClient::didPutOrAdd(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidPutOrAdd(resultData));
+}
+
+template<class MessageType> void WebIDBConnectionToClient::handleGetResult(const WebCore::IDBResultData& resultData)
+{
+    if (resultData.type() == IDBResultType::Error) {
+        send(MessageType(resultData));
+        return;
+    }
+
+    if (resultData.type() == IDBResultType::GetAllRecordsSuccess && resultData.getAllResult().type() == IndexedDB::GetAllType::Keys) {
+        send(MessageType(resultData));
+        return;
+    }
+
+    auto blobFilePaths = resultData.type() == IDBResultType::GetAllRecordsSuccess ? resultData.getAllResult().allBlobFilePaths() : resultData.getResult().value().blobFilePaths();
+    if (blobFilePaths.isEmpty()) {
+        send(MessageType(resultData));
+        return;
+    }
+
+#if ENABLE(SANDBOX_EXTENSIONS)
+    NetworkProcess::singleton().getSandboxExtensionsForBlobFiles(blobFilePaths, [protectedThis = makeRef(*this), this, resultData](SandboxExtension::HandleArray&& handles) {
+        send(MessageType({ resultData, WTFMove(handles) }));
+    });
+#else
+    send(MessageType(resultData));
+#endif
+}
+
+void WebIDBConnectionToClient::didGetRecord(const WebCore::IDBResultData& resultData)
+{
+    handleGetResult<Messages::WebIDBConnectionToServer::DidGetRecord>(resultData);
+}
+
+void WebIDBConnectionToClient::didGetAllRecords(const WebCore::IDBResultData& resultData)
+{
+    handleGetResult<Messages::WebIDBConnectionToServer::DidGetAllRecords>(resultData);
+}
+
+void WebIDBConnectionToClient::didGetCount(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidGetCount(resultData));
+}
+
+void WebIDBConnectionToClient::didDeleteRecord(const WebCore::IDBResultData& resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidDeleteRecord(resultData));
+}
+
+void WebIDBConnectionToClient::didOpenCursor(const WebCore::IDBResultData& resultData)
+{
+    handleGetResult<Messages::WebIDBConnectionToServer::DidOpenCursor>(resultData);
+}
+
+void WebIDBConnectionToClient::didIterateCursor(const WebCore::IDBResultData& resultData)
+{
+    handleGetResult<Messages::WebIDBConnectionToServer::DidIterateCursor>(resultData);
+}
+
+void WebIDBConnectionToClient::fireVersionChangeEvent(WebCore::IDBServer::UniqueIDBDatabaseConnection& connection, const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion)
+{
+    send(Messages::WebIDBConnectionToServer::FireVersionChangeEvent(connection.identifier(), requestIdentifier, requestedVersion));
+}
+
+void WebIDBConnectionToClient::didStartTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError& error)
+{
+    send(Messages::WebIDBConnectionToServer::DidStartTransaction(transactionIdentifier, error));
+}
+
+void WebIDBConnectionToClient::didCloseFromServer(WebCore::IDBServer::UniqueIDBDatabaseConnection& connection, const WebCore::IDBError& error)
+{
+    send(Messages::WebIDBConnectionToServer::DidCloseFromServer(connection.identifier(), error));
+}
+
+void WebIDBConnectionToClient::notifyOpenDBRequestBlocked(const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion)
+{
+    send(Messages::WebIDBConnectionToServer::NotifyOpenDBRequestBlocked(requestIdentifier, oldVersion, newVersion));
+}
+
+void WebIDBConnectionToClient::didGetAllDatabaseNames(uint64_t callbackID, const Vector<String>& databaseNames)
+{
+    send(Messages::WebIDBConnectionToServer::DidGetAllDatabaseNames(callbackID, databaseNames));
+}
+
+void WebIDBConnectionToClient::deleteDatabase(const IDBRequestData& request)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).deleteDatabase(request);
+}
+
+void WebIDBConnectionToClient::openDatabase(const IDBRequestData& request)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).openDatabase(request);
+}
+
+void WebIDBConnectionToClient::abortTransaction(const IDBResourceIdentifier& transactionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).abortTransaction(transactionIdentifier);
+}
+
+void WebIDBConnectionToClient::commitTransaction(const IDBResourceIdentifier& transactionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).commitTransaction(transactionIdentifier);
+}
+
+void WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& transactionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).didFinishHandlingVersionChangeTransaction(databaseConnectionIdentifier, transactionIdentifier);
+}
+
+void WebIDBConnectionToClient::createObjectStore(const IDBRequestData& request, const IDBObjectStoreInfo& info)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).createObjectStore(request, info);
+}
+
+void WebIDBConnectionToClient::deleteObjectStore(const IDBRequestData& request, const String& name)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).deleteObjectStore(request, name);
+}
+
+void WebIDBConnectionToClient::renameObjectStore(const IDBRequestData& request, uint64_t objectStoreIdentifier, const String& newName)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).renameObjectStore(request, objectStoreIdentifier, newName);
+}
+
+void WebIDBConnectionToClient::clearObjectStore(const IDBRequestData& request, uint64_t objectStoreIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).clearObjectStore(request, objectStoreIdentifier);
+}
+
+void WebIDBConnectionToClient::createIndex(const IDBRequestData& request, const IDBIndexInfo& info)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).createIndex(request, info);
+}
+
+void WebIDBConnectionToClient::deleteIndex(const IDBRequestData& request, uint64_t objectStoreIdentifier, const String& name)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).deleteIndex(request, objectStoreIdentifier, name);
+}
+
+void WebIDBConnectionToClient::renameIndex(const IDBRequestData& request, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).renameIndex(request, objectStoreIdentifier, indexIdentifier, newName);
+}
+
+void WebIDBConnectionToClient::putOrAdd(const IDBRequestData& request, const IDBKeyData& key, const IDBValue& value, unsigned overwriteMode)
+{
+    if (overwriteMode != static_cast<unsigned>(IndexedDB::ObjectStoreOverwriteMode::NoOverwrite)
+        && overwriteMode != static_cast<unsigned>(IndexedDB::ObjectStoreOverwriteMode::Overwrite)
+        && overwriteMode != static_cast<unsigned>(IndexedDB::ObjectStoreOverwriteMode::OverwriteForCursor)) {
+        // FIXME: This message from the WebProcess is corrupt.
+        // The StorageProcess should return early at this point, but can we also kill the bad WebProcess?
+        return;
+    }
+
+    IndexedDB::ObjectStoreOverwriteMode mode = static_cast<IndexedDB::ObjectStoreOverwriteMode>(overwriteMode);
+
+    NetworkProcess::singleton().idbServer(m_sessionID).putOrAdd(request, key, value, mode);
+}
+
+void WebIDBConnectionToClient::getRecord(const IDBRequestData& request, const IDBGetRecordData& getRecordData)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).getRecord(request, getRecordData);
+}
+
+void WebIDBConnectionToClient::getAllRecords(const IDBRequestData& request, const IDBGetAllRecordsData& getAllRecordsData)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).getAllRecords(request, getAllRecordsData);
+}
+
+void WebIDBConnectionToClient::getCount(const IDBRequestData& request, const IDBKeyRangeData& range)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).getCount(request, range);
+}
+
+void WebIDBConnectionToClient::deleteRecord(const IDBRequestData& request, const IDBKeyRangeData& range)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).deleteRecord(request, range);
+}
+
+void WebIDBConnectionToClient::openCursor(const IDBRequestData& request, const IDBCursorInfo& info)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).openCursor(request, info);
+}
+
+void WebIDBConnectionToClient::iterateCursor(const IDBRequestData& request, const IDBIterateCursorData& data)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).iterateCursor(request, data);
+}
+
+void WebIDBConnectionToClient::establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo& info)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).establishTransaction(databaseConnectionIdentifier, info);
+}
+
+void WebIDBConnectionToClient::databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).databaseConnectionPendingClose(databaseConnectionIdentifier);
+}
+
+void WebIDBConnectionToClient::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).databaseConnectionClosed(databaseConnectionIdentifier);
+}
+
+void WebIDBConnectionToClient::abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& transactionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).abortOpenAndUpgradeNeeded(databaseConnectionIdentifier, transactionIdentifier);
+}
+
+void WebIDBConnectionToClient::didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& transactionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).didFireVersionChangeEvent(databaseConnectionIdentifier, transactionIdentifier);
+}
+
+void WebIDBConnectionToClient::openDBRequestCancelled(const IDBRequestData& requestData)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).openDBRequestCancelled(requestData);
+}
+
+void WebIDBConnectionToClient::confirmDidCloseFromServer(uint64_t databaseConnectionIdentifier)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).confirmDidCloseFromServer(databaseConnectionIdentifier);
+}
+
+void WebIDBConnectionToClient::getAllDatabaseNames(uint64_t serverConnectionIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::SecurityOriginData& openingOrigin, uint64_t callbackID)
+{
+    NetworkProcess::singleton().idbServer(m_sessionID).getAllDatabaseNames(serverConnectionIdentifier, topOrigin, openingOrigin, callbackID);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessIndexedDBWebIDBConnectionToClienthfromrev236034trunkSourceWebKitStorageProcessIndexedDBWebIDBConnectionToClienth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.h (from rev 236034, trunk/Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h) (0 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.h                          (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.h     2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -0,0 +1,144 @@
</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.
+ */
+
+#pragma once
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "MessageSender.h"
+#include "NetworkConnectionToWebProcess.h"
+#include <WebCore/IDBConnectionToClient.h>
+#include <pal/SessionID.h>
+
+namespace WebCore {
+class IDBCursorInfo;
+class IDBIndexInfo;
+class IDBKeyData;
+class IDBObjectStoreInfo;
+class IDBRequestData;
+class IDBTransactionInfo;
+class IDBValue;
+class SerializedScriptValue;
+struct IDBGetAllRecordsData;
+struct IDBGetRecordData;
+struct IDBIterateCursorData;
+struct IDBKeyRangeData;
+struct SecurityOriginData;
+}
+
+namespace WebKit {
+
+class WebIDBConnectionToClient final : public WebCore::IDBServer::IDBConnectionToClientDelegate, public IPC::MessageSender, public RefCounted<WebIDBConnectionToClient> {
+public:
+    static Ref<WebIDBConnectionToClient> create(NetworkConnectionToWebProcess&, uint64_t serverConnectionIdentifier, PAL::SessionID);
+
+    virtual ~WebIDBConnectionToClient();
+
+    WebCore::IDBServer::IDBConnectionToClient& connectionToClient();
+    uint64_t identifier() const final { return m_identifier; }
+    uint64_t messageSenderDestinationID() final { return m_identifier; }
+
+    // IDBConnectionToClientDelegate
+    void didDeleteDatabase(const WebCore::IDBResultData&) final;
+    void didOpenDatabase(const WebCore::IDBResultData&) final;
+    void didAbortTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&) final;
+    void didCommitTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&) final;
+    void didCreateObjectStore(const WebCore::IDBResultData&) final;
+    void didDeleteObjectStore(const WebCore::IDBResultData&) final;
+    void didRenameObjectStore(const WebCore::IDBResultData&) final;
+    void didClearObjectStore(const WebCore::IDBResultData&) final;
+    void didCreateIndex(const WebCore::IDBResultData&) final;
+    void didDeleteIndex(const WebCore::IDBResultData&) final;
+    void didRenameIndex(const WebCore::IDBResultData&) final;
+    void didPutOrAdd(const WebCore::IDBResultData&) final;
+    void didGetRecord(const WebCore::IDBResultData&) final;
+    void didGetAllRecords(const WebCore::IDBResultData&) final;
+    void didGetCount(const WebCore::IDBResultData&) final;
+    void didDeleteRecord(const WebCore::IDBResultData&) final;
+    void didOpenCursor(const WebCore::IDBResultData&) final;
+    void didIterateCursor(const WebCore::IDBResultData&) final;
+
+    void fireVersionChangeEvent(WebCore::IDBServer::UniqueIDBDatabaseConnection&, const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion) final;
+    void didStartTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&) final;
+    void didCloseFromServer(WebCore::IDBServer::UniqueIDBDatabaseConnection&, const WebCore::IDBError&) final;
+    void notifyOpenDBRequestBlocked(const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion) final;
+
+    void didGetAllDatabaseNames(uint64_t callbackID, const Vector<String>& databaseNames) final;
+
+    void ref() override { RefCounted<WebIDBConnectionToClient>::ref(); }
+    void deref() override { RefCounted<WebIDBConnectionToClient>::deref(); }
+
+    // Messages received from WebProcess
+    void deleteDatabase(const WebCore::IDBRequestData&);
+    void openDatabase(const WebCore::IDBRequestData&);
+    void abortTransaction(const WebCore::IDBResourceIdentifier&);
+    void commitTransaction(const WebCore::IDBResourceIdentifier&);
+    void didFinishHandlingVersionChangeTransaction(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier&);
+    void createObjectStore(const WebCore::IDBRequestData&, const WebCore::IDBObjectStoreInfo&);
+    void deleteObjectStore(const WebCore::IDBRequestData&, const String& objectStoreName);
+    void renameObjectStore(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier, const String& newName);
+    void clearObjectStore(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier);
+    void createIndex(const WebCore::IDBRequestData&, const WebCore::IDBIndexInfo&);
+    void deleteIndex(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName);
+    void renameIndex(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName);
+    void putOrAdd(const WebCore::IDBRequestData&, const WebCore::IDBKeyData&, const WebCore::IDBValue&, unsigned overwriteMode);
+    void getRecord(const WebCore::IDBRequestData&, const WebCore::IDBGetRecordData&);
+    void getAllRecords(const WebCore::IDBRequestData&, const WebCore::IDBGetAllRecordsData&);
+    void getCount(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&);
+    void deleteRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&);
+    void openCursor(const WebCore::IDBRequestData&, const WebCore::IDBCursorInfo&);
+    void iterateCursor(const WebCore::IDBRequestData&, const WebCore::IDBIterateCursorData&);
+
+    void establishTransaction(uint64_t databaseConnectionIdentifier, const WebCore::IDBTransactionInfo&);
+    void databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier);
+    void databaseConnectionClosed(uint64_t databaseConnectionIdentifier);
+    void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& transactionIdentifier);
+    void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& requestIdentifier);
+    void openDBRequestCancelled(const WebCore::IDBRequestData&);
+    void confirmDidCloseFromServer(uint64_t databaseConnectionIdentifier);
+
+    void getAllDatabaseNames(uint64_t serverConnectionIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::SecurityOriginData& openingOrigin, uint64_t callbackID);
+
+    void disconnectedFromWebProcess();
+
+    void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
+
+private:
+    WebIDBConnectionToClient(NetworkConnectionToWebProcess&, uint64_t serverConnectionIdentifier, PAL::SessionID);
+
+    IPC::Connection* messageSenderConnection() final;
+
+    template<class MessageType> void handleGetResult(const WebCore::IDBResultData&);
+
+    Ref<NetworkConnectionToWebProcess> m_connection;
+
+    uint64_t m_identifier;
+    PAL::SessionID m_sessionID;
+    RefPtr<WebCore::IDBServer::IDBConnectionToClient> m_connectionToClient;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessIndexedDBWebIDBConnectionToClientmessagesinfromrev236034trunkSourceWebKitStorageProcessIndexedDBWebIDBConnectionToClientmessagesin"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in (from rev 236034, trunk/Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in) (0 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in                                (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in   2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -0,0 +1,56 @@
</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.
+
+#if ENABLE(INDEXED_DATABASE)
+
+messages -> WebIDBConnectionToClient {
+    DeleteDatabase(WebCore::IDBRequestData requestData)
+    OpenDatabase(WebCore::IDBRequestData requestData);
+    AbortTransaction(WebCore::IDBResourceIdentifier transactionIdentifier);
+    CommitTransaction(WebCore::IDBResourceIdentifier transactionIdentifier);
+    DidFinishHandlingVersionChangeTransaction(uint64_t databaseConnectionIdentifier, WebCore::IDBResourceIdentifier transactionIdentifier);
+    CreateObjectStore(WebCore::IDBRequestData requestData, WebCore::IDBObjectStoreInfo info);
+    DeleteObjectStore(WebCore::IDBRequestData requestData, String objectStoreName);
+    RenameObjectStore(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, String newName);
+    ClearObjectStore(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier);
+    CreateIndex(WebCore::IDBRequestData requestData, WebCore::IDBIndexInfo info);
+    DeleteIndex(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, String indexName);
+    RenameIndex(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, String newName);
+    PutOrAdd(WebCore::IDBRequestData requestData, WebCore::IDBKeyData key, WebCore::IDBValue value, unsigned overwriteMode);
+    GetRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBGetRecordData getRecordData);
+    GetAllRecords(WebCore::IDBRequestData requestData, struct WebCore::IDBGetAllRecordsData getAllRecordsData);
+    GetCount(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
+    DeleteRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
+    OpenCursor(WebCore::IDBRequestData requestData, WebCore::IDBCursorInfo info);
+    IterateCursor(WebCore::IDBRequestData requestData, struct WebCore::IDBIterateCursorData data);
+
+    EstablishTransaction(uint64_t databaseConnectionIdentifier, WebCore::IDBTransactionInfo info);
+    DatabaseConnectionPendingClose(uint64_t databaseConnectionIdentifier);
+    DatabaseConnectionClosed(uint64_t databaseConnectionIdentifier);
+    AbortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, WebCore::IDBResourceIdentifier transactionIdentifier);
+    DidFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, WebCore::IDBResourceIdentifier requestIdentifier);
+    OpenDBRequestCancelled(WebCore::IDBRequestData requestData);
+    ConfirmDidCloseFromServer(uint64_t databaseConnectionIdentifier);
+
+    GetAllDatabaseNames(uint64_t serverConnectionIdentifier, struct WebCore::SecurityOriginData topOrigin, struct WebCore::SecurityOriginData openingOrigin, uint64_t callbackID);
+}
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp     2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp        2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -49,6 +49,8 @@
</span><span class="cx"> #include "SessionTracker.h"
</span><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebErrors.h"
</span><ins>+#include "WebIDBConnectionToClient.h"
+#include "WebIDBConnectionToClientMessages.h"
</ins><span class="cx"> #include "WebsiteDataStore.h"
</span><span class="cx"> #include "WebsiteDataStoreParameters.h"
</span><span class="cx"> #include <WebCore/NetworkStorageSession.h>
</span><span class="lines">@@ -56,7 +58,6 @@
</span><span class="cx"> #include <WebCore/ResourceRequest.h>
</span><span class="cx"> #include <WebCore/SameSiteInfo.h>
</span><span class="cx"> #include <WebCore/SecurityPolicy.h>
</span><del>-#include <pal/SessionID.h>
</del><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -146,6 +147,15 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    if (decoder.messageReceiverName() == Messages::WebIDBConnectionToClient::messageReceiverName()) {
+        auto iterator = m_webIDBConnections.find(decoder.destinationID());
+        if (iterator != m_webIDBConnections.end())
+            iterator->value->didReceiveMessage(connection, decoder);
+        return;
+    }
+#endif
+
</ins><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -196,6 +206,15 @@
</span><span class="cx">         m_rtcProvider = nullptr;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    auto idbConnections = m_webIDBConnections;
+    for (auto& connection : idbConnections.values())
+        connection->disconnectedFromWebProcess();
+    
+    m_webIDBConnections.clear();
+#endif
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkConnectionToWebProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference)
</span><span class="lines">@@ -483,12 +502,14 @@
</span><span class="cx">         for (auto& file : fileReferences)
</span><span class="cx">             file->revokeFileAccess();
</span><span class="cx"> 
</span><del>-        NetworkProcess::singleton().grantSandboxExtensionsToStorageProcessForBlobs(fileNames, [this, protectedThis = WTFMove(protectedThis), requestIdentifier, fileNames]() {
-            if (!m_connection->isValid())
-                return;
</del><ins>+#if ENABLE(SANDBOX_EXTENSIONS)
+        NetworkProcess::singleton().getSandboxExtensionsForBlobFiles(fileNames, [protectedThis = WTFMove(protectedThis), fileNames](SandboxExtension::HandleArray&& handles) {
+            ASSERT(fileNames.size() == handles.size());
+            NetworkProcess::singleton().updateTemporaryFileSandboxExtensions(fileNames, handles);
+        });
+#endif
</ins><span class="cx"> 
</span><del>-            m_connection->send(Messages::NetworkProcessConnection::DidWriteBlobsToTemporaryFiles(requestIdentifier, fileNames), 0);
-        });
</del><ins>+        m_connection->send(Messages::NetworkProcessConnection::DidWriteBlobsToTemporaryFiles(requestIdentifier, fileNames), 0);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -643,4 +664,30 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+static uint64_t generateIDBConnectionToServerIdentifier()
+{
+    ASSERT(RunLoop::isMain());
+    static uint64_t identifier = 0;
+    return ++identifier;
+}
+
+void NetworkConnectionToWebProcess::establishIDBConnectionToServer(PAL::SessionID sessionID, uint64_t& serverConnectionIdentifier)
+{
+    serverConnectionIdentifier = generateIDBConnectionToServerIdentifier();
+    LOG(IndexedDB, "StorageToWebProcessConnection::establishIDBConnectionToServer - %" PRIu64, serverConnectionIdentifier);
+    ASSERT(!m_webIDBConnections.contains(serverConnectionIdentifier));
+    
+    m_webIDBConnections.set(serverConnectionIdentifier, WebIDBConnectionToClient::create(*this, serverConnectionIdentifier, sessionID));
+}
+
+void NetworkConnectionToWebProcess::removeIDBConnectionToServer(uint64_t serverConnectionIdentifier)
+{
+    ASSERT(m_webIDBConnections.contains(serverConnectionIdentifier));
+    
+    auto connection = m_webIDBConnections.take(serverConnectionIdentifier);
+    connection->disconnectedFromWebProcess();
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h       2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h  2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -37,6 +37,10 @@
</span><span class="cx"> #include <WebCore/ResourceLoadPriority.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> 
</span><ins>+namespace PAL {
+class SessionID;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> class BlobDataFileReference;
</span><span class="cx"> class HTTPHeaderMap;
</span><span class="lines">@@ -54,6 +58,7 @@
</span><span class="cx"> class NetworkResourceLoader;
</span><span class="cx"> class NetworkSocketStream;
</span><span class="cx"> class SyncNetworkResourceLoader;
</span><ins>+class WebIDBConnectionToClient;
</ins><span class="cx"> typedef uint64_t ResourceLoadIdentifier;
</span><span class="cx"> 
</span><span class="cx"> namespace NetworkCache {
</span><span class="lines">@@ -173,6 +178,12 @@
</span><span class="cx">     
</span><span class="cx">     void ensureLegacyPrivateBrowsingSession();
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    // Messages handlers (Modern IDB).
+    void establishIDBConnectionToServer(PAL::SessionID, uint64_t& serverConnectionIdentifier);
+    void removeIDBConnectionToServer(uint64_t serverConnectionIdentifier);
+#endif
+
</ins><span class="cx"> #if USE(LIBWEBRTC)
</span><span class="cx">     NetworkRTCProvider& rtcProvider();
</span><span class="cx"> #endif
</span><span class="lines">@@ -238,6 +249,11 @@
</span><span class="cx">     bool m_captureExtraNetworkLoadMetricsEnabled { false };
</span><span class="cx"> 
</span><span class="cx">     RefPtr<CacheStorageEngineConnection> m_cacheStorageConnection;
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    HashMap<uint64_t, RefPtr<WebIDBConnectionToClient>> m_webIDBConnections;
+#endif
+
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in     2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in        2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -70,4 +70,10 @@
</span><span class="cx">     GetNetworkLoadInformationResponse(uint64_t resourceLoadIdentifier) -> (WebCore::ResourceResponse response);
</span><span class="cx">     GetNetworkLoadIntermediateInformation(uint64_t resourceLoadIdentifier) -> (Vector<WebCore::NetworkTransactionInformation> transactions);
</span><span class="cx">     TakeNetworkLoadInformationMetrics(uint64_t resourceLoadIdentifier) -> (WebCore::NetworkLoadMetrics networkMetrics);
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    EstablishIDBConnectionToServer(PAL::SessionID sessionID) -> (uint64_t serverConnectionIdentifier)
+    RemoveIDBConnectionToServer(uint64_t serverConnectionIdentifier)
+#endif
+
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -114,6 +114,7 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     , m_clearCacheDispatchGroup(0)
</span><span class="cx"> #endif
</span><ins>+    , m_storageTaskQueue(WorkQueue::create("com.apple.WebKit.StorageTask"))
</ins><span class="cx"> {
</span><span class="cx">     NetworkProcessPlatformStrategies::initialize();
</span><span class="cx"> 
</span><span class="lines">@@ -289,6 +290,10 @@
</span><span class="cx"> 
</span><span class="cx">     SessionTracker::setSession(PAL::SessionID::defaultSessionID(), NetworkSession::create(NetworkSessionCreationParameters()));
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    addIndexedDatabaseSession(PAL::SessionID::defaultSessionID(), parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
+#endif
+
</ins><span class="cx">     auto* defaultSession = SessionTracker::networkSession(PAL::SessionID::defaultSessionID());
</span><span class="cx">     for (const auto& cookie : parameters.defaultSessionPendingCookies)
</span><span class="cx">         defaultSession->networkStorageSession().setCookie(cookie);
</span><span class="lines">@@ -388,6 +393,10 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcess::addWebsiteDataStore(WebsiteDataStoreParameters&& parameters)
</span><span class="cx"> {
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    addIndexedDatabaseSession(parameters.networkSessionParameters.sessionID, parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
+#endif
+
</ins><span class="cx">     RemoteNetworkingContext::ensureWebsiteDataStoreSession(WTFMove(parameters));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -398,21 +407,6 @@
</span><span class="cx">     CacheStorage::Engine::destroyEngine(sessionID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs(const Vector<String>& filenames, Function<void ()>&& completionHandler)
-{
-    static uint64_t lastRequestID;
-
-    uint64_t requestID = ++lastRequestID;
-    m_sandboxExtensionForBlobsCompletionHandlers.set(requestID, WTFMove(completionHandler));
-    parentProcessConnection()->send(Messages::NetworkProcessProxy::GrantSandboxExtensionsToStorageProcessForBlobs(requestID, filenames), 0);
-}
-
-void NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs(uint64_t requestID)
-{
-    if (auto handler = m_sandboxExtensionForBlobsCompletionHandlers.take(requestID))
-        handler();
-}
-
</del><span class="cx"> void NetworkProcess::writeBlobToFilePath(const WebCore::URL& url, const String& path, SandboxExtension::Handle&& handleForWriting, uint64_t requestID)
</span><span class="cx"> {
</span><span class="cx">     auto extension = SandboxExtension::create(WTFMove(handleForWriting));
</span><span class="lines">@@ -575,6 +569,19 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    auto path = m_idbDatabasePaths.get(sessionID);
+    if (!path.isEmpty() && websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases)) {
+        // FIXME: Pick the right database store based on the session ID.
+        postStorageTask(CrossThreadTask([this, callbackAggregator = callbackAggregator.copyRef(), path = WTFMove(path)]() mutable {
+            RunLoop::main().dispatch([callbackAggregator = WTFMove(callbackAggregator), securityOrigins = indexedDatabaseOrigins(path)] {
+                for (const auto& securityOrigin : securityOrigins)
+                    callbackAggregator->m_websiteData.entries.append({ securityOrigin, WebsiteDataType::IndexedDBDatabases, 0 });
+            });
+        }));
+    }
+#endif
+
</ins><span class="cx">     if (websiteDataTypes.contains(WebsiteDataType::DiskCache)) {
</span><span class="cx">         fetchDiskCacheEntries(sessionID, fetchOptions, [callbackAggregator = WTFMove(callbackAggregator)](auto entries) mutable {
</span><span class="cx">             callbackAggregator->m_websiteData.entries.appendVector(entries);
</span><span class="lines">@@ -608,6 +615,11 @@
</span><span class="cx">     if (websiteDataTypes.contains(WebsiteDataType::DOMCache))
</span><span class="cx">         CacheStorage::Engine::clearAllCaches(sessionID, [clearTasksHandler = clearTasksHandler.copyRef()] { });
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    if (websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases) && !sessionID.isEphemeral())
+        idbServer(sessionID).closeAndDeleteDatabasesModifiedSince(modifiedSince, [clearTasksHandler = clearTasksHandler.copyRef()] { });
+#endif
+
</ins><span class="cx">     if (websiteDataTypes.contains(WebsiteDataType::DiskCache) && !sessionID.isEphemeral())
</span><span class="cx">         clearDiskCache(modifiedSince, [clearTasksHandler = WTFMove(clearTasksHandler)] { });
</span><span class="cx"> }
</span><span class="lines">@@ -660,6 +672,11 @@
</span><span class="cx">             CacheStorage::Engine::clearCachesForOrigin(sessionID, SecurityOriginData { originData }, [clearTasksHandler = clearTasksHandler.copyRef()] { });
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    if (websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases) && !sessionID.isEphemeral())
+        idbServer(sessionID).closeAndDeleteDatabasesForOrigins(originDatas, [clearTasksHandler = clearTasksHandler.copyRef()] { });
+#endif
+
</ins><span class="cx">     if (websiteDataTypes.contains(WebsiteDataType::DiskCache) && !sessionID.isEphemeral())
</span><span class="cx">         clearDiskCacheEntries(originDatas, [clearTasksHandler = WTFMove(clearTasksHandler)] { });
</span><span class="cx"> }
</span><span class="lines">@@ -948,6 +965,137 @@
</span><span class="cx">     parentProcessConnection()->send(Messages::NetworkProcessProxy::DidSyncAllCookies(), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+IDBServer::IDBServer& NetworkProcess::idbServer(PAL::SessionID sessionID)
+{
+    auto addResult = m_idbServers.add(sessionID, nullptr);
+    if (!addResult.isNewEntry) {
+        ASSERT(addResult.iterator->value);
+        return *addResult.iterator->value;
+    }
+    
+    auto path = m_idbDatabasePaths.get(sessionID);
+    // There should already be a registered path for this PAL::SessionID.
+    // If there's not, then where did this PAL::SessionID come from?
+    ASSERT(!path.isEmpty());
+    
+    addResult.iterator->value = IDBServer::IDBServer::create(path, NetworkProcess::singleton());
+    return *addResult.iterator->value;
+}
+
+void NetworkProcess::ensurePathExists(const String& path)
+{
+    ASSERT(!RunLoop::isMain());
+    
+    if (!FileSystem::makeAllDirectories(path))
+        LOG_ERROR("Failed to make all directories for path '%s'", path.utf8().data());
+}
+
+void NetworkProcess::postStorageTask(CrossThreadTask&& task)
+{
+    ASSERT(RunLoop::isMain());
+    
+    LockHolder locker(m_storageTaskMutex);
+    
+    m_storageTasks.append(WTFMove(task));
+    
+    m_storageTaskQueue->dispatch([this] {
+        performNextStorageTask();
+    });
+}
+
+void NetworkProcess::performNextStorageTask()
+{
+    ASSERT(!RunLoop::isMain());
+    
+    CrossThreadTask task;
+    {
+        LockHolder locker(m_storageTaskMutex);
+        ASSERT(!m_storageTasks.isEmpty());
+        task = m_storageTasks.takeFirst();
+    }
+    
+    task.performTask();
+}
+
+void NetworkProcess::prepareForAccessToTemporaryFile(const String& path)
+{
+    if (auto extension = m_blobTemporaryFileSandboxExtensions.get(path))
+        extension->consume();
+}
+
+void NetworkProcess::accessToTemporaryFileComplete(const String& path)
+{
+    // We've either hard linked the temporary blob file to the database directory, copied it there,
+    // or the transaction is being aborted.
+    // In any of those cases, we can delete the temporary blob file now.
+    FileSystem::deleteFile(path);
+    
+    if (auto extension = m_blobTemporaryFileSandboxExtensions.take(path))
+        extension->revoke();
+}
+
+HashSet<WebCore::SecurityOriginData> NetworkProcess::indexedDatabaseOrigins(const String& path)
+{
+    if (path.isEmpty())
+        return { };
+    
+    HashSet<WebCore::SecurityOriginData> securityOrigins;
+    for (auto& topOriginPath : FileSystem::listDirectory(path, "*")) {
+        auto databaseIdentifier = FileSystem::pathGetFileName(topOriginPath);
+        if (auto securityOrigin = SecurityOriginData::fromDatabaseIdentifier(databaseIdentifier))
+            securityOrigins.add(WTFMove(*securityOrigin));
+        
+        for (auto& originPath : FileSystem::listDirectory(topOriginPath, "*")) {
+            databaseIdentifier = FileSystem::pathGetFileName(originPath);
+            if (auto securityOrigin = SecurityOriginData::fromDatabaseIdentifier(databaseIdentifier))
+                securityOrigins.add(WTFMove(*securityOrigin));
+        }
+    }
+
+    return securityOrigins;
+}
+
+void NetworkProcess::addIndexedDatabaseSession(PAL::SessionID sessionID, String& indexedDatabaseDirectory, SandboxExtension::Handle& handle)
+{
+    // *********
+    // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>)
+    // *********
+    auto addResult = m_idbDatabasePaths.add(sessionID, indexedDatabaseDirectory);
+    if (addResult.isNewEntry) {
+        SandboxExtension::consumePermanently(handle);
+        if (!indexedDatabaseDirectory.isEmpty())
+            postStorageTask(createCrossThreadTask(*this, &NetworkProcess::ensurePathExists, indexedDatabaseDirectory));
+    }
+}
+
+#endif // ENABLE(INDEXED_DATABASE)
+
+#if ENABLE(SANDBOX_EXTENSIONS)
+void NetworkProcess::getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, Function<void(SandboxExtension::HandleArray&&)>&& completionHandler)
+{
+    static uint64_t lastRequestID;
+    
+    uint64_t requestID = ++lastRequestID;
+    m_sandboxExtensionForBlobsCompletionHandlersStorageForNetworkProcess.set(requestID, WTFMove(completionHandler));
+    parentProcessConnection()->send(Messages::NetworkProcessProxy::GetSandboxExtensionsForBlobFiles(requestID, filenames), 0);
+}
+
+void NetworkProcess::didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&& handles)
+{
+    if (auto handler = m_sandboxExtensionForBlobsCompletionHandlersStorageForNetworkProcess.take(requestID))
+        handler(WTFMove(handles));
+}
+    
+void NetworkProcess::updateTemporaryFileSandboxExtensions(const Vector<String>& paths, SandboxExtension::HandleArray& handles)
+{
+    for (size_t i = 0; i < handles.size(); ++i) {
+        auto result = m_blobTemporaryFileSandboxExtensions.add(paths[i], SandboxExtension::create(WTFMove(handles[i])));
+        ASSERT_UNUSED(result, result.isNewEntry);
+    }
+}
+#endif // ENABLE(SANDBOX_EXTENSIONS)
+
</ins><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="cx"> void NetworkProcess::initializeProcess(const ChildProcessInitializationParameters&)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -30,10 +30,15 @@
</span><span class="cx"> #include "DownloadManager.h"
</span><span class="cx"> #include "MessageReceiverMap.h"
</span><span class="cx"> #include "NetworkContentRuleListManager.h"
</span><ins>+#include "SandboxExtension.h"
</ins><span class="cx"> #include <WebCore/DiagnosticLoggingClient.h>
</span><ins>+#include <WebCore/IDBBackingStore.h>
+#include <WebCore/IDBKeyData.h>
+#include <WebCore/IDBServer.h>
+#include <WebCore/UniqueIDBDatabase.h>
</ins><span class="cx"> #include <memory>
</span><span class="cx"> #include <pal/SessionID.h>
</span><del>-#include <wtf/Forward.h>
</del><ins>+#include <wtf/CrossThreadTask.h>
</ins><span class="cx"> #include <wtf/Function.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/MemoryPressureHandler.h>
</span><span class="lines">@@ -74,7 +79,11 @@
</span><span class="cx"> class Cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class NetworkProcess : public ChildProcess, private DownloadManager::Client {
</del><ins>+class NetworkProcess : public ChildProcess, private DownloadManager::Client
+#if ENABLE(INDEXED_DATABASE)
+    , public WebCore::IDBServer::IDBBackingStoreTemporaryFileHandler
+#endif
+{
</ins><span class="cx">     WTF_MAKE_NONCOPYABLE(NetworkProcess);
</span><span class="cx">     friend NeverDestroyed<NetworkProcess>;
</span><span class="cx">     friend NeverDestroyed<DownloadManager>;
</span><span class="lines">@@ -130,8 +139,6 @@
</span><span class="cx"> 
</span><span class="cx">     void addWebsiteDataStore(WebsiteDataStoreParameters&&);
</span><span class="cx"> 
</span><del>-    void grantSandboxExtensionsToStorageProcessForBlobs(const Vector<String>& filenames, Function<void ()>&& completionHandler);
-
</del><span class="cx"> #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
</span><span class="cx">     void updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID, const Vector<String>& domainsToBlock, bool shouldClearFirst, uint64_t contextId);
</span><span class="cx">     void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId);
</span><span class="lines">@@ -159,6 +166,18 @@
</span><span class="cx">     NetworkContentRuleListManager& networkContentRuleListManager() { return m_NetworkContentRuleListManager; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    WebCore::IDBServer::IDBServer& idbServer(PAL::SessionID);
+    // WebCore::IDBServer::IDBBackingStoreFileHandler.
+    void prepareForAccessToTemporaryFile(const String& path) final;
+    void accessToTemporaryFileComplete(const String& path) final;
+#endif
+
+#if ENABLE(SANDBOX_EXTENSIONS)
+    void getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, WTF::Function<void(SandboxExtension::HandleArray&&)>&& completionHandler);
+    void updateTemporaryFileSandboxExtensions(const Vector<String>& paths, SandboxExtension::HandleArray&);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     NetworkProcess();
</span><span class="cx">     ~NetworkProcess();
</span><span class="lines">@@ -234,8 +253,6 @@
</span><span class="cx">     void syncAllCookies();
</span><span class="cx">     void didSyncAllCookies();
</span><span class="cx"> 
</span><del>-    void didGrantSandboxExtensionsToStorageProcessForBlobs(uint64_t requestID);
-
</del><span class="cx">     void writeBlobToFilePath(const WebCore::URL&, const String& path, SandboxExtension::Handle&&, uint64_t requestID);
</span><span class="cx"> 
</span><span class="cx"> #if USE(SOUP)
</span><span class="lines">@@ -258,6 +275,20 @@
</span><span class="cx">     void registerURLSchemeAsCORSEnabled(const String&) const;
</span><span class="cx">     void registerURLSchemeAsCanDisplayOnlyIfCanRequest(const String&) const;
</span><span class="cx"> 
</span><ins>+#if ENABLE(SANDBOX_EXTENSIONS)
+    void didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&&);
+#endif
+
+#if ENABLE(INDEXED_DATABASE)
+    void addIndexedDatabaseSession(PAL::SessionID, String&, SandboxExtension::Handle&);
+    HashSet<WebCore::SecurityOriginData> indexedDatabaseOrigins(const String& path);
+#endif
+
+    void postStorageTask(CrossThreadTask&&);
+    // For execution on work queue thread only.
+    void performNextStorageTask();
+    void ensurePathExists(const String& path);
+
</ins><span class="cx">     // Connections to WebProcesses.
</span><span class="cx">     Vector<RefPtr<NetworkConnectionToWebProcess>> m_webProcessConnections;
</span><span class="cx"> 
</span><span class="lines">@@ -278,7 +309,6 @@
</span><span class="cx">     typedef HashMap<const char*, std::unique_ptr<NetworkProcessSupplement>, PtrHash<const char*>> NetworkProcessSupplementMap;
</span><span class="cx">     NetworkProcessSupplementMap m_supplements;
</span><span class="cx"> 
</span><del>-    HashMap<uint64_t, Function<void()>> m_sandboxExtensionForBlobsCompletionHandlers;
</del><span class="cx">     HashSet<PAL::SessionID> m_sessionsControlledByAutomation;
</span><span class="cx"> 
</span><span class="cx">     HashMap<PAL::SessionID, Vector<CacheStorageParametersCallback>> m_cacheStorageParametersCallbacks;
</span><span class="lines">@@ -298,6 +328,20 @@
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     NetworkContentRuleListManager m_NetworkContentRuleListManager;
</span><span class="cx"> #endif
</span><ins>+
+    Ref<WorkQueue> m_storageTaskQueue;
+
+#if ENABLE(INDEXED_DATABASE)
+    HashMap<PAL::SessionID, String> m_idbDatabasePaths;
+    HashMap<PAL::SessionID, RefPtr<WebCore::IDBServer::IDBServer>> m_idbServers;
+#endif
+
+    HashMap<String, RefPtr<SandboxExtension>> m_blobTemporaryFileSandboxExtensions;
+    HashMap<uint64_t, WTF::Function<void(SandboxExtension::HandleArray&&)>> m_sandboxExtensionForBlobsCompletionHandlersStorageForNetworkProcess;
+    
+    Deque<CrossThreadTask> m_storageTasks;
+    Lock m_storageTaskMutex;
+
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -73,7 +73,9 @@
</span><span class="cx">     CancelPrepareToSuspend()
</span><span class="cx">     ProcessDidResume()
</span><span class="cx"> 
</span><del>-    DidGrantSandboxExtensionsToStorageProcessForBlobs(uint64_t requestID)
</del><ins>+#if ENABLE(SANDBOX_EXTENSIONS)
+    DidGetSandboxExtensionsForBlobFiles(uint64_t requestID, WebKit::SandboxExtension::HandleArray extensions)
+#endif
</ins><span class="cx"> 
</span><span class="cx">     WriteBlobToFilePath(WebCore::URL blobURL, String path, WebKit::SandboxExtension::Handle handle, uint64_t callbackID)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp  2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp     2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -108,6 +108,11 @@
</span><span class="cx"> #if ENABLE(PROXIMITY_NETWORKING)
</span><span class="cx">     encoder << wirelessContextIdentifier;
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    encoder << indexedDatabaseDirectory << indexedDatabaseDirectoryExtensionHandle;
+#endif
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProcessCreationParameters& result)
</span><span class="lines">@@ -246,6 +251,17 @@
</span><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    if (!decoder.decode(result.indexedDatabaseDirectory))
+        return false;
+    
+    std::optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle;
+    decoder >> indexedDatabaseDirectoryExtensionHandle;
+    if (!indexedDatabaseDirectoryExtensionHandle)
+        return false;
+    result.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle);
+#endif
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -124,6 +124,12 @@
</span><span class="cx"> #if ENABLE(PROXIMITY_NETWORKING)
</span><span class="cx">     unsigned wirelessContextIdentifier { 0 };
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    String indexedDatabaseDirectory;
+    SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle;
+#endif
+
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitSharedStorageStorageProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.cpp  2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.cpp     2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -37,9 +37,6 @@
</span><span class="cx"> void StorageProcessCreationParameters::encode(IPC::Encoder& encoder) const
</span><span class="cx"> {
</span><span class="cx">     encoder << sessionID;
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    encoder << indexedDatabaseDirectory << indexedDatabaseDirectoryExtensionHandle;
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     encoder << serviceWorkerRegistrationDirectory << serviceWorkerRegistrationDirectoryExtensionHandle << urlSchemesServiceWorkersCanHandle << shouldDisableServiceWorkerProcessTerminationDelay;
</span><span class="cx"> #endif
</span><span class="lines">@@ -49,16 +46,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!decoder.decode(result.sessionID))
</span><span class="cx">         return false;
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    if (!decoder.decode(result.indexedDatabaseDirectory))
-        return false;
</del><span class="cx"> 
</span><del>-    std::optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle;
-    decoder >> indexedDatabaseDirectoryExtensionHandle;
-    if (!indexedDatabaseDirectoryExtensionHandle)
-        return false;
-    result.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle);
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     if (!decoder.decode(result.serviceWorkerRegistrationDirectory))
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedStorageStorageProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.h    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/Shared/Storage/StorageProcessCreationParameters.h       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -44,11 +44,6 @@
</span><span class="cx">     static bool decode(IPC::Decoder&, StorageProcessCreationParameters&);
</span><span class="cx"> 
</span><span class="cx">     PAL::SessionID sessionID;
</span><del>-    
-#if ENABLE(INDEXED_DATABASE)
-    String indexedDatabaseDirectory;
-    SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle;
-#endif
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     String serviceWorkerRegistrationDirectory;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebsiteDataStoreParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp        2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp   2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -41,30 +41,55 @@
</span><span class="cx">     encoder << uiProcessCookieStorageIdentifier;
</span><span class="cx">     encoder << cookieStoragePathExtensionHandle;
</span><span class="cx">     encoder << pendingCookies;
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    encoder << indexedDatabaseDirectory << indexedDatabaseDirectoryExtensionHandle;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::optional<WebsiteDataStoreParameters> WebsiteDataStoreParameters::decode(IPC::Decoder& decoder)
</span><span class="cx"> {
</span><ins>+    WebsiteDataStoreParameters parameters;
+
</ins><span class="cx">     std::optional<NetworkSessionCreationParameters> networkSessionParameters;
</span><span class="cx">     decoder >> networkSessionParameters;
</span><span class="cx">     if (!networkSessionParameters)
</span><span class="cx">         return std::nullopt;
</span><ins>+    parameters.networkSessionParameters = WTFMove(*networkSessionParameters);
</ins><span class="cx"> 
</span><span class="cx">     std::optional<Vector<uint8_t>> uiProcessCookieStorageIdentifier;
</span><span class="cx">     decoder >> uiProcessCookieStorageIdentifier;
</span><span class="cx">     if (!uiProcessCookieStorageIdentifier)
</span><span class="cx">         return std::nullopt;
</span><ins>+    parameters.uiProcessCookieStorageIdentifier = WTFMove(*uiProcessCookieStorageIdentifier);
</ins><span class="cx"> 
</span><span class="cx">     std::optional<SandboxExtension::Handle> cookieStoragePathExtensionHandle;
</span><span class="cx">     decoder >> cookieStoragePathExtensionHandle;
</span><span class="cx">     if (!cookieStoragePathExtensionHandle)
</span><span class="cx">         return std::nullopt;
</span><ins>+    parameters.cookieStoragePathExtensionHandle = WTFMove(*cookieStoragePathExtensionHandle);
</ins><span class="cx"> 
</span><span class="cx">     std::optional<Vector<WebCore::Cookie>> pendingCookies;
</span><span class="cx">     decoder >> pendingCookies;
</span><span class="cx">     if (!pendingCookies)
</span><span class="cx">         return std::nullopt;
</span><del>-    return {{ WTFMove(*uiProcessCookieStorageIdentifier), WTFMove(*cookieStoragePathExtensionHandle), WTFMove(*pendingCookies), WTFMove(*networkSessionParameters)}};
</del><ins>+    parameters.pendingCookies = WTFMove(*pendingCookies);
+
+#if ENABLE(INDEXED_DATABASE)
+    std::optional<String> indexedDatabaseDirectory;
+    decoder >> indexedDatabaseDirectory;
+    if (!indexedDatabaseDirectory)
+        return std::nullopt;
+    parameters.indexedDatabaseDirectory = WTFMove(*indexedDatabaseDirectory);
+    
+    std::optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle;
+    decoder >> indexedDatabaseDirectoryExtensionHandle;
+    if (!indexedDatabaseDirectoryExtensionHandle)
+        return std::nullopt;
+    parameters.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle);
+#endif
+
+    return WTFMove(parameters);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebsiteDataStoreParameters WebsiteDataStoreParameters::privateSessionParameters(PAL::SessionID sessionID)
</span><span class="lines">@@ -74,7 +99,11 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">         , nullptr , { } , { }
</span><span class="cx"> #endif
</span><del>-    }};
</del><ins>+        }
+#if ENABLE(INDEXED_DATABASE)
+        , { }, { }
+#endif
+    };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebsiteDataStoreParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h  2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.h     2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -55,6 +55,11 @@
</span><span class="cx">     SandboxExtension::Handle cookieStoragePathExtensionHandle;
</span><span class="cx">     Vector<WebCore::Cookie> pendingCookies;
</span><span class="cx">     NetworkSessionCreationParameters networkSessionParameters;
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    String indexedDatabaseDirectory;
+    SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Sources.txt (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Sources.txt  2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/Sources.txt     2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -47,6 +47,8 @@
</span><span class="cx"> 
</span><span class="cx"> NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
</span><span class="cx"> 
</span><ins>+NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp
+
</ins><span class="cx"> NetworkProcess/cache/CacheStorageEngine.cpp
</span><span class="cx"> NetworkProcess/cache/CacheStorageEngineCache.cpp
</span><span class="cx"> NetworkProcess/cache/CacheStorageEngineCaches.cpp
</span><span class="lines">@@ -220,8 +222,6 @@
</span><span class="cx"> StorageProcess/StorageProcess.cpp @no-unify
</span><span class="cx"> StorageProcess/StorageToWebProcessConnection.cpp @no-unify
</span><span class="cx"> 
</span><del>-StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp @no-unify
-
</del><span class="cx"> StorageProcess/ServiceWorker/WebSWOriginStore.cpp @no-unify
</span><span class="cx"> StorageProcess/ServiceWorker/WebSWServerConnection.cpp @no-unify
</span><span class="cx"> StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp @no-unify
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageProcess.cpp    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.cpp       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include "WebSWServerToContextConnection.h"
</span><span class="cx"> #include "WebsiteData.h"
</span><span class="cx"> #include <WebCore/FileSystem.h>
</span><del>-#include <WebCore/IDBKeyData.h>
</del><span class="cx"> #include <WebCore/NotImplemented.h>
</span><span class="cx"> #include <WebCore/SWServerWorker.h>
</span><span class="cx"> #include <WebCore/SecurityOrigin.h>
</span><span class="lines">@@ -152,46 +151,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-IDBServer::IDBServer& StorageProcess::idbServer(PAL::SessionID sessionID)
-{
-    auto addResult = m_idbServers.add(sessionID, nullptr);
-    if (!addResult.isNewEntry) {
-        ASSERT(addResult.iterator->value);
-        return *addResult.iterator->value;
-    }
-
-    auto path = m_idbDatabasePaths.get(sessionID);
-    // There should already be a registered path for this PAL::SessionID.
-    // If there's not, then where did this PAL::SessionID come from?
-    ASSERT(!path.isEmpty());
-
-    addResult.iterator->value = IDBServer::IDBServer::create(path, StorageProcess::singleton());
-    return *addResult.iterator->value;
-}
-#endif
-
</del><span class="cx"> void StorageProcess::initializeWebsiteDataStore(const StorageProcessCreationParameters& parameters)
</span><span class="cx"> {
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    // *********
-    // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>)
-    // *********
-
-    auto addResult = m_idbDatabasePaths.ensure(parameters.sessionID, [path = parameters.indexedDatabaseDirectory] {
-        return path;
-    });
-    if (addResult.isNewEntry) {
-        SandboxExtension::consumePermanently(parameters.indexedDatabaseDirectoryExtensionHandle);
-        if (!parameters.indexedDatabaseDirectory.isEmpty())
-            postStorageTask(createCrossThreadTask(*this, &StorageProcess::ensurePathExists, parameters.indexedDatabaseDirectory));
-    }
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     if (!parentProcessHasServiceWorkerEntitlement())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    addResult = m_swDatabasePaths.ensure(parameters.sessionID, [path = parameters.serviceWorkerRegistrationDirectory] {
</del><ins>+    auto addResult = m_swDatabasePaths.ensure(parameters.sessionID, [path = parameters.serviceWorkerRegistrationDirectory] {
</ins><span class="cx">         return path;
</span><span class="cx">     });
</span><span class="cx">     if (addResult.isNewEntry) {
</span><span class="lines">@@ -324,19 +290,6 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-
-#if ENABLE(INDEXED_DATABASE)
-    path = m_idbDatabasePaths.get(sessionID);
-    if (!path.isEmpty() && websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases)) {
-        // FIXME: Pick the right database store based on the session ID.
-        postStorageTask(CrossThreadTask([this, callbackAggregator = callbackAggregator.copyRef(), path = WTFMove(path), rawWebsiteData]() mutable {
-            RunLoop::main().dispatch([callbackAggregator = WTFMove(callbackAggregator), rawWebsiteData, securityOrigins = indexedDatabaseOrigins(path)] {
-                for (const auto& securityOrigin : securityOrigins)
-                    rawWebsiteData->entries.append({ securityOrigin, WebsiteDataType::IndexedDBDatabases, 0 });
-            });
-        }));
-    }
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void StorageProcess::deleteWebsiteData(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, WallTime modifiedSince, uint64_t callbackID)
</span><span class="lines">@@ -349,11 +302,6 @@
</span><span class="cx">     if (websiteDataTypes.contains(WebsiteDataType::ServiceWorkerRegistrations))
</span><span class="cx">         swServerForSession(sessionID).clearAll([callbackAggregator = callbackAggregator.copyRef()] { });
</span><span class="cx"> #endif
</span><del>-
-#if ENABLE(INDEXED_DATABASE)
-    if (websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases))
-        idbServer(sessionID).closeAndDeleteDatabasesModifiedSince(modifiedSince, [callbackAggregator = WTFMove(callbackAggregator)] { });
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void StorageProcess::deleteWebsiteDataForOrigins(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, const Vector<SecurityOriginData>& securityOrigins, uint64_t callbackID)
</span><span class="lines">@@ -369,83 +317,8 @@
</span><span class="cx">             server.clear(securityOrigin, [callbackAggregator = callbackAggregator.copyRef()] { });
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-
-#if ENABLE(INDEXED_DATABASE)
-    if (websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases))
-        idbServer(sessionID).closeAndDeleteDatabasesForOrigins(securityOrigins, [callbackAggregator = WTFMove(callbackAggregator)] { });
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(SANDBOX_EXTENSIONS)
-void StorageProcess::grantSandboxExtensionsForBlobs(const Vector<String>& paths, SandboxExtension::HandleArray&& handles)
-{
-    ASSERT(paths.size() == handles.size());
-
-    for (size_t i = 0; i < paths.size(); ++i) {
-        auto result = m_blobTemporaryFileSandboxExtensions.add(paths[i], SandboxExtension::create(WTFMove(handles[i])));
-        ASSERT_UNUSED(result, result.isNewEntry);
-    }
-}
-#endif
-
-#if ENABLE(INDEXED_DATABASE)
-void StorageProcess::prepareForAccessToTemporaryFile(const String& path)
-{
-    if (auto extension = m_blobTemporaryFileSandboxExtensions.get(path))
-        extension->consume();
-}
-
-void StorageProcess::accessToTemporaryFileComplete(const String& path)
-{
-    // We've either hard linked the temporary blob file to the database directory, copied it there,
-    // or the transaction is being aborted.
-    // In any of those cases, we can delete the temporary blob file now.
-    FileSystem::deleteFile(path);
-
-    if (auto extension = m_blobTemporaryFileSandboxExtensions.take(path))
-        extension->revoke();
-}
-
-HashSet<WebCore::SecurityOriginData> StorageProcess::indexedDatabaseOrigins(const String& path)
-{
-    if (path.isEmpty())
-        return { };
-
-    HashSet<WebCore::SecurityOriginData> securityOrigins;
-    for (auto& topOriginPath : FileSystem::listDirectory(path, "*")) {
-        auto databaseIdentifier = FileSystem::pathGetFileName(topOriginPath);
-        if (auto securityOrigin = SecurityOriginData::fromDatabaseIdentifier(databaseIdentifier))
-            securityOrigins.add(WTFMove(*securityOrigin));
-        
-        for (auto& originPath : FileSystem::listDirectory(topOriginPath, "*")) {
-            databaseIdentifier = FileSystem::pathGetFileName(originPath);
-            if (auto securityOrigin = SecurityOriginData::fromDatabaseIdentifier(databaseIdentifier))
-                securityOrigins.add(WTFMove(*securityOrigin));
-        }
-    }
-
-    return securityOrigins;
-}
-
-#endif
-
-#if ENABLE(SANDBOX_EXTENSIONS)
-void StorageProcess::getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, WTF::Function<void (SandboxExtension::HandleArray&&)>&& completionHandler)
-{
-    static uint64_t lastRequestID;
-
-    uint64_t requestID = ++lastRequestID;
-    m_sandboxExtensionForBlobsCompletionHandlers.set(requestID, WTFMove(completionHandler));
-    parentProcessConnection()->send(Messages::StorageProcessProxy::GetSandboxExtensionsForBlobFiles(requestID, filenames), 0);
-}
-
-void StorageProcess::didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&& handles)
-{
-    if (auto handler = m_sandboxExtensionForBlobsCompletionHandlers.take(requestID))
-        handler(WTFMove(handles));
-}
-#endif
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx"> SWServer& StorageProcess::swServerForSession(PAL::SessionID sessionID)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageProcess.h      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.h 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -26,14 +26,10 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "ChildProcess.h"
</span><del>-#include "SandboxExtension.h"
</del><span class="cx"> #include <WebCore/FetchIdentifier.h>
</span><del>-#include <WebCore/IDBBackingStore.h>
-#include <WebCore/IDBServer.h>
</del><span class="cx"> #include <WebCore/SecurityOriginData.h>
</span><span class="cx"> #include <WebCore/ServiceWorkerIdentifier.h>
</span><span class="cx"> #include <WebCore/ServiceWorkerTypes.h>
</span><del>-#include <WebCore/UniqueIDBDatabase.h>
</del><span class="cx"> #include <pal/SessionID.h>
</span><span class="cx"> #include <wtf/CrossThreadTask.h>
</span><span class="cx"> #include <wtf/Function.h>
</span><span class="lines">@@ -63,9 +59,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> class StorageProcess : public ChildProcess
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    , public WebCore::IDBServer::IDBBackingStoreTemporaryFileHandler
-#endif
</del><span class="cx"> {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(StorageProcess);
</span><span class="cx">     friend NeverDestroyed<StorageProcess>;
</span><span class="lines">@@ -75,21 +68,8 @@
</span><span class="cx"> 
</span><span class="cx">     ~StorageProcess();
</span><span class="cx"> 
</span><del>-    WorkQueue& queue() { return m_queue.get(); }
</del><span class="cx">     void postStorageTask(CrossThreadTask&&);
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    WebCore::IDBServer::IDBServer& idbServer(PAL::SessionID);
-
-    // WebCore::IDBServer::IDBBackingStoreFileHandler
-    void prepareForAccessToTemporaryFile(const String& path) final;
-    void accessToTemporaryFileComplete(const String& path) final;
-#endif
-
-#if ENABLE(SANDBOX_EXTENSIONS)
-    void getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, WTF::Function<void (SandboxExtension::HandleArray&&)>&& completionHandler);
-#endif
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     bool parentProcessHasServiceWorkerEntitlement() const;
</span><span class="cx"> #else
</span><span class="lines">@@ -135,10 +115,7 @@
</span><span class="cx">     void fetchWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType> websiteDataTypes, uint64_t callbackID);
</span><span class="cx">     void deleteWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType> websiteDataTypes, WallTime modifiedSince, uint64_t callbackID);
</span><span class="cx">     void deleteWebsiteDataForOrigins(PAL::SessionID, OptionSet<WebsiteDataType> websiteDataTypes, const Vector<WebCore::SecurityOriginData>& origins, uint64_t callbackID);
</span><del>-#if ENABLE(SANDBOX_EXTENSIONS)
-    void grantSandboxExtensionsForBlobs(const Vector<String>& paths, SandboxExtension::HandleArray&&);
-    void didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&&);
-#endif
</del><ins>+
</ins><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     void didReceiveFetchResponse(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const WebCore::ResourceResponse&);
</span><span class="cx">     void didReceiveFetchData(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength);
</span><span class="lines">@@ -156,9 +133,6 @@
</span><span class="cx">     WebSWOriginStore* existingSWOriginStoreForSession(PAL::SessionID) const;
</span><span class="cx">     bool needsServerToContextConnectionForOrigin(const WebCore::SecurityOriginData&) const;
</span><span class="cx"> #endif
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    HashSet<WebCore::SecurityOriginData> indexedDatabaseOrigins(const String& path);
-#endif
</del><span class="cx"> 
</span><span class="cx">     // For execution on work queue thread only
</span><span class="cx">     void performNextStorageTask();
</span><span class="lines">@@ -168,13 +142,6 @@
</span><span class="cx"> 
</span><span class="cx">     Ref<WorkQueue> m_queue;
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    HashMap<PAL::SessionID, String> m_idbDatabasePaths;
-    HashMap<PAL::SessionID, RefPtr<WebCore::IDBServer::IDBServer>> m_idbServers;
-#endif
-    HashMap<String, RefPtr<SandboxExtension>> m_blobTemporaryFileSandboxExtensions;
-    HashMap<uint64_t, WTF::Function<void (SandboxExtension::HandleArray&&)>> m_sandboxExtensionForBlobsCompletionHandlers;
-
</del><span class="cx">     Deque<CrossThreadTask> m_storageTasks;
</span><span class="cx">     Lock m_storageTaskMutex;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -30,10 +30,6 @@
</span><span class="cx">     FetchWebsiteData(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, uint64_t callbackID)
</span><span class="cx">     DeleteWebsiteData(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, WallTime modifiedSince, uint64_t callbackID)
</span><span class="cx">     DeleteWebsiteDataForOrigins(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, Vector<WebCore::SecurityOriginData> origins, uint64_t callbackID)
</span><del>-#if ENABLE(SANDBOX_EXTENSIONS)
-    GrantSandboxExtensionsForBlobs(Vector<String> paths, WebKit::SandboxExtension::HandleArray extensions)
-    DidGetSandboxExtensionsForBlobFiles(uint64_t requestID, WebKit::SandboxExtension::HandleArray extensions)
-#endif
</del><span class="cx"> 
</span><span class="cx">     DestroySession(PAL::SessionID sessionID)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageToWebProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.cpp     2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.cpp        2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx"> #include "StorageProcess.h"
</span><span class="cx"> #include "StorageProcessMessages.h"
</span><span class="cx"> #include "StorageToWebProcessConnectionMessages.h"
</span><del>-#include "WebIDBConnectionToClient.h"
-#include "WebIDBConnectionToClientMessages.h"
</del><span class="cx"> #include "WebSWServerConnection.h"
</span><span class="cx"> #include "WebSWServerConnectionMessages.h"
</span><span class="cx"> #include <wtf/RunLoop.h>
</span><span class="lines">@@ -69,25 +67,11 @@
</span><span class="cx"> 
</span><span class="cx"> void StorageToWebProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
</span><span class="cx"> {
</span><del>-    if (decoder.messageReceiverName() == Messages::StorageToWebProcessConnection::messageReceiverName()) {
-        didReceiveStorageToWebProcessConnectionMessage(connection, decoder);
-        return;
-    }
-
</del><span class="cx">     if (decoder.messageReceiverName() == Messages::StorageProcess::messageReceiverName()) {
</span><span class="cx">         StorageProcess::singleton().didReceiveStorageProcessMessage(connection, decoder);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    if (decoder.messageReceiverName() == Messages::WebIDBConnectionToClient::messageReceiverName()) {
-        auto iterator = m_webIDBConnections.find(decoder.destinationID());
-        if (iterator != m_webIDBConnections.end())
-            iterator->value->didReceiveMessage(connection, decoder);
-        return;
-    }
-#endif
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     if (decoder.messageReceiverName() == Messages::WebSWServerConnection::messageReceiverName()) {
</span><span class="cx">         if (auto swConnection = m_swConnections.get(makeObjectIdentifier<SWServerConnectionIdentifierType>(decoder.destinationID())))
</span><span class="lines">@@ -136,14 +120,6 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    auto idbConnections = m_webIDBConnections;
-    for (auto& connection : idbConnections.values())
-        connection->disconnectedFromWebProcess();
-
-    m_webIDBConnections.clear();
-#endif
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     unregisterSWConnections();
</span><span class="cx"> #endif
</span><span class="lines">@@ -180,30 +156,4 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-static uint64_t generateIDBConnectionToServerIdentifier()
-{
-    ASSERT(RunLoop::isMain());
-    static uint64_t identifier = 0;
-    return ++identifier;
-}
-
-void StorageToWebProcessConnection::establishIDBConnectionToServer(SessionID sessionID, uint64_t& serverConnectionIdentifier)
-{
-    serverConnectionIdentifier = generateIDBConnectionToServerIdentifier();
-    LOG(IndexedDB, "StorageToWebProcessConnection::establishIDBConnectionToServer - %" PRIu64, serverConnectionIdentifier);
-    ASSERT(!m_webIDBConnections.contains(serverConnectionIdentifier));
-
-    m_webIDBConnections.set(serverConnectionIdentifier, WebIDBConnectionToClient::create(*this, serverConnectionIdentifier, sessionID));
-}
-
-void StorageToWebProcessConnection::removeIDBConnectionToServer(uint64_t serverConnectionIdentifier)
-{
-    ASSERT(m_webIDBConnections.contains(serverConnectionIdentifier));
-
-    auto connection = m_webIDBConnections.take(serverConnectionIdentifier);
-    connection->disconnectedFromWebProcess();
-}
-#endif
-
</del><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageToWebProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.h       2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.h  2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class WebIDBConnectionToClient;
</del><span class="cx"> class WebSWServerConnection;
</span><span class="cx"> class WebSWServerToContextConnection;
</span><span class="cx"> 
</span><span class="lines">@@ -60,14 +59,6 @@
</span><span class="cx">     IPC::Connection* messageSenderConnection() override { return m_connection.ptr(); }
</span><span class="cx">     uint64_t messageSenderDestinationID() override { return 0; }
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    // Messages handlers (Modern IDB)
-    void establishIDBConnectionToServer(PAL::SessionID, uint64_t& serverConnectionIdentifier);
-    void removeIDBConnectionToServer(uint64_t serverConnectionIdentifier);
-
-    HashMap<uint64_t, RefPtr<WebIDBConnectionToClient>> m_webIDBConnections;
-#endif // ENABLE(INDEXED_DATABASE)
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     void establishSWServerConnection(PAL::SessionID, WebCore::SWServerConnectionIdentifier&);
</span><span class="cx">     void unregisterSWConnections();
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageToWebProcessConnectionmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in     2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in        2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -21,10 +21,6 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><span class="cx"> messages -> StorageToWebProcessConnection LegacyReceiver {
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    EstablishIDBConnectionToServer(PAL::SessionID sessionID) -> (uint64_t serverConnectionIdentifier)
-    RemoveIDBConnectionToServer(uint64_t serverConnectionIdentifier)
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     EstablishSWServerConnection(PAL::SessionID sessionID) -> (WebCore::SWServerConnectionIdentifier serverConnectionIdentifier)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -325,21 +325,6 @@
</span><span class="cx">     callback();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs(uint64_t requestID, const Vector<String>& paths)
-{
-#if ENABLE(SANDBOX_EXTENSIONS)
-    SandboxExtension::HandleArray extensions;
-    extensions.allocate(paths.size());
-    for (size_t i = 0; i < paths.size(); ++i) {
-        // ReadWrite is required for creating hard links as well as deleting the temporary file, which the StorageProcess will do.
-        SandboxExtension::createHandle(paths[i], SandboxExtension::Type::ReadWrite, extensions[i]);
-    }
-
-    m_processPool.sendToStorageProcessRelaunchingIfNecessary(Messages::StorageProcess::GrantSandboxExtensionsForBlobs(paths, extensions));
-#endif
-    connection()->send(Messages::NetworkProcess::DidGrantSandboxExtensionsToStorageProcessForBlobs(requestID), 0);
-}
-
</del><span class="cx"> void NetworkProcessProxy::didFinishLaunching(ProcessLauncher* launcher, IPC::Connection::Identifier connectionIdentifier)
</span><span class="cx"> {
</span><span class="cx">     ChildProcessProxy::didFinishLaunching(launcher, connectionIdentifier);
</span><span class="lines">@@ -645,6 +630,20 @@
</span><span class="cx">     send(Messages::NetworkProcess::ProcessDidTransitionToBackground(), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(SANDBOX_EXTENSIONS)
+void NetworkProcessProxy::getSandboxExtensionsForBlobFiles(uint64_t requestID, const Vector<String>& paths)
+{
+    SandboxExtension::HandleArray extensions;
+    extensions.allocate(paths.size());
+    for (size_t i = 0; i < paths.size(); ++i) {
+        // ReadWrite is required for creating hard links, which is something that might be done with these extensions.
+        SandboxExtension::createHandle(paths[i], SandboxExtension::Type::ReadWrite, extensions[i]);
+    }
+    
+    send(Messages::NetworkProcess::DidGetSandboxExtensionsForBlobFiles(requestID, extensions), 0);
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #undef MESSAGE_CHECK
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -139,7 +139,6 @@
</span><span class="cx">     void didDeleteWebsiteData(uint64_t callbackID);
</span><span class="cx">     void didDeleteWebsiteDataForOrigins(uint64_t callbackID);
</span><span class="cx">     void didWriteBlobToFilePath(bool success, uint64_t callbackID);
</span><del>-    void grantSandboxExtensionsToStorageProcessForBlobs(uint64_t requestID, const Vector<String>& paths);
</del><span class="cx">     void logDiagnosticMessage(uint64_t pageID, const String& message, const String& description, WebCore::ShouldSample);
</span><span class="cx">     void logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
</span><span class="cx">     void logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
</span><span class="lines">@@ -155,6 +154,10 @@
</span><span class="cx">     void contentExtensionRules(UserContentControllerIdentifier);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(SANDBOX_EXTENSIONS)
+    void getSandboxExtensionsForBlobFiles(uint64_t requestID, const Vector<String>& paths);
+#endif
+
</ins><span class="cx">     // ProcessLauncher::Client
</span><span class="cx">     void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -33,8 +33,6 @@
</span><span class="cx"> 
</span><span class="cx">     DidWriteBlobToFilePath(bool success, uint64_t callbackID)
</span><span class="cx"> 
</span><del>-    GrantSandboxExtensionsToStorageProcessForBlobs(uint64_t requestID, Vector<String> paths)
-
</del><span class="cx">     ProcessReadyToSuspend()
</span><span class="cx">     SetIsHoldingLockedFiles(bool isHoldingLockedFiles)
</span><span class="cx"> 
</span><span class="lines">@@ -54,4 +52,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     RetrieveCacheStorageParameters(PAL::SessionID sessionID)
</span><ins>+
+#if ENABLE(SANDBOX_EXTENSIONS)
+    GetSandboxExtensionsForBlobFiles(uint64_t requestID, Vector<String> paths)
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessStorageStorageProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -221,20 +221,6 @@
</span><span class="cx">     callback();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(SANDBOX_EXTENSIONS)
-void StorageProcessProxy::getSandboxExtensionsForBlobFiles(uint64_t requestID, const Vector<String>& paths)
-{
-    SandboxExtension::HandleArray extensions;
-    extensions.allocate(paths.size());
-    for (size_t i = 0; i < paths.size(); ++i) {
-        // ReadWrite is required for creating hard links, which is something that might be done with these extensions.
-        SandboxExtension::createHandle(paths[i], SandboxExtension::Type::ReadWrite, extensions[i]);
-    }
-
-    send(Messages::StorageProcess::DidGetSandboxExtensionsForBlobFiles(requestID, extensions), 0);
-}
-#endif
-
</del><span class="cx"> void StorageProcessProxy::didFinishLaunching(ProcessLauncher* launcher, IPC::Connection::Identifier connectionIdentifier)
</span><span class="cx"> {
</span><span class="cx">     ChildProcessProxy::didFinishLaunching(launcher, connectionIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessStorageStorageProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -79,9 +79,6 @@
</span><span class="cx">     void didFetchWebsiteData(uint64_t callbackID, const WebsiteData&);
</span><span class="cx">     void didDeleteWebsiteData(uint64_t callbackID);
</span><span class="cx">     void didDeleteWebsiteDataForOrigins(uint64_t callbackID);
</span><del>-#if ENABLE(SANDBOX_EXTENSIONS)
-    void getSandboxExtensionsForBlobFiles(uint64_t requestID, const Vector<String>& paths);
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     void establishWorkerContextConnectionToStorageProcess(WebCore::SecurityOriginData&&);
</span><span class="cx">     void establishWorkerContextConnectionToStorageProcessForExplicitSession(WebCore::SecurityOriginData&&, PAL::SessionID);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessStorageStorageProcessProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.messages.in (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.messages.in    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.messages.in       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -27,10 +27,6 @@
</span><span class="cx">     DidDeleteWebsiteData(uint64_t callbackID)
</span><span class="cx">     DidDeleteWebsiteDataForOrigins(uint64_t callbackID)
</span><span class="cx"> 
</span><del>-#if ENABLE(SANDBOX_EXTENSIONS)
-    GetSandboxExtensionsForBlobFiles(uint64_t requestID, Vector<String> paths)
-#endif
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     EstablishWorkerContextConnectionToStorageProcess(struct WebCore::SecurityOriginData origin)
</span><span class="cx">     EstablishWorkerContextConnectionToStorageProcessForExplicitSession(struct WebCore::SecurityOriginData origin, PAL::SessionID explicitSession)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp    2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -524,6 +524,17 @@
</span><span class="cx">     parameters.urlSchemesRegisteredAsCORSEnabled = copyToVector(m_schemesToRegisterAsCORSEnabled);
</span><span class="cx">     parameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest = copyToVector(m_schemesToRegisterAsCanDisplayOnlyIfCanRequest);
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    // *********
+    // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>)
+    // *********
+    parameters.indexedDatabaseDirectory = m_configuration->indexedDBDatabaseDirectory();
+    if (parameters.indexedDatabaseDirectory.isEmpty())
+        parameters.indexedDatabaseDirectory = API::WebsiteDataStore::defaultDataStore()->websiteDataStore().parameters().indexedDatabaseDirectory;
+    
+    SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
+#endif
+
</ins><span class="cx">     // Add any platform specific parameters
</span><span class="cx">     platformInitializeNetworkProcess(parameters);
</span><span class="cx"> 
</span><span class="lines">@@ -584,21 +595,11 @@
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::ensureStorageProcessAndWebsiteDataStore(WebsiteDataStore* relevantDataStore)
</span><span class="cx"> {
</span><del>-    // *********
-    // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>)
-    // *********
-
</del><span class="cx">     if (!m_storageProcess) {
</span><span class="cx">         auto parameters = m_websiteDataStore ? m_websiteDataStore->websiteDataStore().storageProcessParameters() : (relevantDataStore ? relevantDataStore->storageProcessParameters() : API::WebsiteDataStore::defaultDataStore()->websiteDataStore().storageProcessParameters());
</span><span class="cx"> 
</span><span class="cx">         ASSERT(parameters.sessionID.isValid());
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-        if (parameters.indexedDatabaseDirectory.isEmpty()) {
-            parameters.indexedDatabaseDirectory = m_configuration->indexedDBDatabaseDirectory();
-            SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
-        }
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">         if (parameters.serviceWorkerRegistrationDirectory.isEmpty()) {
</span><span class="cx">             parameters.serviceWorkerRegistrationDirectory = API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory();
</span><span class="lines">@@ -1211,9 +1212,8 @@
</span><span class="cx">         page.process().send(Messages::WebProcess::AddWebsiteDataStore(page.websiteDataStore().parameters()), 0);
</span><span class="cx">         page.websiteDataStore().clearPendingCookies();
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-        if (!page.websiteDataStore().resolvedIndexedDatabaseDirectory().isEmpty())
-            ensureStorageProcessAndWebsiteDataStore(&page.websiteDataStore());
</del><ins>+#if ENABLE(SERVICE_WORKER)
+        ensureStorageProcessAndWebsiteDataStore(&page.websiteDataStore());
</ins><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm 2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm    2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -85,6 +85,12 @@
</span><span class="cx">     if (!cookieFile.isEmpty())
</span><span class="cx">         SandboxExtension::createHandleForReadWriteDirectory(WebCore::FileSystem::directoryName(cookieFile), parameters.cookieStoragePathExtensionHandle);
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    parameters.indexedDatabaseDirectory = resolvedIndexedDatabaseDirectory();
+    if (!parameters.indexedDatabaseDirectory.isEmpty())
+        SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
+#endif
+
</ins><span class="cx">     return parameters;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp   2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp      2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -223,6 +223,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::DOMCache))
</span><span class="cx">         processAccessType = std::max(processAccessType, ProcessAccessType::Launch);
</span><ins>+    
+    if (dataTypes.contains(WebsiteDataType::IndexedDBDatabases) && !isNonPersistentStore)
+        processAccessType = std::max(processAccessType, ProcessAccessType::Launch);
</ins><span class="cx"> 
</span><span class="cx">     return processAccessType;
</span><span class="cx"> }
</span><span class="lines">@@ -510,11 +513,8 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ((dataTypes.contains(WebsiteDataType::IndexedDBDatabases)
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><del>-        || dataTypes.contains(WebsiteDataType::ServiceWorkerRegistrations)
-#endif
-        ) && isPersistent()) {
</del><ins>+    if (dataTypes.contains(WebsiteDataType::ServiceWorkerRegistrations) && isPersistent()) {
</ins><span class="cx">         for (auto& processPool : processPools()) {
</span><span class="cx">             processPool->ensureStorageProcessAndWebsiteDataStore(this);
</span><span class="cx"> 
</span><span class="lines">@@ -524,6 +524,7 @@
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::MediaKeys) && isPersistent()) {
</span><span class="cx">         callbackAggregator->addPendingCallback();
</span><span class="lines">@@ -656,6 +657,9 @@
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::DOMCache))
</span><span class="cx">         processAccessType = std::max(processAccessType, ProcessAccessType::Launch);
</span><span class="cx"> 
</span><ins>+    if (dataTypes.contains(WebsiteDataType::IndexedDBDatabases) && !isNonPersistentStore)
+        processAccessType = std::max(processAccessType, ProcessAccessType::Launch);
+
</ins><span class="cx">     return processAccessType;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -820,11 +824,8 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ((dataTypes.contains(WebsiteDataType::IndexedDBDatabases)
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><del>-        || dataTypes.contains(WebsiteDataType::ServiceWorkerRegistrations)
-#endif
-        ) && isPersistent()) {
</del><ins>+    if (dataTypes.contains(WebsiteDataType::ServiceWorkerRegistrations) && isPersistent()) {
</ins><span class="cx">         for (auto& processPool : processPools()) {
</span><span class="cx">             processPool->ensureStorageProcessAndWebsiteDataStore(this);
</span><span class="cx"> 
</span><span class="lines">@@ -834,6 +835,7 @@
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::MediaKeys) && isPersistent()) {
</span><span class="cx">         callbackAggregator->addPendingCallback();
</span><span class="lines">@@ -1121,11 +1123,8 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ((dataTypes.contains(WebsiteDataType::IndexedDBDatabases)
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><del>-        || dataTypes.contains(WebsiteDataType::ServiceWorkerRegistrations)
-#endif
-        ) && isPersistent()) {
</del><ins>+    if (dataTypes.contains(WebsiteDataType::ServiceWorkerRegistrations) && isPersistent()) {
</ins><span class="cx">         for (auto& processPool : processPools()) {
</span><span class="cx">             processPool->ensureStorageProcessAndWebsiteDataStore(this);
</span><span class="cx"> 
</span><span class="lines">@@ -1135,6 +1134,7 @@
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (dataTypes.contains(WebsiteDataType::MediaKeys) && isPersistent()) {
</span><span class="cx">         HashSet<WebCore::SecurityOriginData> origins;
</span><span class="lines">@@ -1596,11 +1596,6 @@
</span><span class="cx"> 
</span><span class="cx">     parameters.sessionID = m_sessionID;
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    parameters.indexedDatabaseDirectory = resolvedIndexedDatabaseDirectory();
-    if (!parameters.indexedDatabaseDirectory.isEmpty())
-        SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     parameters.serviceWorkerRegistrationDirectory = resolvedServiceWorkerRegistrationDirectory();
</span><span class="cx">     if (!parameters.serviceWorkerRegistrationDirectory.isEmpty())
</span><span class="lines">@@ -1636,6 +1631,15 @@
</span><span class="cx">     // FIXME: Implement cookies.
</span><span class="cx">     WebsiteDataStoreParameters parameters;
</span><span class="cx">     parameters.networkSessionParameters.sessionID = m_sessionID;
</span><ins>+
+    resolveDirectoriesIfNecessary();
+
+#if ENABLE(INDEXED_DATABASE)
+    parameters.indexedDatabaseDirectory = resolvedIndexedDatabaseDirectory();
+    if (!parameters.indexedDatabaseDirectory.isEmpty())
+        SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle);
+#endif
+
</ins><span class="cx">     return parameters;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -890,8 +890,6 @@
</span><span class="cx">          4A3CC18D19B0641900D14AEF /* UserMediaPermissionRequestProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F3C19AF7B04002EBAB5 /* UserMediaPermissionRequestProxy.h */; };
</span><span class="cx">          4A3CC18F19B07B8A00D14AEF /* WKUserMediaPermissionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F3619AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F601430155C5A32001FBDE0 /* BlockingResponseMap.h */; };
</span><del>-               5105236F1C739D42007993CB /* WebIDBConnectionToClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5105236D1C7393E9007993CB /* WebIDBConnectionToClient.cpp */; };
-               510523701C739D42007993CB /* WebIDBConnectionToClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5105236E1C7393E9007993CB /* WebIDBConnectionToClient.h */; };
</del><span class="cx">           510523741C73D38B007993CB /* WebIDBConnectionToServerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 510523731C73D37B007993CB /* WebIDBConnectionToServerMessages.h */; };
</span><span class="cx">          510523751C73D38F007993CB /* WebIDBConnectionToServerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510523721C73D37B007993CB /* WebIDBConnectionToServerMessageReceiver.cpp */; };
</span><span class="cx">          510523791C73DA77007993CB /* WebIDBConnectionToClientMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510523771C73DA70007993CB /* WebIDBConnectionToClientMessageReceiver.cpp */; };
</span><span class="lines">@@ -1202,6 +1200,7 @@
</span><span class="cx">          9321D5861A38EE3C008052BE /* WKImmediateActionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9321D5851A38EE3C008052BE /* WKImmediateActionController.h */; };
</span><span class="cx">          9321D58A1A38F196008052BE /* WKImmediateActionTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 9321D5891A38F196008052BE /* WKImmediateActionTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          9323611E1B015DA800FA9232 /* _WKOverlayScrollbarStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9323611D1B015DA800FA9232 /* _WKOverlayScrollbarStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               93261161214054F4000806E7 /* WebIDBConnectionToClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 939288DD21404D6C00EBBA33 /* WebIDBConnectionToClient.h */; };
</ins><span class="cx">           933DF82E1B3BC09000AEA9E3 /* WKImagePreviewViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 933DF82D1B3BC09000AEA9E3 /* WKImagePreviewViewController.h */; };
</span><span class="cx">          934B724419F5B9BE00AE96D6 /* WKActionMenuItemTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 934B724319F5B9BE00AE96D6 /* WKActionMenuItemTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3712,6 +3711,9 @@
</span><span class="cx">          9391074E1BF6BC65008C17AD /* WKPreviewElementInfoInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreviewElementInfoInternal.h; sourceTree = "<group>"; };
</span><span class="cx">          9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameNetworkingContext.h; sourceTree = "<group>"; };
</span><span class="cx">          9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameNetworkingContext.mm; sourceTree = "<group>"; };
</span><ins>+               939288DD21404D6C00EBBA33 /* WebIDBConnectionToClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebIDBConnectionToClient.h; sourceTree = "<group>"; };
+               939288E121404E1000EBBA33 /* WebIDBConnectionToClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBConnectionToClient.cpp; sourceTree = "<group>"; };
+               939288E221404E1000EBBA33 /* WebIDBConnectionToClient.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebIDBConnectionToClient.messages.in; sourceTree = "<group>"; };
</ins><span class="cx">           9395E6891BF2C33200F49BCE /* WKPreviewElementInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreviewElementInfo.h; sourceTree = "<group>"; };
</span><span class="cx">          9395E68B1BF2C35200F49BCE /* WKPreviewElementInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKPreviewElementInfo.mm; sourceTree = "<group>"; };
</span><span class="cx">          939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreArgumentCoders.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -6340,6 +6342,7 @@
</span><span class="cx">                          5C1426F11C23F81700D41183 /* Downloads */,
</span><span class="cx">                          BC82837C16B45DA500A278FE /* EntryPoint */,
</span><span class="cx">                          E1798C7616E6815500240139 /* FileAPI */,
</span><ins>+                               939288E021404DF000EBBA33 /* IndexedDB */,
</ins><span class="cx">                           2DA944BB188511DD00ED86DB /* ios */,
</span><span class="cx">                          510CC7DC16138E2900D03ED3 /* mac */,
</span><span class="cx">                          A11455A1211FCE7F00CA935B /* watchos */,
</span><span class="lines">@@ -6909,6 +6912,16 @@
</span><span class="cx">                  path = cocoa;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="cx">          };
</span><ins>+               939288E021404DF000EBBA33 /* IndexedDB */ = {
+                       isa = PBXGroup;
+                       children = (
+                               939288E121404E1000EBBA33 /* WebIDBConnectionToClient.cpp */,
+                               939288DD21404D6C00EBBA33 /* WebIDBConnectionToClient.h */,
+                               939288E221404E1000EBBA33 /* WebIDBConnectionToClient.messages.in */,
+                       );
+                       path = IndexedDB;
+                       sourceTree = "<group>";
+               };
</ins><span class="cx">           9394AE411702B25B00344232 /* mac */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><span class="lines">@@ -9322,7 +9335,7 @@
</span><span class="cx">                          2D5036761BCED19F00E20BB3 /* WebGestureEvent.h in Headers */,
</span><span class="cx">                          93A88B331BC6E9CD00ABA5C2 /* WebHitTestResultData.h in Headers */,
</span><span class="cx">                          F44DFEB21E9E752F0038D196 /* WebIconUtilities.h in Headers */,
</span><del>-                               510523701C739D42007993CB /* WebIDBConnectionToClient.h in Headers */,
</del><ins>+                                93261161214054F4000806E7 /* WebIDBConnectionToClient.h in Headers */,
</ins><span class="cx">                           5105237A1C73DA77007993CB /* WebIDBConnectionToClientMessages.h in Headers */,
</span><span class="cx">                          514129941C6428BB0059E714 /* WebIDBConnectionToServer.h in Headers */,
</span><span class="cx">                          510523741C73D38B007993CB /* WebIDBConnectionToServerMessages.h in Headers */,
</span><span class="lines">@@ -10939,7 +10952,6 @@
</span><span class="cx">                          CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                          BC0E606112D6BA910012A72A /* WebGeolocationManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                          BC0E618212D6CB1D0012A72A /* WebGeolocationManagerProxyMessageReceiver.cpp in Sources */,
</span><del>-                               5105236F1C739D42007993CB /* WebIDBConnectionToClient.cpp in Sources */,
</del><span class="cx">                           510523791C73DA77007993CB /* WebIDBConnectionToClientMessageReceiver.cpp in Sources */,
</span><span class="cx">                          510523751C73D38F007993CB /* WebIDBConnectionToServerMessageReceiver.cpp in Sources */,
</span><span class="cx">                          FEDBDCD61E68D20000A59F8F /* WebInspectorInterruptDispatcherMessageReceiver.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessDatabasesIndexedDBWebIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp  2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp     2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -31,12 +31,10 @@
</span><span class="cx"> #include "DataReference.h"
</span><span class="cx"> #include "NetworkConnectionToWebProcessMessages.h"
</span><span class="cx"> #include "NetworkProcessConnection.h"
</span><del>-#include "StorageToWebProcessConnectionMessages.h"
</del><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebIDBConnectionToClientMessages.h"
</span><span class="cx"> #include "WebIDBResult.h"
</span><span class="cx"> #include "WebProcess.h"
</span><del>-#include "WebToStorageProcessConnection.h"
</del><span class="cx"> #include <WebCore/IDBConnectionToServer.h>
</span><span class="cx"> #include <WebCore/IDBCursorInfo.h>
</span><span class="cx"> #include <WebCore/IDBError.h>
</span><span class="lines">@@ -64,7 +62,7 @@
</span><span class="cx"> {
</span><span class="cx">     relaxAdoptionRequirement();
</span><span class="cx"> 
</span><del>-    m_isOpenInServer = sendSync(Messages::StorageToWebProcessConnection::EstablishIDBConnectionToServer(sessionID), Messages::StorageToWebProcessConnection::EstablishIDBConnectionToServer::Reply(m_identifier));
</del><ins>+    m_isOpenInServer = sendSync(Messages::NetworkConnectionToWebProcess::EstablishIDBConnectionToServer(sessionID), Messages::NetworkConnectionToWebProcess::EstablishIDBConnectionToServer::Reply(m_identifier));
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: This creates a reference cycle, so neither this object nor the IDBConnectionToServer will ever be deallocated.
</span><span class="cx">     m_connectionToServer = IDBClient::IDBConnectionToServer::create(*this);
</span><span class="lines">@@ -73,12 +71,12 @@
</span><span class="cx"> WebIDBConnectionToServer::~WebIDBConnectionToServer()
</span><span class="cx"> {
</span><span class="cx">     if (m_isOpenInServer)
</span><del>-        send(Messages::StorageToWebProcessConnection::RemoveIDBConnectionToServer(m_identifier));
</del><ins>+        send(Messages::NetworkConnectionToWebProcess::RemoveIDBConnectionToServer(m_identifier));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IPC::Connection* WebIDBConnectionToServer::messageSenderConnection()
</span><span class="cx"> {
</span><del>-    return &WebProcess::singleton().ensureWebToStorageProcessConnection(m_sessionID).connection();
</del><ins>+    return &WebProcess::singleton().ensureNetworkProcessConnection().connection();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBClient::IDBConnectionToServer& WebIDBConnectionToServer::coreConnectionToServer()
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessDatabasesWebDatabaseProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp 2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp    2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "WebDatabaseProvider.h"
</span><span class="cx"> 
</span><ins>+#include "NetworkProcessConnection.h"
</ins><span class="cx"> #include "WebProcess.h"
</span><del>-#include "WebToStorageProcessConnection.h"
</del><span class="cx"> #include <pal/SessionID.h>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="lines">@@ -67,7 +67,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><del>-
</del><span class="cx"> WebCore::IDBClient::IDBConnectionToServer& WebDatabaseProvider::idbConnectionToServerForSession(const PAL::SessionID& sessionID)
</span><span class="cx"> {
</span><span class="cx">     if (sessionID.isEphemeral()) {
</span><span class="lines">@@ -78,9 +77,8 @@
</span><span class="cx">         return result.iterator->value->connectionToServer();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return WebProcess::singleton().ensureWebToStorageProcessConnection(sessionID).idbConnectionToServerForSession(sessionID).coreConnectionToServer();
</del><ins>+    return WebProcess::singleton().ensureNetworkProcessConnection().idbConnectionToServerForSession(sessionID).coreConnectionToServer();
</ins><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkNetworkProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "WebCacheStorageConnectionMessages.h"
</span><span class="cx"> #include "WebCacheStorageProvider.h"
</span><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><ins>+#include "WebIDBConnectionToServerMessages.h"
</ins><span class="cx"> #include "WebLoaderStrategy.h"
</span><span class="cx"> #include "WebMDNSRegisterMessages.h"
</span><span class="cx"> #include "WebPage.h"
</span><span class="lines">@@ -107,6 +108,14 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    if (decoder.messageReceiverName() == Messages::WebIDBConnectionToServer::messageReceiverName()) {
+        if (auto idbConnection = m_webIDBConnectionsByIdentifier.get(decoder.destinationID()))
+            idbConnection->didReceiveMessage(connection, decoder);
+        return;
+    }
+#endif
+
</ins><span class="cx">     didReceiveNetworkProcessConnectionMessage(connection, decoder);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -126,6 +135,16 @@
</span><span class="cx">         handler(dummyFilenames);
</span><span class="cx"> 
</span><span class="cx">     m_writeBlobToFileCompletionHandlers.clear();
</span><ins>+
+
+#if ENABLE(INDEXED_DATABASE)
+    for (auto& connection : m_webIDBConnectionsByIdentifier.values())
+        connection->connectionToServerLost();
+    
+    m_webIDBConnectionsByIdentifier.clear();
+    m_webIDBConnectionsBySession.clear();
+#endif
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference)
</span><span class="lines">@@ -181,4 +200,17 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+WebIDBConnectionToServer& NetworkProcessConnection::idbConnectionToServerForSession(PAL::SessionID sessionID)
+{
+    return *m_webIDBConnectionsBySession.ensure(sessionID, [&] {
+        auto connection = WebIDBConnectionToServer::create(sessionID);
+        
+        auto result = m_webIDBConnectionsByIdentifier.add(connection->identifier(), connection.copyRef());
+        ASSERT_UNUSED(result, result.isNewEntry);
+        
+        return connection;
+    }).iterator->value;
+}
+#endif
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkNetworkProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h        2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h   2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "Connection.h"
</span><span class="cx"> #include "ShareableResource.h"
</span><ins>+#include "WebIDBConnectionToServer.h"
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><span class="lines">@@ -63,6 +64,11 @@
</span><span class="cx"> 
</span><span class="cx">     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler);
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    WebIDBConnectionToServer* existingIDBConnectionToServerForIdentifier(uint64_t identifier) const { return m_webIDBConnectionsByIdentifier.get(identifier); };
+    WebIDBConnectionToServer& idbConnectionToServerForSession(PAL::SessionID);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     NetworkProcessConnection(IPC::Connection::Identifier);
</span><span class="cx"> 
</span><span class="lines">@@ -86,6 +92,12 @@
</span><span class="cx">     Ref<IPC::Connection> m_connection;
</span><span class="cx"> 
</span><span class="cx">     HashMap<uint64_t, Function<void (const Vector<String>&)>> m_writeBlobToFileCompletionHandlers;
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    HashMap<PAL::SessionID, RefPtr<WebIDBConnectionToServer>> m_webIDBConnectionsBySession;
+    HashMap<uint64_t, RefPtr<WebIDBConnectionToServer>> m_webIDBConnectionsByIdentifier;
+#endif
+
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageWebToStorageProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.cpp 2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.cpp    2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include "ServiceWorkerClientFetchMessages.h"
</span><span class="cx"> #include "StorageToWebProcessConnectionMessages.h"
</span><del>-#include "WebIDBConnectionToServerMessages.h"
</del><span class="cx"> #include "WebProcess.h"
</span><span class="cx"> #include "WebSWClientConnection.h"
</span><span class="cx"> #include "WebSWClientConnectionMessages.h"
</span><span class="lines">@@ -55,15 +54,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WebToStorageProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
</span><span class="cx"> {
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    if (decoder.messageReceiverName() == Messages::WebIDBConnectionToServer::messageReceiverName()) {
-        auto idbConnection = m_webIDBConnectionsByIdentifier.get(decoder.destinationID());
-        if (idbConnection)
-            idbConnection->didReceiveMessage(connection, decoder);
-        return;
-    }
-#endif
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     if (decoder.messageReceiverName() == Messages::WebSWClientConnection::messageReceiverName()) {
</span><span class="cx">         auto serviceWorkerConnection = m_swConnectionsByIdentifier.get(makeObjectIdentifier<SWServerConnectionIdentifierType>(decoder.destinationID()));
</span><span class="lines">@@ -102,10 +92,6 @@
</span><span class="cx"> {
</span><span class="cx">     auto protectedThis = makeRef(*this);
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    for (auto& connection : m_webIDBConnectionsByIdentifier.values())
-        connection->connectionToServerLost();
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     for (auto& connection : m_swConnectionsBySession.values())
</span><span class="cx">         connection->connectionToServerLost();
</span><span class="lines">@@ -115,11 +101,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     WebProcess::singleton().webToStorageProcessConnectionClosed(this);
</span><del>-
-#if ENABLE(INDEXED_DATABASE)
-    m_webIDBConnectionsByIdentifier.clear();
-    m_webIDBConnectionsBySession.clear();
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebToStorageProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName)
</span><span class="lines">@@ -126,20 +107,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-WebIDBConnectionToServer& WebToStorageProcessConnection::idbConnectionToServerForSession(SessionID sessionID)
-{
-    return *m_webIDBConnectionsBySession.ensure(sessionID, [&] {
-        auto connection = WebIDBConnectionToServer::create(sessionID);
-
-        auto result = m_webIDBConnectionsByIdentifier.add(connection->identifier(), connection.copyRef());
-        ASSERT_UNUSED(result, result.isNewEntry);
-
-        return connection;
-    }).iterator->value;
-}
-#endif
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx"> WebSWClientConnection& WebToStorageProcessConnection::serviceWorkerConnectionForSession(SessionID sessionID)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageWebToStorageProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.h (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.h   2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.h      2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include "Connection.h"
</span><span class="cx"> #include "MessageSender.h"
</span><del>-#include "WebIDBConnectionToServer.h"
</del><span class="cx"> #include "WebSWClientConnection.h"
</span><span class="cx"> #include <WebCore/SWServer.h>
</span><span class="cx"> #include <pal/SessionID.h>
</span><span class="lines">@@ -50,10 +49,6 @@
</span><span class="cx">     
</span><span class="cx">     IPC::Connection& connection() { return m_connection.get(); }
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    WebIDBConnectionToServer* existingIDBConnectionToServerForIdentifier(uint64_t identifier) { return m_webIDBConnectionsByIdentifier.get(identifier); };
-    WebIDBConnectionToServer& idbConnectionToServerForSession(PAL::SessionID);
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     WebSWClientConnection* existingServiceWorkerConnectionForSession(PAL::SessionID sessionID) { return m_swConnectionsBySession.get(sessionID); }
</span><span class="cx">     WebSWClientConnection& serviceWorkerConnectionForSession(PAL::SessionID);
</span><span class="lines">@@ -74,11 +69,6 @@
</span><span class="cx"> 
</span><span class="cx">     Ref<IPC::Connection> m_connection;
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    HashMap<PAL::SessionID, RefPtr<WebIDBConnectionToServer>> m_webIDBConnectionsBySession;
-    HashMap<uint64_t, RefPtr<WebIDBConnectionToServer>> m_webIDBConnectionsByIdentifier;
-#endif
-
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     HashMap<PAL::SessionID, RefPtr<WebSWClientConnection>> m_swConnectionsBySession;
</span><span class="cx">     HashMap<WebCore::SWServerConnectionIdentifier, WebSWClientConnection*> m_swConnectionsByIdentifier;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebProcess.cpp    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -1180,6 +1180,19 @@
</span><span class="cx">     ASSERT(m_networkProcessConnection);
</span><span class="cx">     ASSERT_UNUSED(connection, m_networkProcessConnection == connection);
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    for (auto& page : m_pageMap.values()) {
+        auto idbConnection = page->corePage()->optionalIDBConnection();
+        if (!idbConnection)
+            continue;
+        
+        if (connection->existingIDBConnectionToServerForIdentifier(idbConnection->identifier())) {
+            ASSERT(idbConnection == &connection->existingIDBConnectionToServerForIdentifier(idbConnection->identifier())->coreConnectionToServer());
+            page->corePage()->clearIDBConnection();
+        }
+    }
+#endif
+
</ins><span class="cx">     m_networkProcessConnection = nullptr;
</span><span class="cx"> 
</span><span class="cx">     logDiagnosticMessageForNetworkProcessCrash();
</span><span class="lines">@@ -1201,18 +1214,6 @@
</span><span class="cx">     ASSERT(m_webToStorageProcessConnection);
</span><span class="cx">     ASSERT(m_webToStorageProcessConnection == connection);
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-    for (auto& page : m_pageMap.values()) {
-        auto idbConnection = page->corePage()->optionalIDBConnection();
-        if (!idbConnection)
-            continue;
-
-        if (connection->existingIDBConnectionToServerForIdentifier(idbConnection->identifier())) {
-            ASSERT(idbConnection == &connection->existingIDBConnectionToServerForIdentifier(idbConnection->identifier())->coreConnectionToServer());
-            page->corePage()->clearIDBConnection();
-        }
-    }
-#endif
</del><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     if (SWContextManager::singleton().connection()) {
</span><span class="cx">         RELEASE_LOG(ServiceWorker, "Service worker process is exiting because its storage process is gone");
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Tools/ChangeLog       2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2018-09-17  Sihui Liu  <sihui_liu@apple.com>
+
+        Move IndexedDB to Network Process
+        https://bugs.webkit.org/show_bug.cgi?id=189415
+        <rdar://problem/44396973>
+
+        Reviewed by Chris Dumez.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
+        (TEST):
+
</ins><span class="cx"> 2018-09-08  Darin Adler  <darin@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaIDBDeleteRecoverymm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm 2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBDeleteRecovery.mm    2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
</span><span class="cx">     [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"testHandler"];
</span><span class="cx"> 
</span><del>-    [configuration.get().processPool _terminateStorageProcess];
</del><ins>+    [configuration.get().processPool _terminateNetworkProcess];
</ins><span class="cx"> 
</span><span class="cx">     // Copy the inconsistent database files to the database directory
</span><span class="cx">     NSURL *url1 = [[NSBundle mainBundle] URLForResource:@"IDBDeleteRecovery" withExtension:@"sqlite3" subdirectory:@"TestWebKitAPI.resources"];
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaIDBIndexUpgradeToV2mm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm       2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IDBIndexUpgradeToV2.mm  2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
</span><span class="cx">     [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"testHandler"];
</span><span class="cx"> 
</span><del>-    [configuration.get().processPool _terminateStorageProcess];
</del><ins>+    [configuration.get().processPool _terminateNetworkProcess];
</ins><span class="cx"> 
</span><span class="cx">     // Copy the inconsistent database files to the database directory
</span><span class="cx">     NSURL *url1 = [[NSBundle mainBundle] URLForResource:@"IndexUpgrade" withExtension:@"sqlite3" subdirectory:@"TestWebKitAPI.resources"];
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaIndexedDBDatabaseProcessKillmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBDatabaseProcessKill.mm 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">         TestWebKitAPI::Util::run(&receivedScriptMessage);
</span><span class="cx">         if (!killedDBProcess && openRequestUpgradeNeeded) {
</span><span class="cx">             killedDBProcess = true;
</span><del>-            [configuration.get().processPool _terminateStorageProcess];
</del><ins>+            [configuration.get().processPool _terminateNetworkProcess];
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaIndexedDBMultiProcessmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm     2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBMultiProcess.mm        2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
</span><span class="cx">     [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"testHandler"];
</span><span class="cx"> 
</span><del>-    [configuration.get().processPool _terminateStorageProcess];
</del><ins>+    [configuration.get().processPool _terminateNetworkProcess];
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaIndexedDBPersistencemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm (236034 => 236035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm      2018-09-17 00:35:31 UTC (rev 236034)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm 2018-09-17 07:11:55 UTC (rev 236035)
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx">     // Ditch this web view (ditching its web process)
</span><span class="cx">     webView = nil;
</span><span class="cx"> 
</span><del>-    // Terminate the storage process
-    [configuration.get().processPool _terminateStorageProcess];
</del><ins>+    // Terminate the network process
+    [configuration.get().processPool _terminateNetworkProcess];
</ins><span class="cx"> 
</span><span class="cx">     // Make a new web view to finish the test
</span><span class="cx">     webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
</span></span></pre>
</div>
</div>

</body>
</html>