<!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>[199043] trunk/Source</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/199043">199043</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-04-04 22:47:32 -0700 (Mon, 04 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB: Dump blobs to disk before storing them in an object store.
https://bugs.webkit.org/show_bug.cgi?id=156068
Source/WebCore:
Reviewed by Alex Christensen.
No new tests (Under development, no observable change in behavior yet).
* WebCore.xcodeproj/project.pbxproj:
* CMakeLists.txt:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):
* Modules/indexeddb/IDBValue.cpp: Copied from Source/WebCore/platform/ScopeGuard.h.
(WebCore::IDBValue::IDBValue):
* Modules/indexeddb/IDBValue.h: Copied from Source/WebCore/platform/ScopeGuard.h.
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/TransactionOperation.h:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
(WebCore::SerializedScriptValue::addBlobURL): Deleted.
* bindings/js/SerializedScriptValue.h:
* platform/FileSystem.cpp:
(WebCore::appendFileContentsToFileHandle):
* platform/FileSystem.h:
* platform/ScopeGuard.h:
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::blobUtilityQueue):
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
* platform/network/BlobRegistryImpl.h:
Source/WebKit2:
Reviewed by Alex Christensen.
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
* WebProcess/FileAPI/BlobRegistryProxy.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
(WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientTransactionOperationh">trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValueh">trunk/Source/WebCore/bindings/js/SerializedScriptValue.h</a></li>
<li><a href="#trunkSourceWebCoreplatformFileSystemcpp">trunk/Source/WebCore/platform/FileSystem.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformFileSystemh">trunk/Source/WebCore/platform/FileSystem.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScopeGuardh">trunk/Source/WebCore/platform/ScopeGuard.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryh">trunk/Source/WebCore/platform/network/BlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp">trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplh">trunk/Source/WebCore/platform/network/BlobRegistryImpl.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessmessagesin">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxycpp">trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxyh">trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectioncpp">trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectionh">trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectionmessagesin">trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.messages.in</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBValuecpp">trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBValueh">trunk/Source/WebCore/Modules/indexeddb/IDBValue.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -850,6 +850,7 @@
</span><span class="cx"> Modules/indexeddb/IDBRequest.cpp
</span><span class="cx"> Modules/indexeddb/IDBRequestCompletionEvent.cpp
</span><span class="cx"> Modules/indexeddb/IDBTransaction.cpp
</span><ins>+ Modules/indexeddb/IDBValue.cpp
</ins><span class="cx"> Modules/indexeddb/IDBVersionChangeEvent.cpp
</span><span class="cx"> Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/ChangeLog        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-04-04 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Dump blobs to disk before storing them in an object store.
+ https://bugs.webkit.org/show_bug.cgi?id=156068
+
+ Reviewed by Alex Christensen.
+
+ No new tests (Under development, no observable change in behavior yet).
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * CMakeLists.txt:
+
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::putOrAddOnServer):
+
+ * Modules/indexeddb/IDBValue.cpp: Copied from Source/WebCore/platform/ScopeGuard.h.
+ (WebCore::IDBValue::IDBValue):
+ * Modules/indexeddb/IDBValue.h: Copied from Source/WebCore/platform/ScopeGuard.h.
+
+ * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+ (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
+ * Modules/indexeddb/client/IDBConnectionToServer.h:
+
+ * Modules/indexeddb/client/TransactionOperation.h:
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::SerializedScriptValue::SerializedScriptValue):
+ (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
+ (WebCore::SerializedScriptValue::addBlobURL): Deleted.
+ * bindings/js/SerializedScriptValue.h:
+
+ * platform/FileSystem.cpp:
+ (WebCore::appendFileContentsToFileHandle):
+ * platform/FileSystem.h:
+
+ * platform/ScopeGuard.h:
+
+ * platform/network/BlobRegistry.h:
+ * platform/network/BlobRegistryImpl.cpp:
+ (WebCore::blobUtilityQueue):
+ (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
+ * platform/network/BlobRegistryImpl.h:
+
</ins><span class="cx"> 2016-04-04 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Crash when playing <video> after playing Web Audio
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -867,8 +867,14 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::putOrAddOnServer");
</span><span class="cx">
</span><span class="cx"> ASSERT(!isReadOnly());
</span><ins>+ ASSERT(value);
</ins><span class="cx">
</span><del>- serverConnection().putOrAdd(operation, key, value, overwriteMode);
</del><ins>+ RefPtr<IDBTransaction> protector(this);
+ RefPtr<IDBClient::TransactionOperation> operationRef(&operation);
+ value->writeBlobsToDiskForIndexedDB([protector, this, operationRef, key, value, overwriteMode](const IDBValue&) {
+ // FIXME: Send the passed in IDBValue to the IDB server instead of the SerializedScriptValue.
+ serverConnection().putOrAdd(*operationRef, key.get(), *value, overwriteMode);
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::didPutOrAddOnServer(IDBRequest& request, const IDBResultData& resultData)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBValuecppfromrev199042trunkSourceWebCoreplatformScopeGuardh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp (from rev 199042, trunk/Source/WebCore/platform/ScopeGuard.h) (0 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp         (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -0,0 +1,39 @@
</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 "IDBValue.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+IDBValue::IDBValue()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBValuehfromrev199042trunkSourceWebCoreplatformScopeGuardh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/indexeddb/IDBValue.h (from rev 199042, trunk/Source/WebCore/platform/ScopeGuard.h) (0 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.h         (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -0,0 +1,38 @@
</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)
+
+namespace WebCore {
+
+class IDBValue {
+public:
+ IDBValue();
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -171,12 +171,12 @@
</span><span class="cx"> completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBConnectionToServer::putOrAdd(TransactionOperation& operation, RefPtr<IDBKey>& key, RefPtr<SerializedScriptValue>& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void IDBConnectionToServer::putOrAdd(TransactionOperation& operation, IDBKey* key, SerializedScriptValue& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBConnectionToServer::putOrAdd");
</span><span class="cx">
</span><span class="cx"> saveOperation(operation);
</span><del>- m_delegate->putOrAdd(IDBRequestData(operation), key.get(), *value, overwriteMode);
</del><ins>+ m_delegate->putOrAdd(IDBRequestData(operation), key, value, overwriteMode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBConnectionToServer::didPutOrAdd(const IDBResultData& resultData)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> void deleteIndex(TransactionOperation&, uint64_t objectStoreIdentifier, const String& indexName);
</span><span class="cx"> WEBCORE_EXPORT void didDeleteIndex(const IDBResultData&);
</span><span class="cx">
</span><del>- void putOrAdd(TransactionOperation&, RefPtr<IDBKey>&, RefPtr<SerializedScriptValue>&, const IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+ void putOrAdd(TransactionOperation&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx"> WEBCORE_EXPORT void didPutOrAdd(const IDBResultData&);
</span><span class="cx">
</span><span class="cx"> void getRecord(TransactionOperation&, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientTransactionOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">
</span><span class="cx"> namespace IDBClient {
</span><span class="cx">
</span><del>-class TransactionOperation : public RefCounted<TransactionOperation> {
</del><ins>+class TransactionOperation : public ThreadSafeRefCounted<TransactionOperation> {
</ins><span class="cx"> public:
</span><span class="cx"> void perform()
</span><span class="cx"> {
</span><span class="lines">@@ -92,7 +92,6 @@
</span><span class="cx"> TransactionOperationImpl(IDBTransaction& transaction, void (IDBTransaction::*completeMethod)(const IDBResultData&), void (IDBTransaction::*performMethod)(TransactionOperation&, Arguments...), Arguments&&... arguments)
</span><span class="cx"> : TransactionOperation(transaction)
</span><span class="cx"> {
</span><del>- relaxAdoptionRequirement();
</del><span class="cx"> RefPtr<TransactionOperation> self(this);
</span><span class="cx">
</span><span class="cx"> ASSERT(performMethod);
</span><span class="lines">@@ -111,7 +110,6 @@
</span><span class="cx"> TransactionOperationImpl(IDBTransaction& transaction, IDBRequest& request, void (IDBTransaction::*completeMethod)(IDBRequest&, const IDBResultData&), void (IDBTransaction::*performMethod)(TransactionOperation&, Arguments...), Arguments&&... arguments)
</span><span class="cx"> : TransactionOperation(transaction, request)
</span><span class="cx"> {
</span><del>- relaxAdoptionRequirement();
</del><span class="cx"> RefPtr<TransactionOperation> self(this);
</span><span class="cx">
</span><span class="cx"> ASSERT(performMethod);
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -2045,6 +2045,8 @@
</span><span class="cx">                 5160712F1BD8307800DBC4F2 /* IDBObjectStoreInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712D1BD8307200DBC4F2 /* IDBObjectStoreInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 516071321BD8308B00DBC4F2 /* TransactionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712B1BD8305300DBC4F2 /* TransactionOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
</span><ins>+                516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 516103AE1CADB9A30016B4C7 /* IDBValue.h */; };
+                516103B01CADBA7A0016B4C7 /* IDBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516103AD1CADB9A30016B4C7 /* IDBValue.cpp */; };
</ins><span class="cx">                 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; };
</span><span class="cx">                 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 516953971329A3C800B92D04 /* IconDatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516953951329A3C800B92D04 /* IconDatabaseBase.cpp */; };
</span><span class="lines">@@ -9595,6 +9597,8 @@
</span><span class="cx">                 5160712C1BD8307200DBC4F2 /* IDBObjectStoreInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStoreInfo.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5160712D1BD8307200DBC4F2 /* IDBObjectStoreInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStoreInfo.h; sourceTree = "<group>"; };
</span><span class="cx">                 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HistoryItemMac.mm; sourceTree = "<group>"; };
</span><ins>+                516103AD1CADB9A30016B4C7 /* IDBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBValue.cpp; sourceTree = "<group>"; };
+                516103AE1CADB9A30016B4C7 /* IDBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBValue.h; sourceTree = "<group>"; };
</ins><span class="cx">                 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SchemeRegistry.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeRegistry.h; sourceTree = "<group>"; };
</span><span class="cx">                 51645B411B9F889B00F789CE /* IDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursor.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -19586,6 +19590,8 @@
</span><span class="cx">                                 51645B501B9F889B00F789CE /* IDBTransaction.cpp */,
</span><span class="cx">                                 51645B511B9F889B00F789CE /* IDBTransaction.h */,
</span><span class="cx">                                 51D719A6181106E00016DC51 /* IDBTransaction.idl */,
</span><ins>+                                516103AD1CADB9A30016B4C7 /* IDBValue.cpp */,
+                                516103AE1CADB9A30016B4C7 /* IDBValue.h */,
</ins><span class="cx">                                 51645B521B9F889B00F789CE /* IDBVersionChangeEvent.cpp */,
</span><span class="cx">                                 51645B531B9F889B00F789CE /* IDBVersionChangeEvent.h */,
</span><span class="cx">                                 51D719AD181106E00016DC51 /* IDBVersionChangeEvent.idl */,
</span><span class="lines">@@ -25992,6 +25998,7 @@
</span><span class="cx">                                 976D6C89122B8A3D001FD1F7 /* FileReader.h in Headers */,
</span><span class="cx">                                 2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */,
</span><span class="cx">                                 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */,
</span><ins>+                                516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */,
</ins><span class="cx">                                 2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */,
</span><span class="cx">                                 2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */,
</span><span class="cx">                                 2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */,
</span><span class="lines">@@ -31786,6 +31793,7 @@
</span><span class="cx">                                 376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */,
</span><span class="cx">                                 B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */,
</span><span class="cx">                                 9759E93F14EF1CF80026A2DD /* TextTrack.cpp in Sources */,
</span><ins>+                                516103B01CADBA7A0016B4C7 /* IDBValue.cpp in Sources */,
</ins><span class="cx">                                 9759E94214EF1CF80026A2DD /* TextTrackCue.cpp in Sources */,
</span><span class="cx">                                 071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */,
</span><span class="cx">                                 9759E94514EF1CF80026A2DD /* TextTrackCueList.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "SerializedScriptValue.h"
</span><span class="cx">
</span><span class="cx"> #include "Blob.h"
</span><ins>+#include "BlobRegistry.h"
</ins><span class="cx"> #include "CryptoKeyAES.h"
</span><span class="cx"> #include "CryptoKeyDataOctetSequence.h"
</span><span class="cx"> #include "CryptoKeyDataRSAComponents.h"
</span><span class="lines">@@ -36,6 +37,7 @@
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "File.h"
</span><span class="cx"> #include "FileList.h"
</span><ins>+#include "IDBValue.h"
</ins><span class="cx"> #include "ImageData.h"
</span><span class="cx"> #include "JSBlob.h"
</span><span class="cx"> #include "JSCryptoKey.h"
</span><span class="lines">@@ -75,6 +77,7 @@
</span><span class="cx"> #include <runtime/TypedArrayInlines.h>
</span><span class="cx"> #include <runtime/TypedArrays.h>
</span><span class="cx"> #include <wtf/HashTraits.h>
</span><ins>+#include <wtf/MainThread.h>
</ins><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -2582,15 +2585,6 @@
</span><span class="cx"> return std::make_pair(JSValue(), ValidationError);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SerializedScriptValue::addBlobURL(const String& string)
-{
- m_blobURLs.append(Vector<uint16_t>());
- m_blobURLs.last().reserveCapacity(string.length());
- for (size_t i = 0; i < string.length(); i++)
- m_blobURLs.last().append(string.characterAt(i));
- m_blobURLs.last().resize(m_blobURLs.last().size());
-}
-
</del><span class="cx"> SerializedScriptValue::~SerializedScriptValue()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -2600,19 +2594,15 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SerializedScriptValue::SerializedScriptValue(Vector<uint8_t>&& buffer, const Vector<String>& blobURLs)
- : m_data(WTFMove(buffer))
-{
- for (auto& string : blobURLs)
- addBlobURL(string);
-}
-
</del><span class="cx"> SerializedScriptValue::SerializedScriptValue(Vector<uint8_t>&& buffer, const Vector<String>& blobURLs, std::unique_ptr<ArrayBufferContentsArray>&& arrayBufferContentsArray)
</span><span class="cx"> : m_data(WTFMove(buffer))
</span><span class="cx"> , m_arrayBufferContentsArray(WTFMove(arrayBufferContentsArray))
</span><span class="cx"> {
</span><del>- for (auto& string : blobURLs)
- addBlobURL(string);
</del><ins>+ // Since this SerializedScriptValue is meant to be passed between threads, its String data members
+ // need to be isolatedCopies so we don't run into thread safety issues for the StringImpls.
+ m_blobURLs.reserveInitialCapacity(blobURLs.size());
+ for (auto& url : blobURLs)
+ m_blobURLs.append(url.isolatedCopy());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<SerializedScriptValue::ArrayBufferContentsArray> SerializedScriptValue::transferArrayBuffers(
</span><span class="lines">@@ -2757,4 +2747,20 @@
</span><span class="cx"> return CurrentVersion;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void SerializedScriptValue::writeBlobsToDiskForIndexedDB(std::function<void (const IDBValue&)> completionHandler)
+{
+ ASSERT(isMainThread());
+
+ if (m_blobURLs.isEmpty()) {
+ completionHandler({ });
+ return;
+ }
+
+ RefPtr<SerializedScriptValue> protector(this);
+ blobRegistry().writeBlobsToTemporaryFiles(m_blobURLs, [completionHandler, this, protector](const Vector<String>&) {
+ // FIXME: Return an IDBValue that contains both the SerializedScriptValue data and all blob file data.
+ completionHandler({ });
+ });
</ins><span class="cx"> }
</span><ins>+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class IDBValue;
</ins><span class="cx"> class MessagePort;
</span><span class="cx"> typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray;
</span><span class="cx"> typedef Vector<RefPtr<JSC::ArrayBuffer>, 1> ArrayBufferArray;
</span><span class="lines">@@ -83,7 +84,7 @@
</span><span class="cx">
</span><span class="cx"> const Vector<uint8_t>& data() const { return m_data; }
</span><span class="cx"> bool hasBlobURLs() const { return !m_blobURLs.isEmpty(); }
</span><del>- void blobURLs(Vector<String>&) const;
</del><ins>+ void writeBlobsToDiskForIndexedDB(std::function<void (const IDBValue&)> completionHandler);
</ins><span class="cx">
</span><span class="cx"> static Ref<SerializedScriptValue> createFromWireBytes(Vector<uint8_t>&& data)
</span><span class="cx"> {
</span><span class="lines">@@ -98,15 +99,14 @@
</span><span class="cx"> static void maybeThrowExceptionIfSerializationFailed(JSC::ExecState*, SerializationReturnCode);
</span><span class="cx"> static bool serializationDidCompleteSuccessfully(SerializationReturnCode);
</span><span class="cx"> static std::unique_ptr<ArrayBufferContentsArray> transferArrayBuffers(JSC::ExecState*, ArrayBufferArray&, SerializationReturnCode&);
</span><del>- void addBlobURL(const String&);
</del><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT SerializedScriptValue(Vector<unsigned char>&&);
</span><del>- SerializedScriptValue(Vector<unsigned char>&&, const Vector<String>& blobURLs);
</del><span class="cx"> SerializedScriptValue(Vector<unsigned char>&&, const Vector<String>& blobURLs, std::unique_ptr<ArrayBufferContentsArray>&&);
</span><span class="cx">
</span><span class="cx"> Vector<unsigned char> m_data;
</span><span class="cx"> std::unique_ptr<ArrayBufferContentsArray> m_arrayBufferContentsArray;
</span><del>- Vector<Vector<uint16_t>> m_blobURLs;
</del><ins>+
+ Vector<String> m_blobURLs;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileSystemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileSystem.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileSystem.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/platform/FileSystem.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "FileSystem.h"
</span><span class="cx">
</span><ins>+#include "ScopeGuard.h"
</ins><span class="cx"> #include <wtf/HexNumber.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="lines">@@ -129,6 +130,37 @@
</span><span class="cx"> return result.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool appendFileContentsToFileHandle(const String& path, PlatformFileHandle& target)
+{
+ auto source = openFile(path, OpenForRead);
+
+ if (!isHandleValid(source))
+ return false;
+
+ static int bufferSize = 1 << 19;
+ Vector<char> buffer(bufferSize);
+
+ ScopeGuard fileCloser([source]() {
+ PlatformFileHandle handle = source;
+ closeFile(handle);
+ });
+
+ do {
+ int readBytes = readFromFile(source, buffer.data(), bufferSize);
+
+ if (readBytes < 0)
+ return false;
+
+ if (writeToFile(target, buffer.data(), readBytes) != readBytes)
+ return false;
+
+ if (readBytes < bufferSize)
+ return true;
+ } while (true);
+
+ ASSERT_NOT_REACHED();
+}
+
</ins><span class="cx"> #if !PLATFORM(MAC)
</span><span class="cx">
</span><span class="cx"> void setMetadataURL(String&, const String&, const String&)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileSystemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileSystem.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileSystem.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/platform/FileSystem.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -176,6 +176,11 @@
</span><span class="cx"> WEBCORE_EXPORT int writeToFile(PlatformFileHandle, const char* data, int length);
</span><span class="cx"> // Returns number of bytes actually written if successful, -1 otherwise.
</span><span class="cx"> int readFromFile(PlatformFileHandle, char* data, int length);
</span><ins>+
+// Appends the contents of the file found at 'path' to the open PlatformFileHandle.
+// Returns true if the write was successful, false if it was not.
+bool appendFileContentsToFileHandle(const String& path, PlatformFileHandle&);
+
</ins><span class="cx"> #if USE(FILE_LOCK)
</span><span class="cx"> bool lockFile(PlatformFileHandle, FileLockMode);
</span><span class="cx"> bool unlockFile(PlatformFileHandle);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScopeGuardh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScopeGuard.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScopeGuard.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/platform/ScopeGuard.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> #ifndef ScopeGuard_h
</span><span class="cx"> #define ScopeGuard_h
</span><span class="cx">
</span><ins>+#include <functional>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class ScopeGuard {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #ifndef BlobRegistry_h
</span><span class="cx"> #define BlobRegistry_h
</span><span class="cx">
</span><ins>+#include <functional>
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="lines">@@ -63,6 +64,8 @@
</span><span class="cx">
</span><span class="cx"> virtual unsigned long long blobSize(const URL&) = 0;
</span><span class="cx">
</span><ins>+ virtual void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void (const Vector<String>& filePaths)> completionHandler) = 0;
+
</ins><span class="cx"> virtual bool isBlobRegistryImpl() const { return false; }
</span><span class="cx">
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -41,8 +41,11 @@
</span><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "ResourceRequest.h"
</span><span class="cx"> #include "ResourceResponse.h"
</span><ins>+#include "ScopeGuard.h"
</ins><span class="cx"> #include <wtf/MainThread.h>
</span><ins>+#include <wtf/NeverDestroyed.h>
</ins><span class="cx"> #include <wtf/StdLibExtras.h>
</span><ins>+#include <wtf/WorkQueue.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -228,4 +231,90 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static WorkQueue& blobUtilityQueue()
+{
+ static NeverDestroyed<Ref<WorkQueue>> queue(WorkQueue::create("org.webkit.BlobUtility", WorkQueue::Type::Serial, WorkQueue::QOS::Background));
+ return queue.get();
+}
+
+struct BlobForFileWriting {
+ String blobURL;
+ Vector<std::pair<String, ThreadSafeDataBuffer>> filePathsOrDataBuffers;
+};
+
+void BlobRegistryImpl::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void (const Vector<String>& filePaths)> completionHandler)
+{
+ Vector<BlobForFileWriting> blobsForWriting;
+ for (auto& url : blobURLs) {
+ blobsForWriting.append({ });
+ blobsForWriting.last().blobURL = url.isolatedCopy();
+
+ auto* blobData = getBlobDataFromURL({ ParsedURLString, url });
+ if (!blobData) {
+ Vector<String> filePaths;
+ completionHandler(filePaths);
+ }
+
+ for (auto& item : blobData->items()) {
+ switch (item.type()) {
+ case BlobDataItem::Type::Data:
+ blobsForWriting.last().filePathsOrDataBuffers.append({ { }, item.data() });
+ break;
+ case BlobDataItem::Type::File:
+ blobsForWriting.last().filePathsOrDataBuffers.append({ item.file()->path().isolatedCopy(), { } });
+
+ }
+ }
+ }
+
+ blobUtilityQueue().dispatch([blobsForWriting, completionHandler]() {
+ Vector<String> filePaths;
+
+ ScopeGuard completionCaller([completionHandler]() {
+ callOnMainThread([completionHandler]() {
+ Vector<String> filePaths;
+ completionHandler(filePaths);
+ });
+ });
+
+ for (auto& blob : blobsForWriting) {
+ PlatformFileHandle file;
+ String tempFilePath = openTemporaryFile(ASCIILiteral("Blob"), file);
+
+ ScopeGuard fileCloser([file, completionHandler]() {
+ PlatformFileHandle handle = file;
+ closeFile(handle);
+ });
+
+ if (tempFilePath.isEmpty() || !isHandleValid(file)) {
+ LOG_ERROR("Failed to open temporary file for writing a Blob to IndexedDB");
+ return;
+ }
+
+ for (auto& part : blob.filePathsOrDataBuffers) {
+ if (part.second.data()) {
+ int length = part.second.data()->size();
+ if (writeToFile(file, reinterpret_cast<const char*>(part.second.data()->data()), length) != length) {
+ LOG_ERROR("Failed writing a Blob to temporary file for storage in IndexedDB");
+ return;
+ }
+ } else {
+ ASSERT(!part.first.isEmpty());
+ if (!appendFileContentsToFileHandle(part.first, file)) {
+ LOG_ERROR("Failed copying File contents to a Blob temporary file for storage in IndexedDB");
+ return;
+ }
+ }
+ }
+
+ filePaths.append(tempFilePath.isolatedCopy());
+ }
+
+ completionCaller.disable();
+ callOnMainThread([completionHandler, filePaths]() {
+ completionHandler(filePaths);
+ });
+ });
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -67,6 +67,8 @@
</span><span class="cx">
</span><span class="cx"> unsigned long long blobSize(const URL&) override;
</span><span class="cx">
</span><ins>+ void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void (const Vector<String>& filePaths)> completionHandler) override;
+
</ins><span class="cx"> HashMap<String, RefPtr<BlobData>> m_blobs;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-04-04 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Dump blobs to disk before storing them in an object store.
+ https://bugs.webkit.org/show_bug.cgi?id=156068
+
+ Reviewed by Alex Christensen.
+
+ * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+ (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
+ * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
+ * NetworkProcess/NetworkConnectionToWebProcess.h:
+ * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+
+ * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+ (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
+ * WebProcess/FileAPI/BlobRegistryProxy.h:
+
+ * WebProcess/Network/NetworkProcessConnection.cpp:
+ (WebKit::NetworkProcessConnection::didClose):
+ (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
+ (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles):
+ * WebProcess/Network/NetworkProcessConnection.h:
+ * WebProcess/Network/NetworkProcessConnection.messages.in:
+
</ins><span class="cx"> 2016-04-04 Chelsea Pugh <cpugh@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Allow clients in the bundle to know whether a field was focused by user interaction
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -117,6 +117,11 @@
</span><span class="cx"> return blobRegistry().blobSize(url);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void NetworkBlobRegistry::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void(const Vector<String>&)> completionHandler)
+{
+ blobRegistry().writeBlobsToTemporaryFiles(blobURLs, completionHandler);
+}
+
</ins><span class="cx"> void NetworkBlobRegistry::connectionToWebProcessDidClose(NetworkConnectionToWebProcess* connection)
</span><span class="cx"> {
</span><span class="cx"> if (!m_blobsForConnection.contains(connection))
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define NetworkBlobRegistry_h
</span><span class="cx">
</span><span class="cx"> #include <WebCore/URLHash.h>
</span><ins>+#include <functional>
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="cx">
</span><span class="lines">@@ -52,6 +53,7 @@
</span><span class="cx"> void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
</span><span class="cx"> void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&);
</span><span class="cx"> uint64_t blobSize(NetworkConnectionToWebProcess*, const WebCore::URL&);
</span><ins>+ void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void(const Vector<String>&)> completionHandler);
</ins><span class="cx">
</span><span class="cx"> void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -30,11 +30,13 @@
</span><span class="cx"> #include "NetworkConnectionToWebProcessMessages.h"
</span><span class="cx"> #include "NetworkLoad.h"
</span><span class="cx"> #include "NetworkProcess.h"
</span><ins>+#include "NetworkProcessConnectionMessages.h"
</ins><span class="cx"> #include "NetworkResourceLoadParameters.h"
</span><span class="cx"> #include "NetworkResourceLoader.h"
</span><span class="cx"> #include "NetworkResourceLoaderMessages.h"
</span><span class="cx"> #include "RemoteNetworkingContext.h"
</span><span class="cx"> #include "SessionTracker.h"
</span><ins>+#include "WebCoreArgumentCoders.h"
</ins><span class="cx"> #include <WebCore/NotImplemented.h>
</span><span class="cx"> #include <WebCore/PingHandle.h>
</span><span class="cx"> #include <WebCore/PlatformCookieJar.h>
</span><span class="lines">@@ -279,6 +281,28 @@
</span><span class="cx"> resultSize = NetworkBlobRegistry::singleton().blobSize(this, url);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, uint64_t requestIdentifier)
+{
+ RefPtr<NetworkConnectionToWebProcess> protector(this);
+
+ Vector<RefPtr<WebCore::BlobDataFileReference>> fileReferences;
+ for (auto& url : blobURLs)
+ fileReferences.appendVector(NetworkBlobRegistry::singleton().filesInBlob(*this, { ParsedURLString, url }));
+
+ for (auto& file : fileReferences)
+ file->prepareForFileAccess();
+
+ NetworkBlobRegistry::singleton().writeBlobsToTemporaryFiles(blobURLs, [this, protector, requestIdentifier, fileReferences](const Vector<String>& fileNames) {
+ for (auto& file : fileReferences)
+ file->revokeFileAccess();
+
+ if (!m_connection || !m_connection->isValid())
+ return;
+
+ m_connection->send(Messages::NetworkProcessConnection::DidWriteBlobsToTemporaryFiles(requestIdentifier, fileNames), 0);
+ });
+}
+
</ins><span class="cx"> void NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession()
</span><span class="cx"> {
</span><span class="cx"> NetworkProcess::singleton().ensurePrivateBrowsingSession(SessionID::legacyPrivateSessionID());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -93,6 +93,8 @@
</span><span class="cx"> void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
</span><span class="cx"> void blobSize(const WebCore::URL&, uint64_t& resultSize);
</span><span class="cx"> void unregisterBlobURL(const WebCore::URL&);
</span><ins>+ void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, uint64_t requestIdentifier);
+
</ins><span class="cx"> void ensureLegacyPrivateBrowsingSession();
</span><span class="cx">
</span><span class="cx"> RefPtr<IPC::Connection> m_connection;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -45,5 +45,7 @@
</span><span class="cx"> RegisterBlobURLForSlice(WebCore::URL url, WebCore::URL srcURL, int64_t start, int64_t end)
</span><span class="cx"> UnregisterBlobURL(WebCore::URL url)
</span><span class="cx"> BlobSize(WebCore::URL url) -> (uint64_t resultSize)
</span><ins>+ WriteBlobsToTemporaryFiles(Vector<String> blobURLs, uint64_t requestIdentifier)
+
</ins><span class="cx"> EnsureLegacyPrivateBrowsingSession()
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -75,4 +75,9 @@
</span><span class="cx"> return resultSize;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void (const Vector<String>& filePaths)> completionHandler)
+{
+ WebProcess::singleton().networkConnection()->writeBlobsToTemporaryFiles(blobURLs, completionHandler);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> void unregisterBlobURL(const WebCore::URL&) override;
</span><span class="cx"> void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, long long start, long long end) override;
</span><span class="cx"> unsigned long long blobSize(const WebCore::URL&) override;
</span><ins>+ void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void (const Vector<String>& filePaths)> completionHandler) override;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -72,12 +72,35 @@
</span><span class="cx"> {
</span><span class="cx"> // The NetworkProcess probably crashed.
</span><span class="cx"> WebProcess::singleton().networkProcessConnectionClosed(this);
</span><ins>+
+ Vector<String> dummyFilenames;
+ for (auto handler : m_writeBlobToFileCompletionHandlers.values())
+ handler(dummyFilenames);
+
+ m_writeBlobToFileCompletionHandlers.clear();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NetworkProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference, IPC::StringReference)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void NetworkProcessConnection::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void (const Vector<String>& filePaths)> completionHandler)
+{
+ static uint64_t writeBlobToFileIdentifier;
+ uint64_t requestIdentifier = ++writeBlobToFileIdentifier;
+
+ m_writeBlobToFileCompletionHandlers.set(requestIdentifier, completionHandler);
+
+ WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs, requestIdentifier), 0);
+}
+
+void NetworkProcessConnection::didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames)
+{
+ auto handler = m_writeBlobToFileCompletionHandlers.take(requestIdentifier);
+ if (handler)
+ handler(filenames);
+}
+
</ins><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="cx"> void NetworkProcessConnection::didCacheResource(const ResourceRequest& request, const ShareableResource::Handle& handle, SessionID sessionID)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -58,6 +58,8 @@
</span><span class="cx">
</span><span class="cx"> void didReceiveNetworkProcessConnectionMessage(IPC::Connection&, IPC::MessageDecoder&);
</span><span class="cx">
</span><ins>+ void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, std::function<void (const Vector<String>& filePaths)> completionHandler);
+
</ins><span class="cx"> private:
</span><span class="cx"> NetworkProcessConnection(IPC::Connection::Identifier);
</span><span class="cx">
</span><span class="lines">@@ -69,6 +71,8 @@
</span><span class="cx"> IPC::ProcessType localProcessType() override { return IPC::ProcessType::Web; }
</span><span class="cx"> IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Network; }
</span><span class="cx">
</span><ins>+ void didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames);
+
</ins><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="cx"> // Message handlers.
</span><span class="cx"> void didCacheResource(const WebCore::ResourceRequest&, const ShareableResource::Handle&, WebCore::SessionID);
</span><span class="lines">@@ -76,6 +80,8 @@
</span><span class="cx">
</span><span class="cx"> // The connection from the web process to the network process.
</span><span class="cx"> RefPtr<IPC::Connection> m_connection;
</span><ins>+
+ HashMap<uint64_t, std::function<void (const Vector<String>&)>> m_writeBlobToFileCompletionHandlers;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectionmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.messages.in (199042 => 199043)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.messages.in        2016-04-05 05:39:18 UTC (rev 199042)
+++ trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.messages.in        2016-04-05 05:47:32 UTC (rev 199043)
</span><span class="lines">@@ -26,4 +26,5 @@
</span><span class="cx"> DidCacheResource(WebCore::ResourceRequest request, WebKit::ShareableResource::Handle resource, WebCore::SessionID sessionID)
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ DidWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, Vector<String> filenames)
</ins><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>