<!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 <ap@apple.com>
+
+ 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 <ch.dumez@samsung.com>
</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"> <ClCompile Include="..\platform\graphics\avfoundation\cf\MediaPlayerPrivateAVFoundationCF.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\AuthenticationChallengeBase.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\BlobData.cpp" />
</span><ins>+ <ClCompile Include="..\platform\network\BlobDataFileReference.cpp" />
</ins><span class="cx"> <ClCompile Include="..\platform\network\BlobResourceHandle.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\Credential.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\CredentialStorage.cpp" />
</span><span class="lines">@@ -19564,6 +19565,7 @@
</span><span class="cx"> <ClInclude Include="..\platform\network\AuthenticationChallengeBase.h" />
</span><span class="cx"> <ClInclude Include="..\platform\network\AuthenticationClient.h" />
</span><span class="cx"> <ClInclude Include="..\platform\network\BlobData.h" />
</span><ins>+ <ClInclude Include="..\platform\network\BlobDataFileReference.h" />
</ins><span class="cx"> <ClInclude Include="..\platform\network\BlobRegistry.h" />
</span><span class="cx"> <ClInclude Include="..\platform\network\BlobRegistryImpl.h" />
</span><span class="cx"> <ClInclude Include="..\platform\network\BlobResourceHandle.h" />
</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"> <ClCompile Include="..\platform\network\BlobData.cpp">
</span><span class="cx"> <Filter>platform\network</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\platform\network\BlobDataFileReference.cpp">
+ <Filter>platform\network</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\platform\network\BlobResourceHandle.cpp">
</span><span class="cx"> <Filter>platform\network</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -8650,6 +8653,9 @@
</span><span class="cx"> <ClInclude Include="..\platform\network\BlobData.h">
</span><span class="cx"> <Filter>platform\network</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\platform\network\BlobDataFileReference.h">
+ <Filter>platform\network</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\platform\network\BlobRegistry.h">
</span><span class="cx"> <Filter>platform\network</Filter>
</span><span class="cx"> </ClInclude>
</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 = "<group>"; };
</span><span class="cx">                 E1CDE91F15018ED000862CC5 /* AsyncFileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AsyncFileStream.cpp; path = fileapi/AsyncFileStream.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E1CDE9211501916900862CC5 /* AsyncFileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncFileStream.h; path = fileapi/AsyncFileStream.h; sourceTree = "<group>"; };
</span><ins>+                E1D31CDA19196020001005A3 /* BlobDataFileReference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobDataFileReference.cpp; sourceTree = "<group>"; };
+                E1D31CDB19196020001005A3 /* BlobDataFileReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobDataFileReference.h; sourceTree = "<group>"; };
</ins><span class="cx">                 E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowsKeyboardCodes.h; sourceTree = "<group>"; };
</span><span class="cx">                 E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSHTMLSelectElement.h; sourceTree = "<group>"; };
</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 "Blob.h"
</span><span class="cx"> #include "BlobURL.h"
</span><del>-#include "ThreadableBlobRegistry.h"
</del><span class="cx">
</span><span class="cx"> #include <wtf/OwnPtr.h>
</span><span class="cx"> #include <wtf/PassOwnPtr.h>
</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->size();
+ }
+
+ ASSERT_NOT_REACHED();
+ return m_length;
+}
+
</ins><span class="cx"> void BlobData::setContentType(const String& 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<RawData> data)
+{
+ appendData(data, 0, data->length());
+}
+
</ins><span class="cx"> void BlobData::appendData(PassRefPtr<RawData> 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& 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& url, long long offset, long long length)
-{
- m_items.append(BlobDataItem(url, offset, length));
-}
-
</del><span class="cx"> void BlobData::swapItems(BlobDataItemList& 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 "FileSystem.h"
</del><ins>+#include "BlobDataFileReference.h"
</ins><span class="cx"> #include "URL.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/PassOwnPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><del>-#include <wtf/ThreadSafeRefCounted.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</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<RawData> {
</del><ins>+class RawData : public RefCounted<RawData> {
</ins><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<RawData> create(Vector<char>&& 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<RawData> data)
- : type(Data)
- , data(data)
- , offset(0)
- , length(toEndOfFile)
- , expectedModificationTime(invalidFileTime())
- {
- }
-
- // Constructor for File type (complete file).
- explicit BlobDataItem(const String& path)
- : type(File)
- , path(path)
- , offset(0)
- , length(toEndOfFile)
- , expectedModificationTime(invalidFileTime())
- {
- }
-
- // Constructor for File type (partial file).
- BlobDataItem(const String& 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& 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<RawData> data;
</span><span class="cx">
</span><span class="cx"> // For File type.
</span><del>- String path;
</del><ins>+ RefPtr<BlobDataFileReference> 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& path)
+ : type(File)
+ , file(BlobDataFileReference::create(path))
+ , m_offset(0)
+ , m_length(toEndOfFile)
+ {
+ }
+
</ins><span class="cx"> BlobDataItem(PassRefPtr<RawData> 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<BlobDataItem> BlobDataItemList;
</span><span class="lines">@@ -168,18 +129,16 @@
</span><span class="cx"> const BlobDataItemList& items() const { return m_items; }
</span><span class="cx"> void swapItems(BlobDataItemList&);
</span><span class="cx">
</span><del>- void appendData(PassRefPtr<RawData>, long long offset, long long length);
</del><ins>+ void appendData(PassRefPtr<RawData>);
</ins><span class="cx"> void appendFile(const String& path);
</span><del>- void appendFile(const String& path, long long offset, long long length, double expectedModificationTime);
- void appendBlob(const URL&, 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<RawData>, 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 "config.h"
+#include "BlobDataFileReference.h"
+
+#include "FileMetadata.h"
+
+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 "FileSystem.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class BlobDataFileReference : public RefCounted<BlobDataFileReference> {
+public:
+ static PassRefPtr<BlobDataFileReference> create(const String& path)
+ {
+ return adoptRef(new BlobDataFileReference(path));
+ }
+
+ const String& path() const { return m_path; }
+ unsigned long long size() const;
+ double expectedModificationTime() const;
+
+private:
+ BlobDataFileReference(const String& 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 >= iter->length)
- offset -= iter->length;
</del><ins>+ if (offset >= iter->length())
+ offset -= iter->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() && length > 0; ++iter) {
</span><del>- ASSERT(iter->length != BlobDataItem::toEndOfFile);
- long long currentLength = iter->length - offset;
</del><ins>+ long long currentLength = iter->length() - offset;
</ins><span class="cx"> long long newLength = currentLength > length ? length : currentLength;
</span><span class="cx"> if (iter->type == BlobDataItem::Data)
</span><del>- blobData->appendData(iter->data, iter->offset + offset, newLength);
</del><ins>+ blobData->appendData(iter->data, iter->offset() + offset, newLength);
</ins><span class="cx"> else {
</span><span class="cx"> ASSERT(iter->type == BlobDataItem::File);
</span><del>- blobData->appendFile(iter->path, iter->offset + offset, newLength, iter->expectedModificationTime);
</del><ins>+ blobData->appendFile(iter->file.get(), iter->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<BlobData> blobData = BlobData::create();
</span><span class="cx"> blobData->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->appendFile(path, 0, metadata.length, metadata.modificationTime);
</del><ins>+ blobData->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())->items(), 0, partSize);
</del><ins>+ size += blobSize(part.url());
+ for (const BlobDataItem& item : m_blobs.get(part.url().string())->items())
+ blobData->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& item : data->items()) {
- if (item.length == BlobDataItem::toEndOfFile) {
- FileMetadata metadata;
- if (!getFileMetadata(item.path, metadata))
- return 0;
</del><ins>+ for (const BlobDataItem& item : data->items())
+ result += item.length();
</ins><span class="cx">
</span><del>- // FIXME: Factor out size and modification tracking for a cleaner implementation.
- const_cast<BlobDataItem&>(item).length = metadata.length;
- const_cast<BlobDataItem&>(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& item = m_blobData->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->getSize(item.path, item.expectedModificationTime);
</del><ins>+ m_asyncStream->getSize(item.file->path(), item.file->expectedModificationTime());
</ins><span class="cx"> else
</span><del>- didGetSize(m_stream->getSize(item.path, item.expectedModificationTime));
</del><ins>+ didGetSize(m_stream->getSize(item.file->path(), item.file->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& item = m_blobData->items().at(m_sizeItemCount);
</span><del>- if (item.type == BlobDataItem::File && 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 > remaining) ? static_cast<int>(remaining) : length;
</span><span class="cx"> if (bytesToRead > m_totalRemainingSize)
</span><span class="cx"> bytesToRead = static_cast<int>(m_totalRemainingSize);
</span><del>- memcpy(buf, item.data->data() + item.offset + m_currentItemReadSize, bytesToRead);
</del><ins>+ memcpy(buf, item.data->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 > m_totalRemainingSize)
</span><span class="cx"> bytesToRead = m_totalRemainingSize;
</span><del>- bool success = m_stream->openForRead(item.path, item.offset + m_currentItemReadSize, bytesToRead);
</del><ins>+ bool success = m_stream->openForRead(item.file->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<BlobResourceHandle> 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 > m_totalRemainingSize)
</span><span class="cx"> bytesToRead = m_totalRemainingSize;
</span><del>- consumeData(item.data->data() + item.offset + m_currentItemReadSize, static_cast<int>(bytesToRead));
</del><ins>+ consumeData(item.data->data() + item.offset() + m_currentItemReadSize, static_cast<int>(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 > m_totalRemainingSize)
</span><span class="cx"> bytesToRead = static_cast<int>(m_totalRemainingSize);
</span><del>- m_asyncStream->openForRead(item.path, item.offset + m_currentItemReadSize, bytesToRead);
</del><ins>+ m_asyncStream->openForRead(item.file->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<BlobResourceHandle> createAsync(BlobData*, const ResourceRequest&, ResourceHandleClient*);
</span><span class="cx">
</span><del>- static void loadResourceSynchronously(BlobData* blobData, const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& data);
</del><ins>+ static void loadResourceSynchronously(BlobData*, const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& 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& blobItem = *it;
</span><span class="cx"> if (blobItem.type == BlobDataItem::Data)
</span><del>- formData->appendData(blobItem.data->data() + static_cast<int>(blobItem.offset), static_cast<int>(blobItem.length));
</del><ins>+ formData->appendData(blobItem.data->data() + static_cast<int>(blobItem.offset()), static_cast<int>(blobItem.length()));
</ins><span class="cx"> else if (blobItem.type == BlobDataItem::File)
</span><del>- formData->appendFileRange(blobItem.path, blobItem.offset, blobItem.length, blobItem.expectedModificationTime);
- else if (blobItem.type == BlobDataItem::Blob)
- appendBlobResolved(formData, blobItem.url);
</del><ins>+ formData->appendFileRange(blobItem.file->path(), blobItem.offset(), blobItem.length(), blobItem.file->expectedModificationTime());
</ins><span class="cx"> else
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>