<!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>[168333] 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/168333">168333</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2014-05-05 17:42:52 -0700 (Mon, 05 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Stop using BlobData on client side
https://bugs.webkit.org/show_bug.cgi?id=132582

Reviewed by Sam Weinig.


Source/WebCore: 
Blob registration now uses either a single file path, or a vector of much simpler
BlobPart objects, not an array with arbitrarily sliced blobs or files, which can't happen.

* Modules/websockets/WebSocket.cpp:(WebCore::WebSocket::didReceiveBinaryData):
Use a new simpler Blob constructor.

* WebCore.xcodeproj/project.pbxproj: Added BlobPart, removed BlobRegistrationData.

* bindings/js/JSBlobCustom.cpp: (WebCore::JSBlobConstructor::constructJSBlob):
Use Vector&lt;BlobPart&gt; instead of BlobData (1 line of code instead of 5).

* dom/DataTransfer.cpp: (WebCore::DataTransfer::hasFileOfType): Updated for
File::contentTypeFromFilePathOrName rename.

* fileapi/Blob.cpp: (WebCore::Blob::Blob):
* fileapi/Blob.h:
(WebCore::Blob::create):
(WebCore::Blob::deserialize):
* fileapi/File.cpp:
(WebCore::File::File):
(WebCore::File::contentTypeFromFilePathOrName):
(WebCore::createBlobDataForFileWithType): Deleted.
(WebCore::createBlobDataForFile): Deleted.
(WebCore::createBlobDataForFileWithName): Deleted.
(WebCore::File::contentTypeFromFilePath): Deleted.
* fileapi/File.h: (WebCore::File::deserialize): Deleted.
Added and updated constructors to not use BlobData. Changed special case constructors
to use name tags instead of non-enforced comments.

* fileapi/ThreadableBlobRegistry.h:
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::BlobRegistryContext::BlobRegistryContext): Updated with new data members
that were split out of BlobData.
(WebCore::ThreadableBlobRegistry::registerFileBlobURL): Added.
(WebCore::ThreadableBlobRegistry::registerBlobURL): Updated to pass Content-Type
explicitly, as it's no longer hidden in BlobData.

* fileapi/WebKitBlobBuilder.h:
* fileapi/WebKitBlobBuilder.cpp:
(WebCore::BlobBuilder::append):
(WebCore::BlobBuilder::finalize):
(WebCore::BlobBuilder::appendBytesData): Deleted.
Updated to use BlobPart. There is no longer any need to special case Files,
the registry takes care of that.

* platform/network/BlobData.h:
* platform/network/BlobData.cpp:
(WebCore::BlobDataItem::detachFromCurrentThread): Deleted.
(WebCore::BlobData::detachFromCurrentThread): Deleted.
BlobData will only be used on main thread by the registry.

* platform/network/BlobPart.h: Added. A new class to encapsulate a list of blobs
that are combined into a new blob, as exposed to JS via Blob constructor.

* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerFileBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
Updated for the new registration methods. We no longer have arbitrary BlobDatas
coming in.

* platform/network/FormData.cpp: Don't include BlobData for now (but really,
BlobStorageData is the same thing, and they will be merged soon).
Unfortunately, FormData is used by both client and registry side, and there is
no clear delimitation at the time.
 
* xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseBlob): Use the new simpler
way to create a Blob.

Source/WebKit2: 
Update for WebCore changes.

* CMakeLists.txt:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* Shared/FileAPI/BlobRegistrationData.cpp: Removed.
* Shared/FileAPI/BlobRegistrationData.h: Removed.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;BlobPart&gt;::encode):
(IPC::ArgumentCoder&lt;BlobPart&gt;::decode):
* Shared/WebCoreArgumentCoders.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebsocketsWebSocketcpp">trunk/Source/WebCore/Modules/websockets/WebSocket.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDataTransfercpp">trunk/Source/WebCore/dom/DataTransfer.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobcpp">trunk/Source/WebCore/fileapi/Blob.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobh">trunk/Source/WebCore/fileapi/Blob.h</a></li>
<li><a href="#trunkSourceWebCorefileapiFilecpp">trunk/Source/WebCore/fileapi/File.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiFileh">trunk/Source/WebCore/fileapi/File.h</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistrycpp">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistryh">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCorefileapiWebKitBlobBuildercpp">trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiWebKitBlobBuilderh">trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobDatacpp">trunk/Source/WebCore/platform/network/BlobData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobDatah">trunk/Source/WebCore/platform/network/BlobData.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="#trunkSourceWebCoreplatformnetworkFormDatacpp">trunk/Source/WebCore/platform/network/FormData.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestcpp">trunk/Source/WebCore/xml/XMLHttpRequest.cpp</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</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="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobParth">trunk/Source/WebCore/platform/network/BlobPart.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedFileAPIBlobRegistrationDatacpp">trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedFileAPIBlobRegistrationDatah">trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/ChangeLog        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -1,3 +1,80 @@
</span><ins>+2014-05-05  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        Stop using BlobData on client side
+        https://bugs.webkit.org/show_bug.cgi?id=132582
+
+        Reviewed by Sam Weinig.
+
+        Blob registration now uses either a single file path, or a vector of much simpler
+        BlobPart objects, not an array with arbitrarily sliced blobs or files, which can't happen.
+
+        * Modules/websockets/WebSocket.cpp:(WebCore::WebSocket::didReceiveBinaryData):
+        Use a new simpler Blob constructor.
+
+        * WebCore.xcodeproj/project.pbxproj: Added BlobPart, removed BlobRegistrationData.
+
+        * bindings/js/JSBlobCustom.cpp: (WebCore::JSBlobConstructor::constructJSBlob):
+        Use Vector&lt;BlobPart&gt; instead of BlobData (1 line of code instead of 5).
+
+        * dom/DataTransfer.cpp: (WebCore::DataTransfer::hasFileOfType): Updated for
+        File::contentTypeFromFilePathOrName rename.
+
+        * fileapi/Blob.cpp: (WebCore::Blob::Blob):
+        * fileapi/Blob.h:
+        (WebCore::Blob::create):
+        (WebCore::Blob::deserialize):
+        * fileapi/File.cpp:
+        (WebCore::File::File):
+        (WebCore::File::contentTypeFromFilePathOrName):
+        (WebCore::createBlobDataForFileWithType): Deleted.
+        (WebCore::createBlobDataForFile): Deleted.
+        (WebCore::createBlobDataForFileWithName): Deleted.
+        (WebCore::File::contentTypeFromFilePath): Deleted.
+        * fileapi/File.h: (WebCore::File::deserialize): Deleted.
+        Added and updated constructors to not use BlobData. Changed special case constructors
+        to use name tags instead of non-enforced comments.
+
+        * fileapi/ThreadableBlobRegistry.h:
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::BlobRegistryContext::BlobRegistryContext): Updated with new data members
+        that were split out of BlobData.
+        (WebCore::ThreadableBlobRegistry::registerFileBlobURL): Added.
+        (WebCore::ThreadableBlobRegistry::registerBlobURL): Updated to pass Content-Type
+        explicitly, as it's no longer hidden in BlobData.
+
+        * fileapi/WebKitBlobBuilder.h:
+        * fileapi/WebKitBlobBuilder.cpp:
+        (WebCore::BlobBuilder::append):
+        (WebCore::BlobBuilder::finalize):
+        (WebCore::BlobBuilder::appendBytesData): Deleted.
+        Updated to use BlobPart. There is no longer any need to special case Files,
+        the registry takes care of that.
+
+        * platform/network/BlobData.h:
+        * platform/network/BlobData.cpp:
+        (WebCore::BlobDataItem::detachFromCurrentThread): Deleted.
+        (WebCore::BlobData::detachFromCurrentThread): Deleted.
+        BlobData will only be used on main thread by the registry.
+
+        * platform/network/BlobPart.h: Added. A new class to encapsulate a list of blobs
+        that are combined into a new blob, as exposed to JS via Blob constructor.
+
+        * platform/network/BlobRegistry.h:
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::registerFileBlobURL):
+        (WebCore::BlobRegistryImpl::registerBlobURL):
+        * platform/network/BlobRegistryImpl.h:
+        Updated for the new registration methods. We no longer have arbitrary BlobDatas
+        coming in.
+
+        * platform/network/FormData.cpp: Don't include BlobData for now (but really,
+        BlobStorageData is the same thing, and they will be merged soon).
+        Unfortunately, FormData is used by both client and registry side, and there is
+        no clear delimitation at the time.

