<!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>[168391] trunk/Source/WebCore</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/168391">168391</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2014-05-06 16:34:35 -0700 (Tue, 06 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make BlobDataItem use a refcounted object for files
https://bugs.webkit.org/show_bug.cgi?id=132628

Reviewed by Anders Carlsson.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Added BlobDataFileReference.{h|cpp}

* WebCore.exp.in: Removed unused exports.

* platform/network/BlobData.h:
(WebCore::BlobDataItem::offset):
(WebCore::BlobDataItem::BlobDataItem):
Use a wrapper class for files, not a path. Changed to be more class-like accordingly.

* platform/network/BlobData.cpp:
(WebCore::BlobData::appendData):
(WebCore::BlobData::appendFile):
(WebCore::BlobData::appendBlob): Deleted.
(WebCore::BlobData::BlobData): Deleted.
We never add blobs to BlobData, they are always resolved to data of file references.
Lots of very confusing code to delete.

* platform/network/BlobDataFileReference.h: Added.
* platform/network/BlobDataFileReference.cpp: Added.
(WebCore::BlobDataFileReference::size):
(WebCore::BlobDataFileReference::expectedModificationTime):
(WebCore::BlobDataFileReference::computeFileSystemData):
A unique reference to a file referenced by blob, to be preserved when you slice
or combine blobs.

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::appendStorageItems):
(WebCore::BlobRegistryImpl::registerFileBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::blobSize):
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::getSizeForNext):
(WebCore::BlobResourceHandle::didGetSize):
(WebCore::BlobResourceHandle::readDataSync):
(WebCore::BlobResourceHandle::readFileSync):
(WebCore::BlobResourceHandle::readDataAsync):
(WebCore::BlobResourceHandle::readFileAsync):
* platform/network/BlobResourceHandle.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
Updated for BlobDataItem interface changes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp">trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp">trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandleh">trunk/Source/WebCore/platform/network/BlobResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkFormDatacpp">trunk/Source/WebCore/platform/network/FormData.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobDataFileReferencecpp">trunk/Source/WebCore/platform/network/BlobDataFileReference.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobDataFileReferenceh">trunk/Source/WebCore/platform/network/BlobDataFileReference.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -2171,6 +2171,7 @@
</span><span class="cx"> 
</span><span class="cx">     platform/network/AuthenticationChallengeBase.cpp
</span><span class="cx">     platform/network/BlobData.cpp
</span><ins>+    platform/network/BlobDataFileReference.cpp
</ins><span class="cx">     platform/network/BlobRegistry.cpp
</span><span class="cx">     platform/network/BlobRegistryImpl.cpp
</span><span class="cx">     platform/network/BlobResourceHandle.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/ChangeLog        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2014-05-06  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        Make BlobDataItem use a refcounted object for files
+        https://bugs.webkit.org/show_bug.cgi?id=132628
+
+        Reviewed by Anders Carlsson.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        Added BlobDataFileReference.{h|cpp}
+
+        * WebCore.exp.in: Removed unused exports.
+
+        * platform/network/BlobData.h:
+        (WebCore::BlobDataItem::offset):
+        (WebCore::BlobDataItem::BlobDataItem):
+        Use a wrapper class for files, not a path. Changed to be more class-like accordingly.
+
+        * platform/network/BlobData.cpp:
+        (WebCore::BlobData::appendData):
+        (WebCore::BlobData::appendFile):
+        (WebCore::BlobData::appendBlob): Deleted.
+        (WebCore::BlobData::BlobData): Deleted.
+        We never add blobs to BlobData, they are always resolved to data of file references.
+        Lots of very confusing code to delete.
+
+        * platform/network/BlobDataFileReference.h: Added.
+        * platform/network/BlobDataFileReference.cpp: Added.
+        (WebCore::BlobDataFileReference::size):
+        (WebCore::BlobDataFileReference::expectedModificationTime):
+        (WebCore::BlobDataFileReference::computeFileSystemData):
+        A unique reference to a file referenced by blob, to be preserved when you slice
+        or combine blobs.
+
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::appendStorageItems):
+        (WebCore::BlobRegistryImpl::registerFileBlobURL):
+        (WebCore::BlobRegistryImpl::registerBlobURL):
+        (WebCore::BlobRegistryImpl::blobSize):
+        * platform/network/BlobResourceHandle.cpp:
+        (WebCore::BlobResourceHandle::getSizeForNext):
+        (WebCore::BlobResourceHandle::didGetSize):
+        (WebCore::BlobResourceHandle::readDataSync):
+        (WebCore::BlobResourceHandle::readFileSync):
+        (WebCore::BlobResourceHandle::readDataAsync):
+        (WebCore::BlobResourceHandle::readFileAsync):
+        * platform/network/BlobResourceHandle.h:
+        * platform/network/FormData.cpp:
+        (WebCore::appendBlobResolved):
+        Updated for BlobDataItem interface changes.
+
</ins><span class="cx"> 2014-05-06  Christophe Dumez  &lt;ch.dumez@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [HTML] Default argument to HTMLTableRowElement.insertCell() should be -1
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -1228,7 +1228,6 @@
</span><span class="cx"> __ZN7WebCore7toInt64EPN3JSC9ExecStateENS0_7JSValueENS_30IntegerConversionConfigurationE
</span><span class="cx"> __ZN7WebCore7toRangeEN3JSC7JSValueE
</span><span class="cx"> __ZN7WebCore7toUInt8EPN3JSC9ExecStateENS0_7JSValueENS_30IntegerConversionConfigurationE
</span><del>-__ZN7WebCore8BlobData10appendBlobERKNS_3URLExx
</del><span class="cx"> __ZN7WebCore8BlobData14setContentTypeERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore8CSSValue7destroyEv
</span><span class="cx"> __ZN7WebCore8Document11createRangeEv
</span><span class="lines">@@ -2842,12 +2841,9 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BLOB)
</span><del>-__ZN7WebCore12BlobDataItem11toEndOfFileE
</del><span class="cx"> __ZN7WebCore12BlobRegistryD2Ev
</span><span class="cx"> __ZN7WebCore12blobRegistryEv
</span><span class="cx"> __ZN7WebCore14LoaderStrategy18createBlobRegistryEv
</span><del>-__ZN7WebCore8BlobData10appendDataEN3WTF10PassRefPtrINS_7RawDataEEExx
-__ZN7WebCore8BlobData10appendFileERKN3WTF6StringExxd
</del><span class="cx"> __ZTVN7WebCore12BlobRegistryE
</span><span class="cx"> __ZTVN7WebCore16BlobRegistryImplE
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -8373,6 +8373,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\avfoundation\cf\MediaPlayerPrivateAVFoundationCF.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\network\AuthenticationChallengeBase.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\network\BlobData.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\network\BlobDataFileReference.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\network\BlobResourceHandle.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\network\Credential.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\network\CredentialStorage.cpp&quot; /&gt;
</span><span class="lines">@@ -19564,6 +19565,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\AuthenticationChallengeBase.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\AuthenticationClient.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\BlobData.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\platform\network\BlobDataFileReference.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\BlobRegistry.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\BlobRegistryImpl.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\BlobResourceHandle.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -1764,6 +1764,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\network\BlobData.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\network&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\network\BlobDataFileReference.cpp&quot;&gt;
+      &lt;Filter&gt;platform\network&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\network\BlobResourceHandle.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\network&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -8650,6 +8653,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\BlobData.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\network&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\platform\network\BlobDataFileReference.h&quot;&gt;
+      &lt;Filter&gt;platform\network&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\BlobRegistry.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\network&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -5968,6 +5968,8 @@
</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="cx">                 E1CDE9221501916900862CC5 /* AsyncFileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CDE9211501916900862CC5 /* AsyncFileStream.h */; settings = {ATTRIBUTES = (); }; };
</span><ins>+                E1D31CDC19196020001005A3 /* BlobDataFileReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1D31CDA19196020001005A3 /* BlobDataFileReference.cpp */; };
+                E1D31CDD19196020001005A3 /* BlobDataFileReference.h in Headers */ = {isa = PBXBuildFile; fileRef = E1D31CDB19196020001005A3 /* BlobDataFileReference.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */; };
</span><span class="cx">                 E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */; };
</span><span class="lines">@@ -13374,6 +13376,8 @@
</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="cx">                 E1CDE9211501916900862CC5 /* AsyncFileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncFileStream.h; path = fileapi/AsyncFileStream.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E1D31CDA19196020001005A3 /* BlobDataFileReference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobDataFileReference.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E1D31CDB19196020001005A3 /* BlobDataFileReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobDataFileReference.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowsKeyboardCodes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSHTMLSelectElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16055,6 +16059,8 @@
</span><span class="cx">                                 E124748310AA161D00B79493 /* AuthenticationClient.h */,
</span><span class="cx">                                 2EDEF1ED121B0EFC00726DB2 /* BlobData.cpp */,
</span><span class="cx">                                 2EDEF1EE121B0EFC00726DB2 /* BlobData.h */,
</span><ins>+                                E1D31CDA19196020001005A3 /* BlobDataFileReference.cpp */,
+                                E1D31CDB19196020001005A3 /* BlobDataFileReference.h */,
</ins><span class="cx">                                 E1C94AF7191303F000D5A893 /* BlobPart.h */,
</span><span class="cx">                                 E14A94D616DFDF950068DE82 /* BlobRegistry.cpp */,
</span><span class="cx">                                 2EDEF1EF121B0EFC00726DB2 /* BlobRegistry.h */,
</span><span class="lines">@@ -22945,6 +22951,7 @@
</span><span class="cx">                         isa = PBXHeadersBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                E1D31CDD19196020001005A3 /* BlobDataFileReference.h in Headers */,
</ins><span class="cx">                                 FE115FAB167988CD00249134 /* AbstractDatabaseServer.h in Headers */,
</span><span class="cx">                                 CD2F4A2418D89F700063746D /* AudioHardwareListener.h in Headers */,
</span><span class="cx">                                 FE4AADEE16D2C37400026FFC /* AbstractSQLStatement.h in Headers */,
</span><span class="lines">@@ -29400,6 +29407,7 @@
</span><span class="cx">                                 FD7F299313D4C0CB00AD9535 /* WaveShaperNode.cpp in Sources */,
</span><span class="cx">                                 FD7F299613D4C0CB00AD9535 /* WaveShaperProcessor.cpp in Sources */,
</span><span class="cx">                                 29A8124A0FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.mm in Sources */,
</span><ins>+                                E1D31CDC19196020001005A3 /* BlobDataFileReference.cpp in Sources */,
</ins><span class="cx">                                 AAA728F816D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm in Sources */,
</span><span class="cx">                                 AA478A8016CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.mm in Sources */,
</span><span class="cx">                                 A56C5B9A189F34570082D13C /* WebConsoleAgent.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobData.cpp (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobData.cpp        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/platform/network/BlobData.cpp        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Blob.h&quot;
</span><span class="cx"> #include &quot;BlobURL.h&quot;
</span><del>-#include &quot;ThreadableBlobRegistry.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><span class="lines">@@ -45,12 +44,34 @@
</span><span class="cx"> 
</span><span class="cx"> const long long BlobDataItem::toEndOfFile = -1;
</span><span class="cx"> 
</span><ins>+long long BlobDataItem::length() const
+{
+    if (m_length != toEndOfFile)
+        return m_length;
+
+    switch (type) {
+    case Data:
+        ASSERT_NOT_REACHED();
+        return m_length;
+    case File:
+        return file-&gt;size();
+    }
+
+    ASSERT_NOT_REACHED();
+    return m_length;
+}
+
</ins><span class="cx"> void BlobData::setContentType(const String&amp; contentType)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(Blob::isNormalizedContentType(contentType));
</span><span class="cx">     m_contentType = contentType;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void BlobData::appendData(PassRefPtr&lt;RawData&gt; data)
+{
+    appendData(data, 0, data-&gt;length());
+}
+
</ins><span class="cx"> void BlobData::appendData(PassRefPtr&lt;RawData&gt; data, long long offset, long long length)
</span><span class="cx"> {
</span><span class="cx">     m_items.append(BlobDataItem(data, offset, length));
</span><span class="lines">@@ -61,16 +82,11 @@
</span><span class="cx">     m_items.append(BlobDataItem(path));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobData::appendFile(const String&amp; path, long long offset, long long length, double expectedModificationTime)
</del><ins>+void BlobData::appendFile(BlobDataFileReference* file, long long offset, long long length)
</ins><span class="cx"> {
</span><del>-    m_items.append(BlobDataItem(path, offset, length, expectedModificationTime));
</del><ins>+    m_items.append(BlobDataItem(file, offset, length));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobData::appendBlob(const URL&amp; url, long long offset, long long length)
-{
-    m_items.append(BlobDataItem(url, offset, length));
-}
-
</del><span class="cx"> void BlobData::swapItems(BlobDataItemList&amp; items)
</span><span class="cx"> {
</span><span class="cx">     m_items.swap(items);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobData.h (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobData.h        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/platform/network/BlobData.h        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -31,18 +31,16 @@
</span><span class="cx"> #ifndef BlobData_h
</span><span class="cx"> #define BlobData_h
</span><span class="cx"> 
</span><del>-#include &quot;FileSystem.h&quot;
</del><ins>+#include &quot;BlobDataFileReference.h&quot;
</ins><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><del>-#include &lt;wtf/ThreadSafeRefCounted.h&gt;
</del><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>-// FIXME: RawData doesn't need to be ThreadSafeRefCounted any more. We can probably switch to another data buffer type now.
-class RawData : public ThreadSafeRefCounted&lt;RawData&gt; {
</del><ins>+class RawData : public RefCounted&lt;RawData&gt; {
</ins><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;RawData&gt; create(Vector&lt;char&gt;&amp;&amp; data)
</span><span class="cx">     {
</span><span class="lines">@@ -71,86 +69,49 @@
</span><span class="cx"> struct BlobDataItem {
</span><span class="cx">     static const long long toEndOfFile;
</span><span class="cx"> 
</span><del>-    // Default constructor.
-    BlobDataItem()
-        : type(Data)
-        , offset(0)
-        , length(toEndOfFile)
-        , expectedModificationTime(invalidFileTime())
-    {
-    }
-
-    // Constructor for String type (complete string).
-    explicit BlobDataItem(PassRefPtr&lt;RawData&gt; data)
-        : type(Data)
-        , data(data)
-        , offset(0)
-        , length(toEndOfFile)
-        , expectedModificationTime(invalidFileTime())
-    {
-    }
-
-    // Constructor for File type (complete file).
-    explicit BlobDataItem(const String&amp; path)
-        : type(File)
-        , path(path)
-        , offset(0)
-        , length(toEndOfFile)
-        , expectedModificationTime(invalidFileTime())
-    {
-    }
-
-    // Constructor for File type (partial file).
-    BlobDataItem(const String&amp; path, long long offset, long long length, double expectedModificationTime)
-        : type(File)
-        , path(path)
-        , offset(offset)
-        , length(length)
-        , expectedModificationTime(expectedModificationTime)
-    {
-    }
-
-    // Constructor for Blob type.
-    BlobDataItem(const URL&amp; url, long long offset, long long length)
-        : type(Blob)
-        , url(url)
-        , offset(offset)
-        , length(length)
-        , expectedModificationTime(invalidFileTime())
-    {
-    }
-
</del><span class="cx">     enum {
</span><span class="cx">         Data,
</span><del>-        File,
-        Blob
</del><ins>+        File
</ins><span class="cx">     } type;
</span><span class="cx"> 
</span><span class="cx">     // For Data type.
</span><span class="cx">     RefPtr&lt;RawData&gt; data;
</span><span class="cx"> 
</span><span class="cx">     // For File type.
</span><del>-    String path;
</del><ins>+    RefPtr&lt;BlobDataFileReference&gt; file;
</ins><span class="cx"> 
</span><del>-    // For Blob or URL type.
-    URL url;
</del><ins>+    long long offset() const { return m_offset; }
+    long long length() const; // Computes file length if it's not known yet.
</ins><span class="cx"> 
</span><del>-    long long offset;
-    long long length;
-    double expectedModificationTime;
-
</del><span class="cx"> private:
</span><span class="cx">     friend class BlobData;
</span><span class="cx"> 
</span><del>-    // Constructor for String type (partial string).
</del><ins>+    explicit BlobDataItem(const String&amp; path)
+        : type(File)
+        , file(BlobDataFileReference::create(path))
+        , m_offset(0)
+        , m_length(toEndOfFile)
+    {
+    }
+
</ins><span class="cx">     BlobDataItem(PassRefPtr&lt;RawData&gt; data, long long offset, long long length)
</span><span class="cx">         : type(Data)
</span><span class="cx">         , data(data)
</span><del>-        , offset(offset)
-        , length(length)
-        , expectedModificationTime(invalidFileTime())
</del><ins>+        , m_offset(offset)
+        , m_length(length)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><ins>+
+    BlobDataItem(BlobDataFileReference* file, long long offset, long long length)
+        : type(File)
+        , file(file)
+        , m_offset(offset)
+        , m_length(length)
+    {
+    }
+
+    long long m_offset;
+    long long m_length;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef Vector&lt;BlobDataItem&gt; BlobDataItemList;
</span><span class="lines">@@ -168,18 +129,16 @@
</span><span class="cx">     const BlobDataItemList&amp; items() const { return m_items; }
</span><span class="cx">     void swapItems(BlobDataItemList&amp;);
</span><span class="cx"> 
</span><del>-    void appendData(PassRefPtr&lt;RawData&gt;, long long offset, long long length);
</del><ins>+    void appendData(PassRefPtr&lt;RawData&gt;);
</ins><span class="cx">     void appendFile(const String&amp; path);
</span><del>-    void appendFile(const String&amp; path, long long offset, long long length, double expectedModificationTime);
-    void appendBlob(const URL&amp;, long long offset, long long length);
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class BlobRegistryImpl;
</span><span class="cx"> 
</span><del>-    BlobData() { }
</del><ins>+    void appendData(PassRefPtr&lt;RawData&gt;, long long offset, long long length);
+    void appendFile(BlobDataFileReference*, long long offset, long long length);
</ins><span class="cx"> 
</span><span class="cx">     String m_contentType;
</span><del>-    String m_contentDisposition;
</del><span class="cx">     BlobDataItemList m_items;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDataFileReferencecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/BlobDataFileReference.cpp (0 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobDataFileReference.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/network/BlobDataFileReference.cpp        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -0,0 +1,61 @@
</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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;BlobDataFileReference.h&quot;
+
+#include &quot;FileMetadata.h&quot;
+
+namespace WebCore {
+
+unsigned long long BlobDataFileReference::size() const
+{
+    if (!m_fileSystemDataComputed)
+        computeFileSystemData();
+
+    return m_size;
+}
+
+double BlobDataFileReference::expectedModificationTime() const
+{
+    if (!m_fileSystemDataComputed)
+        computeFileSystemData();
+
+    return m_expectedModificationTime;
+}
+
+void BlobDataFileReference::computeFileSystemData() const
+{
+    m_fileSystemDataComputed = true;
+
+    FileMetadata metadata;
+    if (!getFileMetadata(m_path, metadata))
+        return;
+
+    m_size = metadata.length;
+    m_expectedModificationTime = metadata.modificationTime;
+}
+
+}
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/network/BlobDataFileReference.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDataFileReferenceh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/BlobDataFileReference.h (0 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobDataFileReference.h                                (rev 0)
+++ trunk/Source/WebCore/platform/network/BlobDataFileReference.h        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -0,0 +1,67 @@
</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 BlobDataFileReference_h
+#define BlobDataFileReference_h
+
+#include &quot;FileSystem.h&quot;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class BlobDataFileReference : public RefCounted&lt;BlobDataFileReference&gt; {
+public:
+    static PassRefPtr&lt;BlobDataFileReference&gt; create(const String&amp; path)
+    {
+        return adoptRef(new BlobDataFileReference(path));
+    }
+
+    const String&amp; path() const { return m_path; }
+    unsigned long long size() const;
+    double expectedModificationTime() const;
+
+private:
+    BlobDataFileReference(const String&amp; path)
+        : m_path(path)
+        , m_fileSystemDataComputed(false)
+        , m_size(0)
+        , m_expectedModificationTime(invalidFileTime())
+    {
+        // FIXME: Per the spec, a File object should start watching for changes as soon as it's created, so we should record m_expectedModificationTime right away.
+        // FIXME: Some platforms provide better ways to listen for file system object changes, consider using these.
+    }
+
+    void computeFileSystemData() const;
+
+    String m_path;
+    mutable bool m_fileSystemDataComputed;
+    mutable unsigned long long m_size;
+    mutable double m_expectedModificationTime;
+};
+
+}
+
+#endif // BlobDataFileReference_h
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/network/BlobDataFileReference.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="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -94,22 +94,21 @@
</span><span class="cx">     BlobDataItemList::const_iterator iter = items.begin();
</span><span class="cx">     if (offset) {
</span><span class="cx">         for (; iter != items.end(); ++iter) {
</span><del>-            if (offset &gt;= iter-&gt;length)
-                offset -= iter-&gt;length;
</del><ins>+            if (offset &gt;= iter-&gt;length())
+                offset -= iter-&gt;length();
</ins><span class="cx">             else
</span><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (; iter != items.end() &amp;&amp; length &gt; 0; ++iter) {
</span><del>-        ASSERT(iter-&gt;length != BlobDataItem::toEndOfFile);
-        long long currentLength = iter-&gt;length - offset;
</del><ins>+        long long currentLength = iter-&gt;length() - offset;
</ins><span class="cx">         long long newLength = currentLength &gt; length ? length : currentLength;
</span><span class="cx">         if (iter-&gt;type == BlobDataItem::Data)
</span><del>-            blobData-&gt;appendData(iter-&gt;data, iter-&gt;offset + offset, newLength);
</del><ins>+            blobData-&gt;appendData(iter-&gt;data, iter-&gt;offset() + offset, newLength);
</ins><span class="cx">         else {
</span><span class="cx">             ASSERT(iter-&gt;type == BlobDataItem::File);
</span><del>-            blobData-&gt;appendFile(iter-&gt;path, iter-&gt;offset + offset, newLength, iter-&gt;expectedModificationTime);
</del><ins>+            blobData-&gt;appendFile(iter-&gt;file.get(), iter-&gt;offset() + offset, newLength);
</ins><span class="cx">         }
</span><span class="cx">         length -= newLength;
</span><span class="cx">         offset = 0;
</span><span class="lines">@@ -125,12 +124,7 @@
</span><span class="cx">     RefPtr&lt;BlobData&gt; blobData = BlobData::create();
</span><span class="cx">     blobData-&gt;setContentType(contentType);
</span><span class="cx"> 
</span><del>-    // FIXME: Factor out size and modification tracking for a cleaner implementation.
-    FileMetadata metadata;
-    if (!getFileMetadata(path, metadata))
-        return;
-
-    blobData-&gt;appendFile(path, 0, metadata.length, metadata.modificationTime);
</del><ins>+    blobData-&gt;appendFile(path);
</ins><span class="cx">     m_blobs.set(url.string(), blobData.release());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -161,9 +155,9 @@
</span><span class="cx">         case BlobPart::Blob: {
</span><span class="cx">             if (!m_blobs.contains(part.url().string()))
</span><span class="cx">                 return 0;
</span><del>-            unsigned long long partSize = blobSize(part.url()); // As a side effect, this calculates sizes of all files in the blob.
-            size += partSize;
-            appendStorageItems(blobData.get(), m_blobs.get(part.url().string())-&gt;items(), 0, partSize);
</del><ins>+            size += blobSize(part.url());
+            for (const BlobDataItem&amp; item : m_blobs.get(part.url().string())-&gt;items())
+                blobData-&gt;m_items.append(item);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         }
</span><span class="lines">@@ -242,18 +236,9 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     unsigned long long result = 0;
</span><del>-    for (const BlobDataItem&amp; item : data-&gt;items()) {
-        if (item.length == BlobDataItem::toEndOfFile) {
-            FileMetadata metadata;
-            if (!getFileMetadata(item.path, metadata))
-                return 0;
</del><ins>+    for (const BlobDataItem&amp; item : data-&gt;items())
+        result += item.length();
</ins><span class="cx"> 
</span><del>-            // FIXME: Factor out size and modification tracking for a cleaner implementation.
-            const_cast&lt;BlobDataItem&amp;&gt;(item).length = metadata.length;
-            const_cast&lt;BlobDataItem&amp;&gt;(item).expectedModificationTime = metadata.modificationTime;
-        }
-        result += item.length;
-    }
</del><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -276,13 +276,14 @@
</span><span class="cx">     const BlobDataItem&amp; item = m_blobData-&gt;items().at(m_sizeItemCount);
</span><span class="cx">     switch (item.type) {
</span><span class="cx">     case BlobDataItem::Data:
</span><del>-        didGetSize(item.length);
</del><ins>+        didGetSize(item.length());
</ins><span class="cx">         break;
</span><span class="cx">     case BlobDataItem::File:
</span><ins>+        // Files know their sizes, but asking the stream to verify that the file wasn't modified.
</ins><span class="cx">         if (m_async)
</span><del>-            m_asyncStream-&gt;getSize(item.path, item.expectedModificationTime);
</del><ins>+            m_asyncStream-&gt;getSize(item.file-&gt;path(), item.file-&gt;expectedModificationTime());
</ins><span class="cx">         else
</span><del>-            didGetSize(m_stream-&gt;getSize(item.path, item.expectedModificationTime));
</del><ins>+            didGetSize(m_stream-&gt;getSize(item.file-&gt;path(), item.file-&gt;expectedModificationTime()));
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -306,8 +307,7 @@
</span><span class="cx"> 
</span><span class="cx">     // The size passed back is the size of the whole file. If the underlying item is a sliced file, we need to use the slice length.
</span><span class="cx">     const BlobDataItem&amp; item = m_blobData-&gt;items().at(m_sizeItemCount);
</span><del>-    if (item.type == BlobDataItem::File &amp;&amp; item.length != BlobDataItem::toEndOfFile)
-        size = item.length;
</del><ins>+    size = item.length();
</ins><span class="cx"> 
</span><span class="cx">     // Cache the size.
</span><span class="cx">     m_itemLengthList.append(size);
</span><span class="lines">@@ -405,15 +405,15 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!m_async);
</span><span class="cx"> 
</span><del>-    long long remaining = item.length - m_currentItemReadSize;
</del><ins>+    long long remaining = item.length() - m_currentItemReadSize;
</ins><span class="cx">     int bytesToRead = (length &gt; remaining) ? static_cast&lt;int&gt;(remaining) : length;
</span><span class="cx">     if (bytesToRead &gt; m_totalRemainingSize)
</span><span class="cx">         bytesToRead = static_cast&lt;int&gt;(m_totalRemainingSize);
</span><del>-    memcpy(buf, item.data-&gt;data() + item.offset + m_currentItemReadSize, bytesToRead);
</del><ins>+    memcpy(buf, item.data-&gt;data() + item.offset() + m_currentItemReadSize, bytesToRead);
</ins><span class="cx">     m_totalRemainingSize -= bytesToRead;
</span><span class="cx"> 
</span><span class="cx">     m_currentItemReadSize += bytesToRead;
</span><del>-    if (m_currentItemReadSize == item.length) {
</del><ins>+    if (m_currentItemReadSize == item.length()) {
</ins><span class="cx">         m_readItemCount++;
</span><span class="cx">         m_currentItemReadSize = 0;
</span><span class="cx">     }
</span><span class="lines">@@ -431,7 +431,7 @@
</span><span class="cx">         long long bytesToRead = m_itemLengthList[m_readItemCount] - m_currentItemReadSize;
</span><span class="cx">         if (bytesToRead &gt; m_totalRemainingSize)
</span><span class="cx">             bytesToRead = m_totalRemainingSize;
</span><del>-        bool success = m_stream-&gt;openForRead(item.path, item.offset + m_currentItemReadSize, bytesToRead);
</del><ins>+        bool success = m_stream-&gt;openForRead(item.file-&gt;path(), item.offset() + m_currentItemReadSize, bytesToRead);
</ins><span class="cx">         m_currentItemReadSize = 0;
</span><span class="cx">         if (!success) {
</span><span class="cx">             m_errorCode = notReadableError;
</span><span class="lines">@@ -486,10 +486,10 @@
</span><span class="cx">     ASSERT(m_async);
</span><span class="cx">     Ref&lt;BlobResourceHandle&gt; protect(*this);
</span><span class="cx"> 
</span><del>-    long long bytesToRead = item.length - m_currentItemReadSize;
</del><ins>+    long long bytesToRead = item.length() - m_currentItemReadSize;
</ins><span class="cx">     if (bytesToRead &gt; m_totalRemainingSize)
</span><span class="cx">         bytesToRead = m_totalRemainingSize;
</span><del>-    consumeData(item.data-&gt;data() + item.offset + m_currentItemReadSize, static_cast&lt;int&gt;(bytesToRead));
</del><ins>+    consumeData(item.data-&gt;data() + item.offset() + m_currentItemReadSize, static_cast&lt;int&gt;(bytesToRead));
</ins><span class="cx">     m_currentItemReadSize = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -506,7 +506,7 @@
</span><span class="cx">     long long bytesToRead = m_itemLengthList[m_readItemCount] - m_currentItemReadSize;
</span><span class="cx">     if (bytesToRead &gt; m_totalRemainingSize)
</span><span class="cx">         bytesToRead = static_cast&lt;int&gt;(m_totalRemainingSize);
</span><del>-    m_asyncStream-&gt;openForRead(item.path, item.offset + m_currentItemReadSize, bytesToRead);
</del><ins>+    m_asyncStream-&gt;openForRead(item.file-&gt;path(), item.offset() + m_currentItemReadSize, bytesToRead);
</ins><span class="cx">     m_fileOpened = true;
</span><span class="cx">     m_currentItemReadSize = 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.h (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.h        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.h        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;BlobResourceHandle&gt; createAsync(BlobData*, const ResourceRequest&amp;, ResourceHandleClient*);
</span><span class="cx"> 
</span><del>-    static void loadResourceSynchronously(BlobData* blobData, const ResourceRequest&amp; request, ResourceError&amp; error, ResourceResponse&amp; response, Vector&lt;char&gt;&amp; data);
</del><ins>+    static void loadResourceSynchronously(BlobData*, const ResourceRequest&amp;, ResourceError&amp;, ResourceResponse&amp;, Vector&lt;char&gt;&amp; data);
</ins><span class="cx"> 
</span><span class="cx">     // FileStreamClient methods.
</span><span class="cx">     virtual void didGetSize(long long) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkFormDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/FormData.cpp (168390 => 168391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/FormData.cpp        2014-05-06 23:32:51 UTC (rev 168390)
+++ trunk/Source/WebCore/platform/network/FormData.cpp        2014-05-06 23:34:35 UTC (rev 168391)
</span><span class="lines">@@ -312,11 +312,9 @@
</span><span class="cx">     for (; it != itend; ++it) {
</span><span class="cx">         const BlobDataItem&amp; blobItem = *it;
</span><span class="cx">         if (blobItem.type == BlobDataItem::Data)
</span><del>-            formData-&gt;appendData(blobItem.data-&gt;data() + static_cast&lt;int&gt;(blobItem.offset), static_cast&lt;int&gt;(blobItem.length));
</del><ins>+            formData-&gt;appendData(blobItem.data-&gt;data() + static_cast&lt;int&gt;(blobItem.offset()), static_cast&lt;int&gt;(blobItem.length()));
</ins><span class="cx">         else if (blobItem.type == BlobDataItem::File)
</span><del>-            formData-&gt;appendFileRange(blobItem.path, blobItem.offset, blobItem.length, blobItem.expectedModificationTime);
-        else if (blobItem.type == BlobDataItem::Blob)
-            appendBlobResolved(formData, blobItem.url);
</del><ins>+            formData-&gt;appendFileRange(blobItem.file-&gt;path(), blobItem.offset(), blobItem.length(), blobItem.file-&gt;expectedModificationTime());
</ins><span class="cx">         else
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>