+        * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseBlob): Use the new simpler
+        way to create a Blob.
+
</ins><span class="cx"> 2014-05-05  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Clean up Image Document and tweak the layout and viewport
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebsocketsWebSocketcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include &quot;WebSocket.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Blob.h&quot;
</span><del>-#include &quot;BlobData.h&quot;
</del><span class="cx"> #include &quot;CloseEvent.h&quot;
</span><span class="cx"> #include &quot;ContentSecurityPolicy.h&quot;
</span><span class="cx"> #include &quot;DOMWindow.h&quot;
</span><span class="lines">@@ -520,9 +519,7 @@
</span><span class="cx">     switch (m_binaryType) {
</span><span class="cx">     case BinaryTypeBlob: {
</span><span class="cx">         // FIXME: We just received the data from NetworkProcess, and are sending it back. This is inefficient.
</span><del>-        auto blobData = std::make_unique&lt;BlobData&gt;();
-        blobData-&gt;appendData(RawData::create(std::move(*binaryData)), 0, BlobDataItem::toEndOfFile);
-        RefPtr&lt;Blob&gt; blob = Blob::create(std::move(blobData));
</del><ins>+        RefPtr&lt;Blob&gt; blob = Blob::create(std::move(*binaryData), emptyString());
</ins><span class="cx">         dispatchEvent(MessageEvent::create(blob.release(), SecurityOrigin::create(m_url)-&gt;toString()));
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -5964,6 +5964,7 @@
</span><span class="cx">                 E1C657251816E69D00256CDD /* CryptoAlgorithmIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C657241816E69D00256CDD /* CryptoAlgorithmIdentifier.h */; };
</span><span class="cx">                 E1C657271816F9FE00256CDD /* CryptoAlgorithmParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C657261816F9FE00256CDD /* CryptoAlgorithmParameters.h */; };
</span><span class="cx">                 E1C8BE5D0E8BD15A0064CB7D /* JSWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */; };
</span><ins>+                E1C94AF9191303F000D5A893 /* BlobPart.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C94AF7191303F000D5A893 /* BlobPart.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 E1CA5CBC0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */; };
</span><span class="cx">                 E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CAA5C50E8BD23600A73ECA /* JSWorker.h */; };
</span><span class="cx">                 E1CDE92015018ED000862CC5 /* AsyncFileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CDE91F15018ED000862CC5 /* AsyncFileStream.cpp */; };
</span><span class="lines">@@ -13370,6 +13371,7 @@
</span><span class="cx">                 E1C657261816F9FE00256CDD /* CryptoAlgorithmParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmParameters.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1C6CFC21746D293007B87A1 /* DOMWindowConstructors.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMWindowConstructors.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E1C94AF7191303F000D5A893 /* BlobPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobPart.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1CAA5C50E8BD23600A73ECA /* JSWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1CDE91F15018ED000862CC5 /* AsyncFileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AsyncFileStream.cpp; path = fileapi/AsyncFileStream.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16055,6 +16057,7 @@
</span><span class="cx">                                 E124748310AA161D00B79493 /* AuthenticationClient.h */,
</span><span class="cx">                                 2EDEF1ED121B0EFC00726DB2 /* BlobData.cpp */,
</span><span class="cx">                                 2EDEF1EE121B0EFC00726DB2 /* BlobData.h */,
</span><ins>+                                E1C94AF7191303F000D5A893 /* BlobPart.h */,
</ins><span class="cx">                                 E14A94D616DFDF950068DE82 /* BlobRegistry.cpp */,
</span><span class="cx">                                 2EDEF1EF121B0EFC00726DB2 /* BlobRegistry.h */,
</span><span class="cx">                                 2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */,
</span><span class="lines">@@ -25422,6 +25425,7 @@
</span><span class="cx">                                 E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */,
</span><span class="cx">                                 D0CE58F9125E4CC200F3F199 /* ResourceLoadScheduler.h in Headers */,
</span><span class="cx">                                 8A81BF8511DCFD9000DA2B98 /* ResourceLoadTiming.h in Headers */,
</span><ins>+                                E1C94AF9191303F000D5A893 /* BlobPart.h in Headers */,
</ins><span class="cx">                                 7EE6846D12D26E3800E79415 /* ResourceRequest.h in Headers */,
</span><span class="cx">                                 514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */,
</span><span class="cx">                                 7EE6846F12D26E3800E79415 /* ResourceRequestCFNet.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -134,13 +134,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    BlobDataItemList items = blobBuilder.finalize();
-    auto blobData = std::make_unique&lt;BlobData&gt;();
-    blobData-&gt;setContentType(Blob::normalizedContentType(type));
-    blobData-&gt;swapItems(items);
</del><ins>+    RefPtr&lt;Blob&gt; blob = Blob::create(blobBuilder.finalize(), Blob::normalizedContentType(type));
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;Blob&gt; blob = Blob::create(std::move(blobData));
-
</del><span class="cx">     return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), Blob, blob.get()));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDataTransfercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DataTransfer.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DataTransfer.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/dom/DataTransfer.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(canReadTypes());
</span><span class="cx"> 
</span><span class="cx">     for (const String&amp; filename : m_pasteboard-&gt;readFilenames()) {
</span><del>-        if (equalIgnoringCase(File::contentTypeFromFilePath(filename, File::AllContentTypes), type))
</del><ins>+        if (equalIgnoringCase(File::contentTypeFromFilePathOrName(filename, File::AllContentTypes), type))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/Blob.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -66,31 +66,37 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+Blob::Blob(UninitializedContructor)
+{
+}
+
</ins><span class="cx"> Blob::Blob()
</span><span class="cx">     : m_size(0)
</span><span class="cx"> {
</span><del>-    auto blobData = std::make_unique&lt;BlobData&gt;();
</del><ins>+    m_internalURL = BlobURL::createInternalURL();
+    ThreadableBlobRegistry::registerBlobURL(m_internalURL, Vector&lt;BlobPart&gt;(), String());
+}
</ins><span class="cx"> 
</span><del>-    // Create a new internal URL and register it with the provided blob data.
</del><ins>+Blob::Blob(Vector&lt;char&gt; data, const String&amp; contentType)
+    : m_type(contentType)
+{
+    Vector&lt;BlobPart&gt; blobParts;
+    blobParts.append(BlobPart(std::move(data)));
</ins><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><del>-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobData));
</del><ins>+    m_size = ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobParts), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Blob::Blob(std::unique_ptr&lt;BlobData&gt; blobData)
-    : m_type(blobData-&gt;contentType())
</del><ins>+Blob::Blob(Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType)
+    : m_type(contentType)
</ins><span class="cx"> {
</span><del>-    ASSERT(blobData);
-
-    // Create a new internal URL and register it with the provided blob data.
</del><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><del>-    m_size = ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobData));
</del><ins>+    m_size = ThreadableBlobRegistry::registerBlobURL(m_internalURL, std::move(blobParts), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Blob::Blob(const URL&amp; srcURL, const String&amp; type, long long size)
</del><ins>+Blob::Blob(DeserializationContructor, const URL&amp; srcURL, const String&amp; type, long long size)
</ins><span class="cx">     : m_type(Blob::normalizedContentType(type))
</span><span class="cx">     , m_size(size)
</span><span class="cx"> {
</span><del>-    // Create a new internal URL and register it with the same blob data as the source URL.
</del><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><span class="cx">     ThreadableBlobRegistry::registerBlobURL(0, m_internalURL, srcURL);
</span><span class="cx"> }
</span><span class="lines">@@ -99,7 +105,6 @@
</span><span class="cx"> Blob::Blob(const URL&amp; srcURL, long long start, long long end, const String&amp; type)
</span><span class="cx">     : m_type(Blob::normalizedContentType(type))
</span><span class="cx"> {
</span><del>-    // Create a new internal URL and register it with the same blob data as the source URL.
</del><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><span class="cx">     m_size = ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/Blob.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -31,8 +31,7 @@
</span><span class="cx"> #ifndef Blob_h
</span><span class="cx"> #define Blob_h
</span><span class="cx"> 
</span><del>-#include &quot;BlobData.h&quot;
-#include &quot;URL.h&quot;
</del><ins>+#include &quot;BlobPart.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &quot;URLRegistry.h&quot;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="lines">@@ -50,15 +49,20 @@
</span><span class="cx">         return adoptRef(new Blob);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static PassRefPtr&lt;Blob&gt; create(std::unique_ptr&lt;BlobData&gt; blobData)
</del><ins>+    static PassRefPtr&lt;Blob&gt; create(Vector&lt;char&gt; data, const String&amp; contentType)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new Blob(std::move(blobData)));
</del><ins>+        return adoptRef(new Blob(std::move(data), contentType));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static PassRefPtr&lt;Blob&gt; create(Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType)
+    {
+        return adoptRef(new Blob(std::move(blobParts), contentType));
+    }
+
</ins><span class="cx">     static PassRefPtr&lt;Blob&gt; deserialize(const URL&amp; srcURL, const String&amp; type, long long size)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(Blob::isNormalizedContentType(type));
</span><del>-        return adoptRef(new Blob(srcURL, type, size));
</del><ins>+        return adoptRef(new Blob(deserializationContructor, srcURL, type, size));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     virtual ~Blob();
</span><span class="lines">@@ -89,11 +93,15 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     Blob();
</span><del>-    Blob(std::unique_ptr&lt;BlobData&gt;);
</del><ins>+    Blob(Vector&lt;char&gt;, const String&amp; contentType);
+    Blob(Vector&lt;BlobPart&gt;, const String&amp; contentType);
</ins><span class="cx"> 
</span><del>-    // For deserialization.
-    Blob(const URL&amp; srcURL, const String&amp; type, long long size);
</del><ins>+    enum UninitializedContructor { uninitializedContructor };
+    Blob(UninitializedContructor);
</ins><span class="cx"> 
</span><ins>+    enum DeserializationContructor { deserializationContructor };
+    Blob(DeserializationContructor, const URL&amp; srcURL, const String&amp; type, long long size);
+
</ins><span class="cx"> #if ENABLE(BLOB)
</span><span class="cx">     // For slicing.
</span><span class="cx">     Blob(const URL&amp; srcURL, long long start, long long end, const String&amp; contentType);
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFilecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/File.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/File.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/File.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -26,56 +26,46 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;File.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;BlobURL.h&quot;
</ins><span class="cx"> #include &quot;FileMetadata.h&quot;
</span><span class="cx"> #include &quot;FileSystem.h&quot;
</span><span class="cx"> #include &quot;MIMETypeRegistry.h&quot;
</span><ins>+#include &quot;ThreadableBlobRegistry.h&quot;
</ins><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/DateMath.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static std::unique_ptr&lt;BlobData&gt; createBlobDataForFileWithType(const String&amp; path, const String&amp; contentType)
-{
-    auto blobData = std::make_unique&lt;BlobData&gt;();
-    ASSERT(Blob::isNormalizedContentType(contentType));
-    blobData-&gt;setContentType(contentType);
-    blobData-&gt;appendFile(path);
-    return blobData;
-}
-
-static std::unique_ptr&lt;BlobData&gt; createBlobDataForFile(const String&amp; path, File::ContentTypeLookupPolicy policy)
-{
-    return createBlobDataForFileWithType(path, File::contentTypeFromFilePath(path, policy));
-}
-
-static std::unique_ptr&lt;BlobData&gt; createBlobDataForFileWithName(const String&amp; path, const String&amp; fileSystemName, File::ContentTypeLookupPolicy policy)
-{
-    return createBlobDataForFileWithType(path, File::contentTypeFromFilePath(fileSystemName, policy));
-}
-
</del><span class="cx"> File::File(const String&amp; path, ContentTypeLookupPolicy policy)
</span><del>-    : Blob(createBlobDataForFile(path, policy))
</del><ins>+    : Blob(uninitializedContructor)
</ins><span class="cx">     , m_path(path)
</span><span class="cx">     , m_name(pathGetFileName(path))
</span><span class="cx"> {
</span><ins>+    m_internalURL = BlobURL::createInternalURL();
+    m_type = contentTypeFromFilePathOrName(path, policy);
+    m_size = -1;
+    ThreadableBlobRegistry::registerFileBlobURL(m_internalURL, path, m_type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-File::File(const String&amp; path, const URL&amp; url, const String&amp; type)
-    : Blob(url, type, -1)
</del><ins>+File::File(const String&amp; path, const String&amp; name, ContentTypeLookupPolicy policy)
+    : Blob(uninitializedContructor)
</ins><span class="cx">     , m_path(path)
</span><ins>+    , m_name(name)
</ins><span class="cx"> {
</span><del>-    m_name = pathGetFileName(path);
-    // FIXME: File object serialization/deserialization does not include
-    // newer file object data members: m_name and m_relativePath.
-    // See SerializedScriptValue.cpp
</del><ins>+    m_internalURL = BlobURL::createInternalURL();
+    m_type = contentTypeFromFilePathOrName(name, policy);
+    m_size = -1;
+    ThreadableBlobRegistry::registerFileBlobURL(m_internalURL, path, m_type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-File::File(const String&amp; path, const String&amp; name, ContentTypeLookupPolicy policy)
-    : Blob(createBlobDataForFileWithName(path, name, policy))
</del><ins>+File::File(DeserializationContructor, const String&amp; path, const URL&amp; url, const String&amp; type)
+    : Blob(deserializationContructor, url, type, -1)
</ins><span class="cx">     , m_path(path)
</span><del>-    , m_name(name)
</del><span class="cx"> {
</span><ins>+    m_name = pathGetFileName(path);
+    // FIXME: File object serialization/deserialization does not include m_name.
+    // See SerializedScriptValue.cpp
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double File::lastModifiedDate() const
</span><span class="lines">@@ -97,7 +87,7 @@
</span><span class="cx">     return static_cast&lt;unsigned long long&gt;(size);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String File::contentTypeFromFilePath(const String&amp; name, File::ContentTypeLookupPolicy policy)
</del><ins>+String File::contentTypeFromFilePathOrName(const String&amp; name, File::ContentTypeLookupPolicy policy)
</ins><span class="cx"> {
</span><span class="cx">     String type;
</span><span class="cx">     int index = name.reverseFind('.');
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFileh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/File.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/File.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/File.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -32,10 +32,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-struct FileMetadata;
</del><span class="cx"> class URL;
</span><span class="cx"> 
</span><del>-class File : public Blob {
</del><ins>+class File final : public Blob {
</ins><span class="cx"> public:
</span><span class="cx">     // AllContentTypes should only be used when the full path/name are trusted; otherwise, it could
</span><span class="cx">     // allow arbitrary pages to determine what applications an user has installed.
</span><span class="lines">@@ -51,7 +50,7 @@
</span><span class="cx"> 
</span><span class="cx">     static PassRefPtr&lt;File&gt; deserialize(const String&amp; path, const URL&amp; srcURL, const String&amp; type)
</span><span class="cx">     {
</span><del>-        return adoptRef(new File(path, srcURL, type));
</del><ins>+        return adoptRef(new File(deserializationContructor, path, srcURL, type));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Create a file with a name exposed to the author (via File.name and associated DOM properties) that differs from the one provided in the path.
</span><span class="lines">@@ -71,14 +70,13 @@
</span><span class="cx">     // This returns the current date and time if the file's last modifiecation date is not known (per spec: http://www.w3.org/TR/FileAPI/#dfn-lastModifiedDate).
</span><span class="cx">     double lastModifiedDate() const;
</span><span class="cx"> 
</span><del>-    static String contentTypeFromFilePath(const String&amp;, ContentTypeLookupPolicy);
</del><ins>+    static String contentTypeFromFilePathOrName(const String&amp;, ContentTypeLookupPolicy);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     File(const String&amp; path, ContentTypeLookupPolicy);
</span><span class="cx">     File(const String&amp; path, const String&amp; name, ContentTypeLookupPolicy);
</span><span class="cx"> 
</span><del>-    // For deserialization.
-    File(const String&amp; path, const URL&amp; srcURL, const String&amp; type);
</del><ins>+    File(DeserializationContructor, const String&amp; path, const URL&amp; srcURL, const String&amp; type);
</ins><span class="cx"> 
</span><span class="cx">     String m_path;
</span><span class="cx">     String m_name;
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;ThreadableBlobRegistry.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;BlobData.h&quot;
</del><ins>+#include &quot;BlobPart.h&quot;
</ins><span class="cx"> #include &quot;BlobRegistry.h&quot;
</span><span class="cx"> #include &quot;BlobURL.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="lines">@@ -50,11 +50,13 @@
</span><span class="cx"> struct BlobRegistryContext {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    BlobRegistryContext(const URL&amp; url, std::unique_ptr&lt;BlobData&gt; blobData)
</del><ins>+    BlobRegistryContext(const URL&amp; url, Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType)
</ins><span class="cx">         : url(url.copy())
</span><del>-        , blobData(std::move(blobData))
</del><ins>+        , contentType(contentType.isolatedCopy())
+        , blobParts(std::move(blobParts))
</ins><span class="cx">     {
</span><del>-        this-&gt;blobData-&gt;detachFromCurrentThread();
</del><ins>+        for (BlobPart&amp; part : blobParts)
+            part.detachFromCurrentThread();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     BlobRegistryContext(const URL&amp; url, const URL&amp; srcURL)
</span><span class="lines">@@ -68,9 +70,18 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    BlobRegistryContext(const URL&amp; url, const String&amp; path, const String&amp; contentType)
+        : url(url.copy())
+        , path(path.isolatedCopy())
+        , contentType(contentType.isolatedCopy())
+    {
+    }
+
</ins><span class="cx">     URL url;
</span><span class="cx">     URL srcURL;
</span><del>-    std::unique_ptr&lt;BlobData&gt; blobData;
</del><ins>+    String path;
+    String contentType;
+    Vector&lt;BlobPart&gt; blobParts;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BLOB)
</span><span class="lines">@@ -88,18 +99,33 @@
</span><span class="cx">     return *map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned long long ThreadableBlobRegistry::registerBlobURL(const URL&amp; url, std::unique_ptr&lt;BlobData&gt; blobData)
</del><ins>+void ThreadableBlobRegistry::registerFileBlobURL(const URL&amp; url, const String&amp; path, const String&amp; contentType)
</ins><span class="cx"> {
</span><ins>+    if (isMainThread())
+        blobRegistry().registerFileBlobURL(url, path, contentType);
+    else {
+        // BlobRegistryContext performs an isolated copy of data.
+        BlobRegistryContext* context = new BlobRegistryContext(url, path, contentType);
+        BinarySemaphore semaphore;
+        callOnMainThread([context] {
+            std::unique_ptr&lt;BlobRegistryContext&gt; blobRegistryContext(context);
+            blobRegistry().registerFileBlobURL(blobRegistryContext-&gt;url, blobRegistryContext-&gt;path, blobRegistryContext-&gt;contentType);
+        });
+    }
+}
+
+unsigned long long ThreadableBlobRegistry::registerBlobURL(const URL&amp; url, Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType)
+{
</ins><span class="cx">     unsigned long long resultSize;
</span><span class="cx">     if (isMainThread())
</span><del>-        resultSize = blobRegistry().registerBlobURL(url, std::move(blobData));
</del><ins>+        resultSize = blobRegistry().registerBlobURL(url, std::move(blobParts), contentType);
</ins><span class="cx">     else {
</span><span class="cx">         // BlobRegistryContext performs an isolated copy of data.
</span><del>-        BlobRegistryContext* context = new BlobRegistryContext(url, std::move(blobData));
</del><ins>+        BlobRegistryContext* context = new BlobRegistryContext(url, std::move(blobParts), contentType);
</ins><span class="cx">         BinarySemaphore semaphore;
</span><span class="cx">         callOnMainThread([context, &amp;semaphore, &amp;resultSize] {
</span><span class="cx">             std::unique_ptr&lt;BlobRegistryContext&gt; blobRegistryContext(context);
</span><del>-            resultSize = blobRegistry().registerBlobURL(blobRegistryContext-&gt;url, std::move(blobRegistryContext-&gt;blobData));
</del><ins>+            resultSize = blobRegistry().registerBlobURL(blobRegistryContext-&gt;url, std::move(blobRegistryContext-&gt;blobParts), blobRegistryContext-&gt;contentType);
</ins><span class="cx">             semaphore.signal();
</span><span class="cx">         });
</span><span class="cx">         semaphore.wait(std::numeric_limits&lt;double&gt;::max());
</span><span class="lines">@@ -168,8 +194,12 @@
</span><span class="cx"> 
</span><span class="cx"> #else
</span><span class="cx"> 
</span><del>-unsigned long long ThreadableBlobRegistry::registerBlobURL(const URL&amp;, std::unique_ptr&lt;BlobData&gt;)
</del><ins>+void ThreadableBlobRegistry::registerFileBlobURL(const URL&amp;, const String&amp;, const String&amp;)
</ins><span class="cx"> {
</span><ins>+}
+
+unsigned long long ThreadableBlobRegistry::registerBlobURL(const URL&amp;, Vector&lt;BlobPart&gt;, const String&amp;)
+{
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -31,17 +31,19 @@
</span><span class="cx"> #ifndef ThreadableBlobRegistry_h
</span><span class="cx"> #define ThreadableBlobRegistry_h
</span><span class="cx"> 
</span><del>-#include &lt;wtf/PassRefPtr.h&gt;
</del><ins>+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class BlobData;
</del><ins>+class BlobPart;
</ins><span class="cx"> class URL;
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> 
</span><span class="cx"> class ThreadableBlobRegistry {
</span><span class="cx"> public:
</span><del>-    static unsigned long long registerBlobURL(const URL&amp;, std::unique_ptr&lt;BlobData&gt;);
</del><ins>+    static void registerFileBlobURL(const URL&amp;, const String&amp; path, const String&amp; contentType);
+    static unsigned long long registerBlobURL(const URL&amp;, Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType);
</ins><span class="cx">     static void registerBlobURL(SecurityOrigin*, const URL&amp;, const URL&amp; srcURL);
</span><span class="cx">     static void unregisterBlobURL(const URL&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiWebKitBlobBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     if (!arrayBuffer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    appendBytesData(arrayBuffer-&gt;data(), arrayBuffer-&gt;byteLength());
</del><ins>+    m_appendableData.append(static_cast&lt;const char*&gt;(arrayBuffer-&gt;data()), arrayBuffer-&gt;byteLength());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobBuilder::append(PassRefPtr&lt;ArrayBufferView&gt; arrayBufferView)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">     if (!arrayBufferView)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    appendBytesData(arrayBufferView-&gt;baseAddress(), arrayBufferView-&gt;byteLength());
</del><ins>+    m_appendableData.append(static_cast&lt;const char*&gt;(arrayBufferView-&gt;baseAddress()), arrayBufferView-&gt;byteLength());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -92,25 +92,14 @@
</span><span class="cx">     if (!blob)
</span><span class="cx">         return;
</span><span class="cx">     if (!m_appendableData.isEmpty())
</span><del>-        m_items.append(BlobDataItem(RawData::create(std::move(m_appendableData))));
-    if (blob-&gt;isFile()) {
-        File* file = toFile(blob);
-        m_items.append(BlobDataItem(file-&gt;path(), 0, BlobDataItem::toEndOfFile, invalidFileTime()));
-    } else {
-        long long blobSize = static_cast&lt;long long&gt;(blob-&gt;size());
-        m_items.append(BlobDataItem(blob-&gt;url(), 0, blobSize));
-    }
</del><ins>+        m_items.append(BlobPart(std::move(m_appendableData)));
+    m_items.append(BlobPart(blob-&gt;url()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobBuilder::appendBytesData(const void* data, size_t length)
</del><ins>+Vector&lt;BlobPart&gt; BlobBuilder::finalize()
</ins><span class="cx"> {
</span><del>-    m_appendableData.append(static_cast&lt;const char*&gt;(data), length);
-}
-
-BlobDataItemList BlobBuilder::finalize()
-{
</del><span class="cx">     if (!m_appendableData.isEmpty())
</span><del>-        m_items.append(BlobDataItem(RawData::create(std::move(m_appendableData))));
</del><ins>+        m_items.append(BlobPart(std::move(m_appendableData)));
</ins><span class="cx">     return std::move(m_items);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiWebKitBlobBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -31,8 +31,7 @@
</span><span class="cx"> #ifndef WebKitBlobBuilder_h
</span><span class="cx"> #define WebKitBlobBuilder_h
</span><span class="cx"> 
</span><del>-#include &quot;BlobData.h&quot;
-#include &lt;wtf/Forward.h&gt;
</del><ins>+#include &quot;BlobPart.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class ArrayBuffer;
</span><span class="lines">@@ -54,12 +53,10 @@
</span><span class="cx">     void append(PassRefPtr&lt;JSC::ArrayBufferView&gt;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    BlobDataItemList finalize();
</del><ins>+    Vector&lt;BlobPart&gt; finalize();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    void appendBytesData(const void*, size_t);
-
-    BlobDataItemList m_items;
</del><ins>+    Vector&lt;BlobPart&gt; m_items;
</ins><span class="cx">     Vector&lt;char&gt; m_appendableData;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobData.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobData.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/platform/network/BlobData.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -45,20 +45,6 @@
</span><span class="cx"> 
</span><span class="cx"> const long long BlobDataItem::toEndOfFile = -1;
</span><span class="cx"> 
</span><del>-void BlobDataItem::detachFromCurrentThread()
-{
-    path = path.isolatedCopy();
-    url = url.copy();
-}
-
-void BlobData::detachFromCurrentThread()
-{
-    m_contentType = m_contentType.isolatedCopy();
-    m_contentDisposition = m_contentDisposition.isolatedCopy();
-    for (size_t i = 0; i &lt; m_items.size(); ++i)
-        m_items.at(i).detachFromCurrentThread();
-}
-
</del><span class="cx"> void BlobData::setContentType(const String&amp; contentType)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(Blob::isNormalizedContentType(contentType));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobData.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobData.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/platform/network/BlobData.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// FIXME: RawData doesn't need to be ThreadSafeRefCounted any more. We can probably switch to another data buffer type now.
</ins><span class="cx"> class RawData : public ThreadSafeRefCounted&lt;RawData&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;RawData&gt; create(Vector&lt;char&gt;&amp;&amp; data)
</span><span class="lines">@@ -118,9 +119,6 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Detaches from current thread so that it can be passed to another thread.
-    void detachFromCurrentThread();
-
</del><span class="cx">     enum {
</span><span class="cx">         Data,
</span><span class="cx">         File,
</span><span class="lines">@@ -161,9 +159,6 @@
</span><span class="cx"> public:
</span><span class="cx">     BlobData() { }
</span><span class="cx"> 
</span><del>-    // Detaches from current thread so that it can be passed to another thread.
-    void detachFromCurrentThread();
-
</del><span class="cx">     const String&amp; contentType() const { return m_contentType; }
</span><span class="cx">     void setContentType(const String&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobParth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/BlobPart.h (0 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobPart.h                                (rev 0)
+++ trunk/Source/WebCore/platform/network/BlobPart.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef BlobPart_h
+#define BlobPart_h
+
+#include &quot;URL.h&quot;
+
+namespace WebCore {
+
+class BlobPart {
+public:
+    enum Type {
+        Data,
+        Blob
+    };
+
+    BlobPart()
+        : m_type(Data)
+    {
+    }
+
+    BlobPart(Vector&lt;char&gt; data)
+        : m_type(Data)
+        , m_data(std::move(data))
+    {
+    }
+
+    BlobPart(const URL&amp; url)
+        : m_type(Blob)
+        , m_url(url)
+    {
+    }
+
+    Type type() const { return m_type; }
+
+    const Vector&lt;char&gt;&amp; data() const
+    {
+        ASSERT(m_type == Data);
+        return m_data;
+    }
+
+    Vector&lt;char&gt; moveData()
+    {
+        ASSERT(m_type == Data);
+        return std::move(m_data);
+    }
+
+    const URL&amp; url() const
+    {
+        ASSERT(m_type == Blob);
+        return m_url;
+    }
+
+    void detachFromCurrentThread()
+    {
+        m_url = m_url.copy();
+    }
+
+private:
+    Type m_type;
+    Vector&lt;char&gt; m_data;
+    URL m_url;
+};
+
+}
+
+#endif // BlobPart_h
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/network/BlobPart.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -31,12 +31,12 @@
</span><span class="cx"> #ifndef BlobRegistry_h
</span><span class="cx"> #define BlobRegistry_h
</span><span class="cx"> 
</span><del>-#include &lt;wtf/PassOwnPtr.h&gt;
</del><ins>+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class BlobData;
-class BlobStorageData;
</del><ins>+class BlobPart;
</ins><span class="cx"> class BlobRegistry;
</span><span class="cx"> class URL;
</span><span class="cx"> 
</span><span class="lines">@@ -45,8 +45,12 @@
</span><span class="cx"> // BlobRegistry is not thread-safe. It should only be called from main thread.
</span><span class="cx"> class BlobRegistry {
</span><span class="cx"> public:
</span><ins>+
+    // Registers a blob URL referring to the specified file.
+    virtual void registerFileBlobURL(const URL&amp;, const String&amp; path, const String&amp; contentType) = 0;
+
</ins><span class="cx">     // Registers a blob URL referring to the specified blob data.
</span><del>-    virtual unsigned long long registerBlobURL(const URL&amp;, std::unique_ptr&lt;BlobData&gt;) = 0;
</del><ins>+    virtual unsigned long long registerBlobURL(const URL&amp;, Vector&lt;BlobPart&gt;, const String&amp; contentType) = 0;
</ins><span class="cx">     
</span><span class="cx">     // Registers a new blob URL referring to the blob data identified by the specified srcURL.
</span><span class="cx">     virtual void registerBlobURL(const URL&amp;, const URL&amp; srcURL) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BLOB)
</span><span class="cx"> 
</span><ins>+#include &quot;BlobPart.h&quot;
</ins><span class="cx"> #include &quot;BlobResourceHandle.h&quot;
</span><span class="cx"> #include &quot;BlobStorageData.h&quot;
</span><span class="cx"> #include &quot;FileMetadata.h&quot;
</span><span class="lines">@@ -116,51 +117,54 @@
</span><span class="cx">     ASSERT(!length);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned long long BlobRegistryImpl::registerBlobURL(const URL&amp; url, std::unique_ptr&lt;BlobData&gt; blobData)
</del><ins>+void BlobRegistryImpl::registerFileBlobURL(const URL&amp; url, const String&amp; path, const String&amp; contentType)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     registerBlobResourceHandleConstructor();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;BlobStorageData&gt; blobStorageData = BlobStorageData::create(blobData-&gt;contentType());
</del><ins>+    RefPtr&lt;BlobStorageData&gt; blobStorageData = BlobStorageData::create(contentType);
</ins><span class="cx"> 
</span><ins>+    // FIXME: Factor out size and modification tracking for a cleaner implementation.
+    FileMetadata metadata;
+    if (!getFileMetadata(path, metadata))
+        return;
+
+    blobStorageData-&gt;m_data.appendFile(path, 0, metadata.length, metadata.modificationTime);
+    m_blobs.set(url.string(), blobStorageData);
+}
+
+unsigned long long BlobRegistryImpl::registerBlobURL(const URL&amp; url, Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType)
+{
+    ASSERT(isMainThread());
+    registerBlobResourceHandleConstructor();
+
+    RefPtr&lt;BlobStorageData&gt; blobStorageData = BlobStorageData::create(contentType);
+
</ins><span class="cx">     // The blob data is stored in the &quot;canonical&quot; way. That is, it only contains a list of Data and File items.
</span><span class="cx">     // 1) The Data item is denoted by the raw data and the range.
</span><span class="cx">     // 2) The File item is denoted by the file path, the range and the expected modification time.
</span><span class="cx">     // 3) The URL item is denoted by the URL, the range and the expected modification time.
</span><span class="cx">     // All the Blob items in the passing blob data are resolved and expanded into a set of Data and File items.
</span><span class="cx"> 
</span><del>-    // FIXME: BlobDataItems contain a lot of information that we do not expect to be present when registering a new blob,
-    // these data members are only used inside the registry. Use a more appropriate type than BlobData.
-
</del><span class="cx">     unsigned long long size = 0;
</span><del>-    for (const BlobDataItem&amp; item : blobData-&gt;items()) {
-        switch (item.type) {
-        case BlobDataItem::Data:
-            blobStorageData-&gt;m_data.appendData(item.data, 0, item.data-&gt;length());
-            size += item.data-&gt;length();
</del><ins>+    for (BlobPart&amp; part : blobParts) {
+        switch (part.type()) {
+        case BlobPart::Data: {
+            unsigned long long partSize = part.data().size();
+            RefPtr&lt;RawData&gt; rawData = RawData::create(part.moveData());
+            size += partSize;
+            blobStorageData-&gt;m_data.appendData(rawData.release(), 0, partSize);
</ins><span class="cx">             break;
</span><del>-        case BlobDataItem::File: {
-            ASSERT(!item.offset);
-            ASSERT(item.length == BlobDataItem::toEndOfFile);
-            ASSERT(!isValidFileTime(item.expectedModificationTime));
-
-            // FIXME: Factor out size and modification tracking for a cleaner implementation.
-            FileMetadata metadata;
-            if (!getFileMetadata(item.path, metadata))
-                return 0;
-
-            blobStorageData-&gt;m_data.appendFile(item.path, 0, metadata.length, metadata.modificationTime);
-            size += metadata.length;
-            break;
</del><span class="cx">         }
</span><del>-        case BlobDataItem::Blob:
-            if (!m_blobs.contains(item.url.string()))
</del><ins>+        case BlobPart::Blob: {
+            if (!m_blobs.contains(part.url().string()))
</ins><span class="cx">                 return 0;
</span><del>-            size += blobSize(item.url); // As a side effect, this calculates sizes of all files in the blob.
-            ASSERT(blobSize(item.url) == static_cast&lt;unsigned long long&gt;(item.length));
-            appendStorageItems(blobStorageData.get(), m_blobs.get(item.url.string())-&gt;items(), item.offset, item.length);
</del><ins>+            unsigned long long partSize = blobSize(part.url()); // As a side effect, this calculates sizes of all files in the blob.
+            size += partSize;
+            appendStorageItems(blobStorageData.get(), m_blobs.get(part.url().string())-&gt;items(), 0, partSize);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><ins>+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_blobs.set(url.string(), blobStorageData);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> 
</span><span class="cx"> // BlobRegistryImpl is not thread-safe. It should only be called from main thread.
</span><del>-class BlobRegistryImpl : public BlobRegistry {
</del><ins>+class BlobRegistryImpl final : public BlobRegistry {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     virtual ~BlobRegistryImpl();
</span><span class="lines">@@ -57,7 +57,8 @@
</span><span class="cx"> private:
</span><span class="cx">     void appendStorageItems(BlobStorageData*, const BlobDataItemList&amp;, long long offset, long long length);
</span><span class="cx"> 
</span><del>-    virtual unsigned long long registerBlobURL(const URL&amp;, std::unique_ptr&lt;BlobData&gt;) override;
</del><ins>+    virtual void registerFileBlobURL(const WebCore::URL&amp;, const String&amp; path, const String&amp; contentType) override;
+    virtual unsigned long long registerBlobURL(const URL&amp;, Vector&lt;BlobPart&gt;, const String&amp; contentType) override;
</ins><span class="cx">     virtual void registerBlobURL(const URL&amp;, const URL&amp; srcURL) override;
</span><span class="cx">     virtual unsigned long long registerBlobURLForSlice(const URL&amp;, const URL&amp; srcURL, long long start, long long end) override;
</span><span class="cx">     virtual void unregisterBlobURL(const URL&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkFormDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/FormData.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/FormData.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/platform/network/FormData.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -23,8 +23,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FormData.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;BlobData.h&quot;
</del><span class="cx"> #include &quot;BlobRegistryImpl.h&quot;
</span><ins>+#include &quot;BlobStorageData.h&quot;
</ins><span class="cx"> #include &quot;BlobURL.h&quot;
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="cx"> #include &quot;ChromeClient.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include &quot;XMLHttpRequest.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Blob.h&quot;
</span><del>-#include &quot;BlobData.h&quot;
</del><span class="cx"> #include &quot;ContentSecurityPolicy.h&quot;
</span><span class="cx"> #include &quot;CrossOriginAccessControl.h&quot;
</span><span class="cx"> #include &quot;DOMFormData.h&quot;
</span><span class="lines">@@ -289,13 +288,11 @@
</span><span class="cx">     if (!m_responseBlob) {
</span><span class="cx">         if (m_binaryResponseBuilder) {
</span><span class="cx">             // FIXME: We just received the data from NetworkProcess, and are sending it back. This is inefficient.
</span><del>-            unsigned size = m_binaryResponseBuilder-&gt;size();
-            auto blobData = std::make_unique&lt;BlobData&gt;();
-            blobData-&gt;appendData(RawData::create(m_binaryResponseBuilder-&gt;data(), size), 0, BlobDataItem::toEndOfFile);
-            String normalizedContentType = Blob::normalizedContentType(responseMIMEType());
-            blobData-&gt;setContentType(normalizedContentType); // responseMIMEType defaults to text/xml which may be incorrect.
</del><ins>+            Vector&lt;char&gt; data;
+            data.append(m_binaryResponseBuilder-&gt;data(), m_binaryResponseBuilder-&gt;size());
+            String normalizedContentType = Blob::normalizedContentType(responseMIMEType()); // responseMIMEType defaults to text/xml which may be incorrect.
+            m_responseBlob = Blob::create(std::move(data), normalizedContentType);
</ins><span class="cx">             m_binaryResponseBuilder.clear();
</span><del>-            m_responseBlob = Blob::create(std::move(blobData));
</del><span class="cx">         } else {
</span><span class="cx">             // If we errored out or got no data, we still return a blob, just an empty one.
</span><span class="cx">             m_responseBlob = Blob::create();
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/CMakeLists.txt        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -269,8 +269,6 @@
</span><span class="cx">     Shared/Downloads/DownloadAuthenticationClient.cpp
</span><span class="cx">     Shared/Downloads/DownloadManager.cpp
</span><span class="cx"> 
</span><del>-    Shared/FileAPI/BlobRegistrationData.cpp
-
</del><span class="cx">     Shared/Network/NetworkProcessCreationParameters.cpp
</span><span class="cx">     Shared/Network/NetworkResourceLoadParameters.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-05-05  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        Stop using BlobData on client side
+        https://bugs.webkit.org/show_bug.cgi?id=132582
+
+        Reviewed by Sam Weinig.
+
+        Update for WebCore changes.
+
+        * CMakeLists.txt:
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+        (WebKit::NetworkBlobRegistry::registerFileBlobURL):
+        (WebKit::NetworkBlobRegistry::registerBlobURL):
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        * Shared/FileAPI/BlobRegistrationData.cpp: Removed.
+        * Shared/FileAPI/BlobRegistrationData.h: Removed.
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;BlobPart&gt;::encode):
+        (IPC::ArgumentCoder&lt;BlobPart&gt;::decode):
+        * Shared/WebCoreArgumentCoders.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerFileBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURL):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+
</ins><span class="cx"> 2014-05-05  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Need a delegate that informs the UI process when the page's pin state changes
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(BLOB) &amp;&amp; ENABLE(NETWORK_PROCESS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;SandboxExtension.h&quot;
</span><ins>+#include &lt;WebCore/BlobPart.h&gt;
</ins><span class="cx"> #include &lt;WebCore/BlobRegistryImpl.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="lines">@@ -48,22 +49,40 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-uint64_t NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL&amp; url, std::unique_ptr&lt;BlobData&gt; data, const Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt;&amp; newSandboxExtensions)
</del><ins>+void NetworkBlobRegistry::registerFileBlobURL(NetworkConnectionToWebProcess* connection, const URL&amp; url, const String&amp; path, PassRefPtr&lt;SandboxExtension&gt; sandboxExtension, const String&amp; contentType)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_sandboxExtensions.contains(url.string()));
</span><span class="cx"> 
</span><del>-    // Combine new extensions for File items and existing extensions for inner Blob items.
-    Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt; sandboxExtensions = newSandboxExtensions;
-    const BlobDataItemList&amp; items = data-&gt;items();
-    for (size_t i = 0, count = items.size(); i &lt; count; ++i) {
-        if (items[i].type == BlobDataItem::Blob)
-            sandboxExtensions.appendVector(m_sandboxExtensions.get(items[i].url.string()));
</del><ins>+    blobRegistry().registerFileBlobURL(url, path, contentType);
+
+    if (sandboxExtension) {
+        Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt; extensionsVector;
+        extensionsVector.append(sandboxExtension);
+        m_sandboxExtensions.add(url.string(), std::move(extensionsVector));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    uint64_t resultSize = blobRegistry().registerBlobURL(url, std::move(data));
</del><ins>+    ASSERT(!m_blobsForConnection.get(connection).contains(url));
+    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
+    if (mapIterator == m_blobsForConnection.end())
+        mapIterator = m_blobsForConnection.add(connection, HashSet&lt;URL&gt;()).iterator;
+    mapIterator-&gt;value.add(url);
+}
</ins><span class="cx"> 
</span><ins>+uint64_t NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL&amp; url, Vector&lt;WebCore::BlobPart&gt; blobParts, const String&amp; contentType)
+{
+    ASSERT(!m_sandboxExtensions.contains(url.string()));
+
+    // Combine existing extensions for inner Blob items.
+    Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt; sandboxExtensions;
+    for (const BlobPart&amp; part : blobParts) {
+        if (part.type() == BlobPart::Blob)
+            sandboxExtensions.appendVector(m_sandboxExtensions.get(part.url().string()));
+    }
+
+    uint64_t resultSize = blobRegistry().registerBlobURL(url, std::move(blobParts), contentType);
+
</ins><span class="cx">     if (!sandboxExtensions.isEmpty())
</span><del>-        m_sandboxExtensions.add(url.string(), sandboxExtensions);
</del><ins>+        m_sandboxExtensions.add(url.string(), std::move(sandboxExtensions));
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(!m_blobsForConnection.get(connection).contains(url));
</span><span class="cx">     BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-class BlobData;
</del><ins>+class BlobPart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -47,7 +47,8 @@
</span><span class="cx">     NetworkBlobRegistry();
</span><span class="cx">     static NetworkBlobRegistry&amp; shared();
</span><span class="cx"> 
</span><del>-    uint64_t registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&amp;, std::unique_ptr&lt;WebCore::BlobData&gt;, const Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt;&amp;);
</del><ins>+    void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&amp;, const String&amp; path, PassRefPtr&lt;SandboxExtension&gt;, const String&amp; contentType);
+    uint64_t registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&amp;, Vector&lt;WebCore::BlobPart&gt;, const String&amp; contentType);
</ins><span class="cx">     void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&amp;, const WebCore::URL&amp; srcURL);
</span><span class="cx">     uint64_t registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&amp;, const WebCore::URL&amp; srcURL, int64_t start, int64_t end);
</span><span class="cx">     void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span><span class="cx"> 
</span><del>-#include &quot;BlobRegistrationData.h&quot;
</del><span class="cx"> #include &quot;ConnectionStack.h&quot;
</span><span class="cx"> #include &quot;NetworkBlobRegistry.h&quot;
</span><span class="cx"> #include &quot;NetworkConnectionToWebProcessMessages.h&quot;
</span><span class="lines">@@ -38,7 +37,6 @@
</span><span class="cx"> #include &quot;NetworkResourceLoaderMessages.h&quot;
</span><span class="cx"> #include &quot;RemoteNetworkingContext.h&quot;
</span><span class="cx"> #include &quot;SessionTracker.h&quot;
</span><del>-#include &lt;WebCore/BlobData.h&gt;
</del><span class="cx"> #include &lt;WebCore/PlatformCookieJar.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceLoaderOptions.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceRequest.h&gt;
</span><span class="lines">@@ -225,17 +223,18 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BLOB)
</span><del>-void NetworkConnectionToWebProcess::registerBlobURL(const URL&amp; url, const BlobRegistrationData&amp; data, uint64_t&amp; resultSize)
</del><ins>+void NetworkConnectionToWebProcess::registerFileBlobURL(const URL&amp; url, const String&amp; path, const SandboxExtension::Handle&amp; extensionHandle, const String&amp; contentType)
</ins><span class="cx"> {
</span><del>-    Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt; extensions;
-    for (size_t i = 0, count = data.sandboxExtensions().size(); i &lt; count; ++i) {
-        if (RefPtr&lt;SandboxExtension&gt; extension = SandboxExtension::create(data.sandboxExtensions()[i]))
-            extensions.append(extension);
-    }
</del><ins>+    RefPtr&lt;SandboxExtension&gt; extension = SandboxExtension::create(extensionHandle);
</ins><span class="cx"> 
</span><del>-    resultSize = NetworkBlobRegistry::shared().registerBlobURL(this, url, data.releaseData(), extensions);
</del><ins>+    NetworkBlobRegistry::shared().registerFileBlobURL(this, url, path, extension.release(), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkConnectionToWebProcess::registerBlobURL(const URL&amp; url, Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType, uint64_t&amp; resultSize)
+{
+    resultSize = NetworkBlobRegistry::shared().registerBlobURL(this, url, std::move(blobParts), contentType);
+}
+
</ins><span class="cx"> void NetworkConnectionToWebProcess::registerBlobURLFromURL(const URL&amp; url, const URL&amp; srcURL)
</span><span class="cx"> {
</span><span class="cx">     NetworkBlobRegistry::shared().registerBlobURL(this, url, srcURL);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class BlobRegistrationData;
</del><span class="cx"> class NetworkConnectionToWebProcess;
</span><span class="cx"> class NetworkResourceLoader;
</span><span class="cx"> class SyncNetworkResourceLoader;
</span><span class="lines">@@ -88,7 +87,8 @@
</span><span class="cx">     void deleteCookie(WebCore::SessionID, const WebCore::URL&amp;, const String&amp; cookieName);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BLOB)
</span><del>-    void registerBlobURL(const WebCore::URL&amp;, const BlobRegistrationData&amp;, uint64_t&amp; resultSize);
</del><ins>+    void registerFileBlobURL(const WebCore::URL&amp;, const String&amp; path, const SandboxExtension::Handle&amp;, const String&amp; contentType);
+    void registerBlobURL(const WebCore::URL&amp;, Vector&lt;WebCore::BlobPart&gt;, const String&amp; contentType, uint64_t&amp; resultSize);
</ins><span class="cx">     void registerBlobURLFromURL(const WebCore::URL&amp;, const WebCore::URL&amp; srcURL);
</span><span class="cx">     void registerBlobURLForSlice(const WebCore::URL&amp;, const WebCore::URL&amp; srcURL, int64_t start, int64_t end, uint64_t&amp; resultSize);
</span><span class="cx">     void unregisterBlobURL(const WebCore::URL&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -44,7 +44,8 @@
</span><span class="cx">     DeleteCookie(WebCore::SessionID sessionID, WebCore::URL url, String cookieName)
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BLOB)
</span><del>-    RegisterBlobURL(WebCore::URL url, WebKit::BlobRegistrationData data) -&gt; (uint64_t resultSize)
</del><ins>+    RegisterFileBlobURL(WebCore::URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType)
+    RegisterBlobURL(WebCore::URL url, Vector&lt;WebCore::BlobPart&gt; blobParts, String contentType) -&gt; (uint64_t resultSize)
</ins><span class="cx">     RegisterBlobURLFromURL(WebCore::URL url, WebCore::URL srcURL)
</span><span class="cx">     RegisterBlobURLForSlice(WebCore::URL url, WebCore::URL srcURL, int64_t start, int64_t end) -&gt; (uint64_t resultSize)
</span><span class="cx">     UnregisterBlobURL(WebCore::URL url)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedFileAPIBlobRegistrationDatacpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -1,175 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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 &quot;config.h&quot;
-#include &quot;BlobRegistrationData.h&quot;
-
-#if ENABLE(BLOB) &amp;&amp; ENABLE(NETWORK_PROCESS)
-
-#include &quot;ArgumentCoders.h&quot;
-#include &quot;DataReference.h&quot;
-#include &quot;WebCoreArgumentCoders.h&quot;
-#include &lt;WebCore/BlobData.h&gt;
-
-using namespace WebCore;
-
-namespace WebKit {
-
-BlobRegistrationData::BlobRegistrationData()
-{
-}
-
-BlobRegistrationData::BlobRegistrationData(std::unique_ptr&lt;BlobData&gt; data)
-    : m_data(std::move(data))
-{
-    const BlobDataItemList&amp; items = m_data-&gt;items();
-    size_t fileCount = 0;
-    for (size_t i = 0, count = items.size(); i &lt; count; ++i) {
-        // File path can be empty when submitting a form file input without a file, see bug 111778.
-        if (items[i].type == BlobDataItem::File &amp;&amp; !items[i].path.isEmpty())
-            ++fileCount;
-    }
-
-    m_sandboxExtensions.allocate(fileCount);
-    size_t extensionIndex = 0;
-    for (size_t i = 0, count = items.size(); i &lt; count; ++i) {
-        const BlobDataItem&amp; item = items[i];
-        if (item.type == BlobDataItem::File &amp;&amp; !items[i].path.isEmpty())
-            SandboxExtension::createHandle(item.path, SandboxExtension::ReadOnly, m_sandboxExtensions[extensionIndex++]);
-    }
-}
-
-BlobRegistrationData::~BlobRegistrationData()
-{
-}
-
-std::unique_ptr&lt;BlobData&gt; BlobRegistrationData::releaseData() const
-{
-    return std::move(m_data);
-}
-
-void BlobRegistrationData::encode(IPC::ArgumentEncoder&amp; encoder) const
-{
-    encoder &lt;&lt; m_data-&gt;contentType();
-
-    const BlobDataItemList&amp; items = m_data-&gt;items();
-    encoder &lt;&lt; static_cast&lt;uint64_t&gt;(items.size());
-    for (size_t i = 0, count = items.size(); i &lt; count; ++i) {
-        const BlobDataItem&amp; item = items[i];
-        encoder &lt;&lt; static_cast&lt;uint32_t&gt;(item.type);
-        switch (item.type) {
-        case BlobDataItem::Data:
-            // There is no way to create a partial data item.
-            ASSERT(!item.offset);
-            ASSERT(item.length == BlobDataItem::toEndOfFile);
-            encoder &lt;&lt; IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(item.data-&gt;data()), item.data-&gt;length());
-            break;
-        case BlobDataItem::File:
-            encoder &lt;&lt; static_cast&lt;int64_t&gt;(item.offset);
-            encoder &lt;&lt; static_cast&lt;int64_t&gt;(item.length);
-            encoder &lt;&lt; item.expectedModificationTime;
-            encoder &lt;&lt; item.path;
-            break;
-        case BlobDataItem::Blob:
-            encoder &lt;&lt; static_cast&lt;int64_t&gt;(item.offset);
-            encoder &lt;&lt; static_cast&lt;int64_t&gt;(item.length);
-            encoder &lt;&lt; item.url;
-            break;
-        }
-    }
-
-    encoder &lt;&lt; m_sandboxExtensions;
-}
-
-bool BlobRegistrationData::decode(IPC::ArgumentDecoder&amp; decoder, BlobRegistrationData&amp; result)
-{
-    ASSERT(!result.m_data);
-    result.m_data = std::make_unique&lt;BlobData&gt;();
-
-    String contentType;
-    if (!decoder.decode(contentType))
-        return false;
-    result.m_data-&gt;setContentType(contentType);
-
-    uint64_t itemCount;
-    if (!decoder.decode(itemCount))
-        return false;
-
-    for (uint64_t i = 0; i &lt; itemCount; ++i) {
-        uint32_t type;
-        if (!decoder.decode(type))
-            return false;
-        switch (type) {
-        case BlobDataItem::Data: {
-            IPC::DataReference data;
-            if (!decoder.decode(data))
-                return false;
-            RefPtr&lt;RawData&gt; rawData = RawData::create(reinterpret_cast&lt;const char*&gt;(data.data()), data.size());
-            result.m_data-&gt;appendData(rawData.release(), 0, BlobDataItem::toEndOfFile);
-            break;
-        }
-        case BlobDataItem::File: {
-            int64_t offset;
-            if (!decoder.decode(offset))
-                return false;
-            int64_t length;
-            if (!decoder.decode(length))
-                return false;
-            double expectedModificationTime;
-            if (!decoder.decode(expectedModificationTime))
-                return false;
-            String path;
-            if (!decoder.decode(path))
-                return false;
-            result.m_data-&gt;appendFile(path, offset, length, expectedModificationTime);
-            break;
-        }
-        case BlobDataItem::Blob: {
-            int64_t offset;
-            if (!decoder.decode(offset))
-                return false;
-            int64_t length;
-            if (!decoder.decode(length))
-                return false;
-            String url;
-            if (!decoder.decode(url))
-                return false;
-            result.m_data-&gt;appendBlob(URL(URL(), url), offset, length);
-            break;
-        }
-        default:
-            return false;
-        }
-    }
-
-    if (!decoder.decode(result.m_sandboxExtensions))
-        return false;
-
-    return true;
-}
-
-}
-
-#endif // ENABLE(BLOB) &amp;&amp; ENABLE(NETWORK_PROCESS)
</del></span></pre></div>
<a id="trunkSourceWebKit2SharedFileAPIBlobRegistrationDatah"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/Shared/FileAPI/BlobRegistrationData.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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.
- */
-
-#ifndef BlobRegistrationData_h
-#define BlobRegistrationData_h
-
-#if ENABLE(BLOB) &amp;&amp; ENABLE(NETWORK_PROCESS)
-
-#include &quot;SandboxExtension.h&quot;
-
-namespace WebCore {
-class BlobData;
-}
-
-namespace WebKit {
-
-class BlobRegistrationData {
-WTF_MAKE_NONCOPYABLE(BlobRegistrationData);
-public:
-    BlobRegistrationData();
-    BlobRegistrationData(std::unique_ptr&lt;WebCore::BlobData&gt;);
-    ~BlobRegistrationData();
-
-    void encode(IPC::ArgumentEncoder&amp;) const;
-    static bool decode(IPC::ArgumentDecoder&amp;, BlobRegistrationData&amp;);
-
-    std::unique_ptr&lt;WebCore::BlobData&gt; releaseData() const;
-    const SandboxExtension::HandleArray&amp; sandboxExtensions() const { return m_sandboxExtensions; }
-
-private:
-    mutable std::unique_ptr&lt;WebCore::BlobData&gt; m_data;
-    SandboxExtension::HandleArray m_sandboxExtensions;
-};
-
-}
-
-#endif // ENABLE(BLOB) &amp;&amp; ENABLE(NETWORK_PROCESS)
-
-#endif // BlobRegistrationData_h
</del></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;DataReference.h&quot;
</span><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><span class="cx"> #include &lt;WebCore/AuthenticationChallenge.h&gt;
</span><ins>+#include &lt;WebCore/BlobPart.h&gt;
</ins><span class="cx"> #include &lt;WebCore/CertificateInfo.h&gt;
</span><span class="cx"> #include &lt;WebCore/Cookie.h&gt;
</span><span class="cx"> #include &lt;WebCore/Credential.h&gt;
</span><span class="lines">@@ -1972,4 +1973,45 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;BlobPart&gt;::encode(ArgumentEncoder&amp; encoder, const BlobPart&amp; blobPart)
+{
+    encoder &lt;&lt; static_cast&lt;uint32_t&gt;(blobPart.type());
+    switch (blobPart.type()) {
+    case BlobPart::Data:
+        encoder &lt;&lt; blobPart.data();
+        break;
+    case BlobPart::Blob:
+        encoder &lt;&lt; blobPart.url();
+        break;
+    }
+}
+
+bool ArgumentCoder&lt;BlobPart&gt;::decode(ArgumentDecoder&amp; decoder, BlobPart&amp; blobPart)
+{
+    uint32_t type;
+    if (!decoder.decode(type))
+        return false;
+
+    switch (type) {
+    case BlobPart::Data: {
+        Vector&lt;char&gt; data;
+        if (!decoder.decode(data))
+            return false;
+        blobPart = BlobPart(std::move(data));
+        break;
+    }
+    case BlobPart::Blob: {
+        String url;
+        if (!decoder.decode(url))
+            return false;
+        blobPart = BlobPart(URL(URL(), url));
+        break;
+    }
+    default:
+        return false;
+    }
+
+    return true;
+}
+
</ins><span class="cx"> } // namespace IPC
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class AffineTransform;
</span><span class="cx"> class AuthenticationChallenge;
</span><ins>+class BlobPart;
</ins><span class="cx"> class CertificateInfo;
</span><span class="cx"> class Color;
</span><span class="cx"> class Credential;
</span><span class="lines">@@ -424,6 +425,11 @@
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::SessionID&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::BlobPart&gt; {
+    static void encode(ArgumentEncoder&amp;, const WebCore::BlobPart&amp;);
+    static bool decode(ArgumentDecoder&amp;, WebCore::BlobPart&amp;);
+};
+
</ins><span class="cx"> } // namespace IPC
</span><span class="cx"> 
</span><span class="cx"> #endif // WebCoreArgumentCoders_h
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -1528,8 +1528,6 @@
</span><span class="cx">                 E152551B17011819003D7ADB /* NetworkResourceLoaderMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = E152551917011819003D7ADB /* NetworkResourceLoaderMessages.h */; };
</span><span class="cx">                 E170876B16D6CA6900F99226 /* BlobRegistryProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E170876916D6CA6900F99226 /* BlobRegistryProxy.cpp */; };
</span><span class="cx">                 E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = E170876A16D6CA6900F99226 /* BlobRegistryProxy.h */; };
</span><del>-                E170877016D6CFE500F99226 /* BlobRegistrationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E170876E16D6CFE400F99226 /* BlobRegistrationData.cpp */; };
-                E170877116D6CFE500F99226 /* BlobRegistrationData.h in Headers */ = {isa = PBXBuildFile; fileRef = E170876F16D6CFE500F99226 /* BlobRegistrationData.h */; };
</del><span class="cx">                 E179088D169BAA62006904C7 /* SecItemShim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E6947169B77C8009B6670 /* SecItemShim.cpp */; };
</span><span class="cx">                 E179088F169BAA6A006904C7 /* SecItemShim.h in Headers */ = {isa = PBXBuildFile; fileRef = E18E6948169B77C8009B6670 /* SecItemShim.h */; };
</span><span class="cx">                 E1790890169BAA7F006904C7 /* SecItemShimMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E6911169B667B009B6670 /* SecItemShimMessageReceiver.cpp */; };
</span><span class="lines">@@ -3440,7 +3438,7 @@
</span><span class="cx">                 DF58C6311371AC5800F9A37C /* NativeWebWheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebWheelEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 DF58C6351371ACA000F9A37C /* NativeWebWheelEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeWebWheelEventMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E105FE5318D7B9DE008F57A8 /* EditingRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingRange.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E115C715190F8A2500ECC516 /* com.apple.WebKit.Databases.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = com.apple.WebKit.Databases.sb; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                E115C715190F8A2500ECC516 /* com.apple.WebKit.Databases.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebKit.Databases.sb; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E133FD891423DD7F00FC7BFB /* WebKit.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = WebKit.icns; path = Resources/WebKit.icns; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E13833EB189C33C8001E2350 /* LocalStorageDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorageDetails.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E14A954716E016A40068DE82 /* NetworkProcessPlatformStrategies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessPlatformStrategies.cpp; path = NetworkProcess/NetworkProcessPlatformStrategies.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3452,8 +3450,6 @@
</span><span class="cx">                 E152551917011819003D7ADB /* NetworkResourceLoaderMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkResourceLoaderMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E170876916D6CA6900F99226 /* BlobRegistryProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlobRegistryProxy.cpp; path = WebProcess/FileAPI/BlobRegistryProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E170876A16D6CA6900F99226 /* BlobRegistryProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlobRegistryProxy.h; path = WebProcess/FileAPI/BlobRegistryProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E170876E16D6CFE400F99226 /* BlobRegistrationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlobRegistrationData.cpp; path = FileAPI/BlobRegistrationData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E170876F16D6CFE500F99226 /* BlobRegistrationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlobRegistrationData.h; path = FileAPI/BlobRegistrationData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 E1798C7716E6818800240139 /* NetworkBlobRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkBlobRegistry.cpp; path = NetworkProcess/FileAPI/NetworkBlobRegistry.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1798C7816E6818800240139 /* NetworkBlobRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkBlobRegistry.h; path = NetworkProcess/FileAPI/NetworkBlobRegistry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E179FD9B134D38060015B883 /* ArgumentCodersMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArgumentCodersMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -6577,8 +6573,6 @@
</span><span class="cx">                 E170877216D6CFEC00F99226 /* FileAPI */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                E170876E16D6CFE400F99226 /* BlobRegistrationData.cpp */,
-                                E170876F16D6CFE500F99226 /* BlobRegistrationData.h */,
</del><span class="cx">                         );
</span><span class="cx">                         name = FileAPI;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -6670,7 +6664,6 @@
</span><span class="cx">                                 512F589912A8838800629530 /* AuthenticationDecisionListener.h in Headers */,
</span><span class="cx">                                 518E8EF916B2091C00E91429 /* AuthenticationManager.h in Headers */,
</span><span class="cx">                                 512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */,
</span><del>-                                E170877116D6CFE500F99226 /* BlobRegistrationData.h in Headers */,
</del><span class="cx">                                 E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */,
</span><span class="cx">                                 4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */,
</span><span class="cx">                                 51E351CB180F2CCC00E53BE9 /* IDBUtilities.h in Headers */,
</span><span class="lines">@@ -8154,7 +8147,6 @@
</span><span class="cx">                                 518E8EF816B2091C00E91429 /* AuthenticationManager.cpp in Sources */,
</span><span class="cx">                                 518E8EFB16B2091C00E91429 /* AuthenticationManager.mac.mm in Sources */,
</span><span class="cx">                                 512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */,
</span><del>-                                E170877016D6CFE500F99226 /* BlobRegistrationData.cpp in Sources */,
</del><span class="cx">                                 E170876B16D6CA6900F99226 /* BlobRegistryProxy.cpp in Sources */,
</span><span class="cx">                                 BCF18638167D071E00A1A85A /* CacheModel.cpp in Sources */,
</span><span class="cx">                                 1AA2E51E12E4C05E00BC4966 /* CGUtilities.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -28,23 +28,34 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BLOB) &amp;&amp; ENABLE(NETWORK_PROCESS)
</span><span class="cx"> 
</span><del>-#include &quot;BlobRegistrationData.h&quot;
</del><span class="cx"> #include &quot;NetworkConnectionToWebProcessMessages.h&quot;
</span><span class="cx"> #include &quot;NetworkProcessConnection.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><del>-#include &lt;WebCore/BlobData.h&gt;
</del><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-unsigned long long BlobRegistryProxy::registerBlobURL(const URL&amp; url, std::unique_ptr&lt;BlobData&gt; blobData)
</del><ins>+void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL&amp; url, const String&amp; path, const String&amp; contentType)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(WebProcess::shared().usesNetworkProcess());
</span><span class="cx"> 
</span><ins>+    SandboxExtension::Handle extensionHandle;
+
+    // File path can be empty when submitting a form file input without a file, see bug 111778.
+    if (!path.isEmpty())
+        SandboxExtension::createHandle(path, SandboxExtension::ReadOnly, extensionHandle);
+
+    WebProcess::shared().networkConnection()-&gt;connection()-&gt;send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, path, extensionHandle, contentType), 0);
+}
+
+unsigned long long BlobRegistryProxy::registerBlobURL(const URL&amp; url, Vector&lt;BlobPart&gt; blobParts, const String&amp; contentType)
+{
+    ASSERT(WebProcess::shared().usesNetworkProcess());
+
</ins><span class="cx">     uint64_t resultSize;
</span><del>-    if (!WebProcess::shared().networkConnection()-&gt;connection()-&gt;sendSync(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, BlobRegistrationData(std::move(blobData))), Messages::NetworkConnectionToWebProcess::RegisterBlobURL::Reply(resultSize), 0))
</del><ins>+    if (!WebProcess::shared().networkConnection()-&gt;connection()-&gt;sendSync(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), Messages::NetworkConnectionToWebProcess::RegisterBlobURL::Reply(resultSize), 0))
</ins><span class="cx">         return 0;
</span><span class="cx">     return resultSize;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h (168332 => 168333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2014-05-06 00:29:38 UTC (rev 168332)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2014-05-06 00:42:52 UTC (rev 168333)
</span><span class="lines">@@ -32,9 +32,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class BlobRegistryProxy : public WebCore::BlobRegistry {
</del><ins>+class BlobRegistryProxy final : public WebCore::BlobRegistry {
</ins><span class="cx"> public:
</span><del>-    virtual unsigned long long registerBlobURL(const WebCore::URL&amp;, std::unique_ptr&lt;WebCore::BlobData&gt;) override;
</del><ins>+    virtual void registerFileBlobURL(const WebCore::URL&amp;, const String&amp; path, const String&amp; contentType) override;
+    virtual unsigned long long registerBlobURL(const WebCore::URL&amp;, Vector&lt;WebCore::BlobPart&gt;, const String&amp; contentType) override;
</ins><span class="cx">     virtual void registerBlobURL(const WebCore::URL&amp;, const WebCore::URL&amp; srcURL) override;
</span><span class="cx">     virtual void unregisterBlobURL(const WebCore::URL&amp;) override;
</span><span class="cx">     virtual unsigned long long registerBlobURLForSlice(const WebCore::URL&amp;, const WebCore::URL&amp; srcURL, long long start, long long end) override;
</span></span></pre>
</div>
</div>

</body>
</html>