<!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>[209184] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209184">209184</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-12-01 10:04:58 -0800 (Thu, 01 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WebIDL] Remove custom bindings for File and Blob constructors
https://bugs.webkit.org/show_bug.cgi?id=165218
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
* web-platform-tests/fetch/api/basic/request-headers-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
Update results (still failing) to account for stricter rules about dictionary default values.
Source/WebCore:
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add/remove new files.
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob): Deleted.
* bindings/js/JSFileCustom.cpp: Removed.
Remove custom constructors.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
(GenerateParametersCheck):
Add support for optional sequences without default values. Move string default value
optimizations into GenerateDefaultValue.
* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
* fileapi/Blob.h:
(WebCore::Blob::create):
* fileapi/Blob.idl:
* fileapi/File.cpp:
(WebCore::File::File):
* fileapi/File.h:
* fileapi/File.idl:
Add support for the generated constructors.
* fileapi/BlobBuilder.cpp: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.cpp.
* fileapi/BlobBuilder.h: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.h.
* fileapi/WebKitBlobBuilder.cpp: Removed.
* fileapi/WebKitBlobBuilder.h: Removed.
Rename WebKitBlobBuilder to BlobBuilder, and update to work with generated constructor.
* fileapi/BlobPropertyBag.h: Added.
* fileapi/BlobPropertyBag.idl: Added.
Added.
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
Avoid copies of the BlobPart Vector.
* platform/network/BlobPart.h:
Replace header-guards with #pragma once.
Source/WebKit2:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:
Avoid copies of the BlobPart Vector.
LayoutTests:
* fast/files/blob-constructor-expected.txt:
* fast/files/file-constructor-expected.txt:
* fast/files/file-constructor.html:
* fast/files/script-tests/blob-constructor.js:
Update for stricter parsing and changed error text. (The error text
is regressed, but consistent with all generated bindings. I will work
on making improvements on this soon.)
* http/tests/fetch/fetch-as-blob.js:
Update to account for stricter rules about dictionary default values.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastfilesblobconstructorexpectedtxt">trunk/LayoutTests/fast/files/blob-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastfilesfileconstructorexpectedtxt">trunk/LayoutTests/fast/files/file-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastfilesfileconstructorhtml">trunk/LayoutTests/fast/files/file-constructor.html</a></li>
<li><a href="#trunkLayoutTestsfastfilesscripttestsblobconstructorjs">trunk/LayoutTests/fast/files/script-tests/blob-constructor.js</a></li>
<li><a href="#trunkLayoutTestshttptestsfetchfetchasblobjs">trunk/LayoutTests/http/tests/fetch/fetch-as-blob.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapibasicrequestheadersexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapibasicrequestheadersworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobcpp">trunk/Source/WebCore/fileapi/Blob.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobh">trunk/Source/WebCore/fileapi/Blob.h</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobidl">trunk/Source/WebCore/fileapi/Blob.idl</a></li>
<li><a href="#trunkSourceWebCorefileapiFilecpp">trunk/Source/WebCore/fileapi/File.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiFileh">trunk/Source/WebCore/fileapi/File.h</a></li>
<li><a href="#trunkSourceWebCorefileapiFileidl">trunk/Source/WebCore/fileapi/File.idl</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistrycpp">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistryh">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobParth">trunk/Source/WebCore/platform/network/BlobPart.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryh">trunk/Source/WebCore/platform/network/BlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp">trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplh">trunk/Source/WebCore/platform/network/BlobRegistryImpl.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxycpp">trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxyh">trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorefileapiBlobBuildercpp">trunk/Source/WebCore/fileapi/BlobBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobBuilderh">trunk/Source/WebCore/fileapi/BlobBuilder.h</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobLineEndingsh">trunk/Source/WebCore/fileapi/BlobLineEndings.h</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobLineEndingsidl">trunk/Source/WebCore/fileapi/BlobLineEndings.idl</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobPropertyBagh">trunk/Source/WebCore/fileapi/BlobPropertyBag.h</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobPropertyBagidl">trunk/Source/WebCore/fileapi/BlobPropertyBag.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSFileCustomcpp">trunk/Source/WebCore/bindings/js/JSFileCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiWebKitBlobBuildercpp">trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiWebKitBlobBuilderh">trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/ChangeLog        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-11-30 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove custom bindings for File and Blob constructors
+ https://bugs.webkit.org/show_bug.cgi?id=165218
+
+ Reviewed by Darin Adler.
+
+ * fast/files/blob-constructor-expected.txt:
+ * fast/files/file-constructor-expected.txt:
+ * fast/files/file-constructor.html:
+ * fast/files/script-tests/blob-constructor.js:
+ Update for stricter parsing and changed error text. (The error text
+ is regressed, but consistent with all generated bindings. I will work
+ on making improvements on this soon.)
+
+ * http/tests/fetch/fetch-as-blob.js:
+ Update to account for stricter rules about dictionary default values.
+
</ins><span class="cx"> 2016-12-01 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Marking media/modern-media-controls/audio/audio-controls-buttons.html as a timeout.
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilesblobconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/files/blob-constructor-expected.txt (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/blob-constructor-expected.txt        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/fast/files/blob-constructor-expected.txt        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -24,20 +24,20 @@
</span><span class="cx"> PASS (new Blob([toStringingObj])).size is 8
</span><span class="cx"> PASS new Blob([throwingObj]) threw exception Error.
</span><span class="cx"> PASS (new Blob([], {unknownKey:'value'})) instanceof window.Blob is true
</span><del>-PASS new Blob([], {endings:'illegalValue'}) threw exception TypeError: The endings property must be either "transparent" or "native".
-PASS new Blob([], {endings:throwingObj}) threw exception Error.
</del><ins>+PASS new Blob([], {endings:'illegalValue'}) threw exception TypeError: Type error.
+PASS new Blob([], {endings:throwingObj}) threw exception TypeError: Type error.
</ins><span class="cx"> PASS new Blob([], {type:throwingObj}) threw exception Error.
</span><del>-PASS new Blob([], {endings:throwingObj1, type:throwingObj2}) threw exception Error 1.
-PASS new Blob([], {type:throwingObj2, endings:throwingObj1}) threw exception Error 1.
-PASS new Blob([], {type:throwingObj2, endings:'illegal'}) threw exception TypeError: The endings property must be either "transparent" or "native".
-PASS (new Blob([], null)) instanceof window.Blob threw exception TypeError: Second argument of the constructor is not of type Object.
-PASS (new Blob([], undefined)) instanceof window.Blob threw exception TypeError: Second argument of the constructor is not of type Object.
-PASS (new Blob([], 123)) instanceof window.Blob threw exception TypeError: Second argument of the constructor is not of type Object.
-PASS (new Blob([], 123.4)) instanceof window.Blob threw exception TypeError: Second argument of the constructor is not of type Object.
-PASS (new Blob([], true)) instanceof window.Blob threw exception TypeError: Second argument of the constructor is not of type Object.
-PASS (new Blob([], 'abc')) instanceof window.Blob threw exception TypeError: Second argument of the constructor is not of type Object.
</del><ins>+PASS new Blob([], {endings:throwingObj1, type:throwingObj2}) threw exception TypeError: Type error.
+PASS new Blob([], {type:throwingObj2, endings:throwingObj1}) threw exception TypeError: Type error.
+PASS new Blob([], {type:throwingObj2, endings:'illegal'}) threw exception TypeError: Type error.
+PASS (new Blob([], null)) instanceof window.Blob is true
+PASS (new Blob([], undefined)) instanceof window.Blob is true
+PASS (new Blob([], 123)) instanceof window.Blob threw exception TypeError: Type error.
+PASS (new Blob([], 123.4)) instanceof window.Blob threw exception TypeError: Type error.
+PASS (new Blob([], true)) instanceof window.Blob threw exception TypeError: Type error.
+PASS (new Blob([], 'abc')) instanceof window.Blob threw exception TypeError: Type error.
</ins><span class="cx"> PASS (new Blob([], [])) instanceof window.Blob is true
</span><del>-PASS (new Blob([], /abc/)) instanceof window.Blob is true
</del><ins>+PASS (new Blob([], /abc/)) threw exception TypeError: Type error.
</ins><span class="cx"> PASS (new Blob([], function () {})) instanceof window.Blob is true
</span><span class="cx"> PASS (new Blob([], {type:'text/html'})).type is 'text/html'
</span><span class="cx"> PASS (new Blob([], {type:'text/html'})).size is 0
</span><span class="lines">@@ -72,13 +72,6 @@
</span><span class="cx"> PASS new Blob([(new Float64Array(100)).buffer]).size is 800
</span><span class="cx"> PASS new Blob([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer, (new Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1400
</span><span class="cx"> PASS new Blob([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1000
</span><del>-PASS new Blob({length: 0}) instanceof window.Blob is true
-PASS new Blob({length: 0}).size is 0
-PASS new Blob({length: 1, 0: 'string'}).size is 6
-PASS new Blob({length: 2, 0: new Uint8Array(100), 1: new Int16Array(100)}).size is 300
-PASS new Blob({length: 1, 0: 'string'}, {type: 'text/html'}).type is 'text/html'
-PASS new Blob({length: 0}, {endings:'illegal'}) threw exception TypeError: The endings property must be either "transparent" or "native".
-PASS new Blob(throwingSequence) threw exception Error: Misbehaving property.
</del><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilesfileconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/files/file-constructor-expected.txt (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/file-constructor-expected.txt        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/fast/files/file-constructor-expected.txt        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -10,8 +10,8 @@
</span><span class="cx"> PASS (new File(['hello'], 'world.html', {type:'text/html', endings:'native'})) instanceof window.File is true
</span><span class="cx"> PASS (new File(['hello'], 'world.html', {type:'text/html', endings:'transparent'})) instanceof window.File is true
</span><span class="cx"> PASS (new File([], 'world.html')) instanceof window.File is true
</span><del>-PASS (new File()) threw exception TypeError: Argument 1 ('fileBits') to the File constructor must be an instance of sequence.
-PASS (new File([])) threw exception TypeError: Argument 2 ('filename') to the File constructor must be an instance of DOMString.
</del><ins>+PASS (new File()) threw exception TypeError: Not enough arguments.
+PASS (new File([])) threw exception TypeError: Not enough arguments.
</ins><span class="cx"> PASS (new File([], null)) instanceof window.File is true
</span><span class="cx"> PASS (new File([], 1)) instanceof window.File is true
</span><span class="cx"> PASS (new File([], '')) instanceof window.File is true
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx"> PASS (new File([], document)) instanceof window.File is true
</span><span class="cx"> PASS new File('hello', 'world.html') threw exception TypeError: Value is not a sequence.
</span><span class="cx"> PASS new File(0, 'world.html') threw exception TypeError: Value is not a sequence.
</span><del>-PASS new File(null, 'world.html') threw exception TypeError: Argument 1 ('fileBits') to the File constructor must be an instance of sequence.
</del><ins>+PASS new File(null, 'world.html') threw exception TypeError: Value is not a sequence.
</ins><span class="cx"> PASS (new File([], 'world.html')) instanceof window.File is true
</span><span class="cx"> PASS (new File(['stringPrimitive'], 'world.html')) instanceof window.File is true
</span><span class="cx"> PASS (new File([String('stringObject')], 'world.html')) instanceof window.File is true
</span><span class="lines">@@ -46,18 +46,18 @@
</span><span class="cx"> PASS (new File([], 'world.html', {type:'helloî'})) instanceof window.File is true
</span><span class="cx"> PASS (new File([], 'world.html', {type:'helloî'})).type is ''
</span><span class="cx"> PASS (new File([], 'world.html', {lastModified: 555, type:'goodbye'})).lastModified is 555
</span><del>-PASS (new File([], 'world.html', {lastModified: 555, type:'goodbyeî'})).lastModified is not 555
</del><ins>+PASS (new File([], 'world.html', {lastModified: 555, type:'goodbyeî'})).lastModified is 555
</ins><span class="cx"> PASS (new File([], 'world.html', null)) instanceof window.File is true
</span><span class="cx"> PASS (new File([], 'world.html', undefined)) instanceof window.File is true
</span><del>-PASS (new File([], 'world.html', 123)) instanceof window.File threw exception TypeError: Argument 3 ('options') to the File constructor must be an instance of FilePropertyBag.
-PASS (new File([], 'world.html', 123.4)) instanceof window.File threw exception TypeError: Argument 3 ('options') to the File constructor must be an instance of FilePropertyBag.
-PASS (new File([], 'world.html', true)) instanceof window.File threw exception TypeError: Argument 3 ('options') to the File constructor must be an instance of FilePropertyBag.
-PASS (new File([], 'world.html', 'abc')) instanceof window.File threw exception TypeError: Argument 3 ('options') to the File constructor must be an instance of FilePropertyBag.
</del><ins>+PASS (new File([], 'world.html', 123)) instanceof window.File threw exception TypeError: Type error.
+PASS (new File([], 'world.html', 123.4)) instanceof window.File threw exception TypeError: Type error.
+PASS (new File([], 'world.html', true)) instanceof window.File threw exception TypeError: Type error.
+PASS (new File([], 'world.html', 'abc')) instanceof window.File threw exception TypeError: Type error.
</ins><span class="cx"> PASS (new File([], 'world.html', [])) instanceof window.File is true
</span><del>-PASS (new File([], 'world.html', /abc/)) instanceof window.File is true
</del><ins>+PASS (new File([], 'world.html', /abc/)) instanceof window.File threw exception TypeError: Type error.
</ins><span class="cx"> PASS (new File([], 'world.html', function () {})) instanceof window.File is true
</span><span class="cx"> PASS (new File([], 'world.html')).name is 'world.html'
</span><del>-PASS (new File([], 'w/orld/ht/m.l')).name is 'w:orld:ht:m.l'
</del><ins>+PASS (new File([], 'w/orld/ht/m.l')).name is 'w/orld/ht/m.l'
</ins><span class="cx"> PASS (new File([], 'world.html', {type:'text/html'})).name is 'world.html'
</span><span class="cx"> PASS (new File([], 'world.html', {type:'text/html'})).type is 'text/html'
</span><span class="cx"> PASS (new File([], 'world.html', {type:'text/html'})).size is 0
</span><span class="lines">@@ -96,8 +96,6 @@
</span><span class="cx"> PASS new File([new Blob([(new Int32Array(100)).buffer]), new File([new Uint16Array(100).buffer], 'world.txt'), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer], 'world.html').size is 1200
</span><span class="cx"> PASS new Blob([new Blob([new Int32Array(100)]), new File([new Uint16Array(100)], 'world.txt'), new Uint8Array(100), new Float32Array(100), new DataView(new ArrayBuffer(100))]).size is 1200
</span><span class="cx"> PASS new Blob([new Blob([(new Int32Array(100)).buffer]), new File([new Uint16Array(100).buffer], 'world.txt'), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1200
</span><del>-PASS new File({length: 0}, 'world.txt').size is 0
-PASS new File({length: 1, 0: 'string'}, 'world.txt').size is 6
</del><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilesfileconstructorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/files/file-constructor.html (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/file-constructor.html        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/fast/files/file-constructor.html        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -16,8 +16,8 @@
</span><span class="cx"> shouldBeTrue("(new File([], 'world.html')) instanceof window.File")
</span><span class="cx">
</span><span class="cx"> // Verify that the file name argument is required.
</span><del>-shouldThrow("(new File())", "'TypeError: Argument 1 (\\'fileBits\\') to the File constructor must be an instance of sequence'");
-shouldThrow("(new File([]))", "'TypeError: Argument 2 (\\'filename\\') to the File constructor must be an instance of DOMString'");
</del><ins>+shouldThrow("(new File())", "'TypeError: Not enough arguments'");
+shouldThrow("(new File([]))", "'TypeError: Not enough arguments'");
</ins><span class="cx">
</span><span class="cx"> // Test valid file names.
</span><span class="cx"> shouldBeTrue("(new File([], null)) instanceof window.File");
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> // Test invalid file parts.
</span><span class="cx"> shouldThrow("new File('hello', 'world.html')", '"TypeError: Value is not a sequence"');
</span><span class="cx"> shouldThrow("new File(0, 'world.html')", '"TypeError: Value is not a sequence"');
</span><del>-shouldThrow("new File(null, 'world.html')", "'TypeError: Argument 1 (\\'fileBits\\') to the File constructor must be an instance of sequence'");
</del><ins>+shouldThrow("new File(null, 'world.html')", "'TypeError: Value is not a sequence'");
</ins><span class="cx">
</span><span class="cx"> // Test valid file parts.
</span><span class="cx"> shouldBeTrue("(new File([], 'world.html')) instanceof window.File");
</span><span class="lines">@@ -72,24 +72,24 @@
</span><span class="cx"> shouldBeTrue("(new File([], 'world.html', {type:'hello\u00EE'})) instanceof window.File");
</span><span class="cx"> shouldBe("(new File([], 'world.html', {type:'hello\u00EE'})).type", "''");
</span><span class="cx">
</span><del>-// FilePropertyBag substeps: Type with non-ascii characters should prevent lastModified from being extracted.
</del><ins>+// FilePropertyBag substeps: Type with non-ascii characters should not prevent lastModified from being extracted.
</ins><span class="cx"> shouldBe("(new File([], 'world.html', {lastModified: 555, type:'goodbye'})).lastModified", "555");
</span><del>-shouldNotBe("(new File([], 'world.html', {lastModified: 555, type:'goodbye\u00EE'})).lastModified", "555");
</del><ins>+shouldBe("(new File([], 'world.html', {lastModified: 555, type:'goodbye\u00EE'})).lastModified", "555");
</ins><span class="cx">
</span><span class="cx"> // Test various non-object literals being used as property bags.
</span><span class="cx"> shouldBeTrue("(new File([], 'world.html', null)) instanceof window.File");
</span><span class="cx"> shouldBeTrue("(new File([], 'world.html', undefined)) instanceof window.File");
</span><del>-shouldThrow("(new File([], 'world.html', 123)) instanceof window.File", "'TypeError: Argument 3 (\\'options\\') to the File constructor must be an instance of FilePropertyBag'");
-shouldThrow("(new File([], 'world.html', 123.4)) instanceof window.File", "'TypeError: Argument 3 (\\'options\\') to the File constructor must be an instance of FilePropertyBag'");
-shouldThrow("(new File([], 'world.html', true)) instanceof window.File", "'TypeError: Argument 3 (\\'options\\') to the File constructor must be an instance of FilePropertyBag'");
-shouldThrow("(new File([], 'world.html', 'abc')) instanceof window.File", "'TypeError: Argument 3 (\\'options\\') to the File constructor must be an instance of FilePropertyBag'");
</del><ins>+shouldThrow("(new File([], 'world.html', 123)) instanceof window.File", "'TypeError: Type error'");
+shouldThrow("(new File([], 'world.html', 123.4)) instanceof window.File", "'TypeError: Type error'");
+shouldThrow("(new File([], 'world.html', true)) instanceof window.File", "'TypeError: Type error'");
+shouldThrow("(new File([], 'world.html', 'abc')) instanceof window.File", "'TypeError: Type error'");
</ins><span class="cx"> shouldBeTrue("(new File([], 'world.html', [])) instanceof window.File");
</span><del>-shouldBeTrue("(new File([], 'world.html', /abc/)) instanceof window.File");
</del><ins>+shouldThrow("(new File([], 'world.html', /abc/)) instanceof window.File", "'TypeError: Type error'");
</ins><span class="cx"> shouldBeTrue("(new File([], 'world.html', function () {})) instanceof window.File");
</span><span class="cx">
</span><span class="cx"> // Test that the name/type/size are correctly added to the File.
</span><span class="cx"> shouldBe("(new File([], 'world.html')).name", "'world.html'");
</span><del>-shouldBe("(new File([], 'w/orld/ht/m.l')).name", "'w:orld:ht:m.l'");
</del><ins>+shouldBe("(new File([], 'w/orld/ht/m.l')).name", "'w/orld/ht/m.l'");
</ins><span class="cx"> shouldBe("(new File([], 'world.html', {type:'text/html'})).name", "'world.html'");
</span><span class="cx"> shouldBe("(new File([], 'world.html', {type:'text/html'})).type", "'text/html'");
</span><span class="cx"> shouldBe("(new File([], 'world.html', {type:'text/html'})).size", "0");
</span><span class="lines">@@ -141,9 +141,4 @@
</span><span class="cx"> // Test building Blobs with ArrayBuffer / ArrayBufferView parts enclosed in files.
</span><span class="cx"> shouldBe("new Blob([new Blob([new Int32Array(100)]), new File([new Uint16Array(100)], 'world.txt'), new Uint8Array(100), new Float32Array(100), new DataView(new ArrayBuffer(100))]).size", "1200");
</span><span class="cx"> shouldBe("new Blob([new Blob([(new Int32Array(100)).buffer]), new File([new Uint16Array(100).buffer], 'world.txt'), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size", "1200");
</span><del>-
-// Test passing blob parts in objects with indexed properties.
-// (This depends on the bindings code handling of sequence<T>)
-shouldBe("new File({length: 0}, 'world.txt').size", "0");
-shouldBe("new File({length: 1, 0: 'string'}, 'world.txt').size", "6");
</del><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilesscripttestsblobconstructorjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/files/script-tests/blob-constructor.js (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/files/script-tests/blob-constructor.js        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/fast/files/script-tests/blob-constructor.js        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -34,26 +34,26 @@
</span><span class="cx">
</span><span class="cx"> // Test some invalid property bags
</span><span class="cx"> shouldBeTrue("(new Blob([], {unknownKey:'value'})) instanceof window.Blob"); // Ignore invalid keys
</span><del>-shouldThrow("new Blob([], {endings:'illegalValue'})", "'TypeError: The endings property must be either \"transparent\" or \"native\"'");
-shouldThrow("new Blob([], {endings:throwingObj})", "'Error'");
</del><ins>+shouldThrow("new Blob([], {endings:'illegalValue'})", "'TypeError: Type error'");
+shouldThrow("new Blob([], {endings:throwingObj})", "'TypeError: Type error'");
</ins><span class="cx"> shouldThrow("new Blob([], {type:throwingObj})", "'Error'");
</span><span class="cx">
</span><span class="cx"> // Test that order of property bag evaluation is lexigraphical
</span><span class="cx"> var throwingObj1 = { toString: function() { throw "Error 1"; } };
</span><span class="cx"> var throwingObj2 = { toString: function() { throw "Error 2"; } };
</span><del>-shouldThrow("new Blob([], {endings:throwingObj1, type:throwingObj2})", "'Error 1'");
-shouldThrow("new Blob([], {type:throwingObj2, endings:throwingObj1})", "'Error 1'");
-shouldThrow("new Blob([], {type:throwingObj2, endings:'illegal'})", "'TypeError: The endings property must be either \"transparent\" or \"native\"'");
</del><ins>+shouldThrow("new Blob([], {endings:throwingObj1, type:throwingObj2})", "'TypeError: Type error'");
+shouldThrow("new Blob([], {type:throwingObj2, endings:throwingObj1})", "'TypeError: Type error'");
+shouldThrow("new Blob([], {type:throwingObj2, endings:'illegal'})", "'TypeError: Type error'");
</ins><span class="cx">
</span><span class="cx"> // Test various non-object literals being used as property bags
</span><del>-shouldThrow("(new Blob([], null)) instanceof window.Blob", "'TypeError: Second argument of the constructor is not of type Object'");
-shouldThrow("(new Blob([], undefined)) instanceof window.Blob", "'TypeError: Second argument of the constructor is not of type Object'");
-shouldThrow("(new Blob([], 123)) instanceof window.Blob", "'TypeError: Second argument of the constructor is not of type Object'");
-shouldThrow("(new Blob([], 123.4)) instanceof window.Blob", "'TypeError: Second argument of the constructor is not of type Object'");
-shouldThrow("(new Blob([], true)) instanceof window.Blob", "'TypeError: Second argument of the constructor is not of type Object'");
-shouldThrow("(new Blob([], 'abc')) instanceof window.Blob", "'TypeError: Second argument of the constructor is not of type Object'");
</del><ins>+shouldBeTrue("(new Blob([], null)) instanceof window.Blob");
+shouldBeTrue("(new Blob([], undefined)) instanceof window.Blob");
+shouldThrow("(new Blob([], 123)) instanceof window.Blob", "'TypeError: Type error'");
+shouldThrow("(new Blob([], 123.4)) instanceof window.Blob", "'TypeError: Type error'");
+shouldThrow("(new Blob([], true)) instanceof window.Blob", "'TypeError: Type error'");
+shouldThrow("(new Blob([], 'abc')) instanceof window.Blob", "'TypeError: Type error'");
</ins><span class="cx"> shouldBeTrue("(new Blob([], [])) instanceof window.Blob");
</span><del>-shouldBeTrue("(new Blob([], /abc/)) instanceof window.Blob");
</del><ins>+shouldThrow("(new Blob([], /abc/))", "'TypeError: Type error'");
</ins><span class="cx"> shouldBeTrue("(new Blob([], function () {})) instanceof window.Blob");
</span><span class="cx">
</span><span class="cx"> // Test that the type/size is correctly added to the Blob
</span><span class="lines">@@ -98,23 +98,3 @@
</span><span class="cx"> shouldBe("new Blob([(new Float64Array(100)).buffer]).size", "800");
</span><span class="cx"> shouldBe("new Blob([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer, (new Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size", "1400");
</span><span class="cx"> shouldBe("new Blob([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size", "1000");
</span><del>-
-// Test passing blob parts in sequences.
-shouldBeTrue("new Blob({length: 0}) instanceof window.Blob");
-shouldBe("new Blob({length: 0}).size", "0");
-shouldBe("new Blob({length: 1, 0: 'string'}).size", "6");
-shouldBe("new Blob({length: 2, 0: new Uint8Array(100), 1: new Int16Array(100)}).size", "300");
-shouldBe("new Blob({length: 1, 0: 'string'}, {type: 'text/html'}).type", "'text/html'");
-shouldThrow("new Blob({length: 0}, {endings:'illegal'})", "'TypeError: The endings property must be either \"transparent\" or \"native\"'");
-
-// Test passing blog parts in a sequence-like object that throws on property access.
-var throwingSequence = {length: 4, 0: 'hello', 3: 'world'};
-Object.defineProperty(throwingSequence, "1", {
- get: function() { throw new Error("Misbehaving property"); },
- enumerable: true, configurable: true
-});
-Object.defineProperty(throwingSequence, "2", {
- get: function() { throw new Error("This should not be thrown"); },
- enumerable: true, configurable: true
-});
-shouldThrow("new Blob(throwingSequence)", "'Error: Misbehaving property'");
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsfetchfetchasblobjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/fetch/fetch-as-blob.js (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/fetch/fetch-as-blob.js        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/http/tests/fetch/fetch-as-blob.js        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> return req.blob()
</span><span class="cx"> .then(function(blob) {
</span><span class="cx"> assert_equals(blob.type, '');
</span><del>- assert_equals(req.headers.get('Content-Type'), null);
</del><ins>+ assert_equals(req.headers.get('Content-Type'), '');
</ins><span class="cx"> });
</span><span class="cx"> }, 'MIME type for Blob');
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-11-30 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove custom bindings for File and Blob constructors
+ https://bugs.webkit.org/show_bug.cgi?id=165218
+
+ Reviewed by Darin Adler.
+
+ * web-platform-tests/fetch/api/basic/request-headers-expected.txt:
+ * web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
+ Update results (still failing) to account for stricter rules about dictionary default values.
+
</ins><span class="cx"> 2016-11-30 Jiewen Tan <jiewen_tan@apple.com>
</span><span class="cx">
</span><span class="cx"> SubtleCrypto::deriveKey always return NOT_SUPPORTED_ERR for now
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapibasicrequestheadersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS Fetch with POST with text body
</span><span class="cx"> PASS Fetch with POST with FormData body
</span><span class="cx"> PASS Fetch with POST with URLSearchParams body
</span><del>-FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</del><ins>+FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) ""
</ins><span class="cx"> FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</span><span class="cx"> FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</span><span class="cx"> FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapibasicrequestheadersworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS Fetch with POST with text body
</span><span class="cx"> FAIL Fetch with POST with FormData body Can't find variable: FormData
</span><span class="cx"> PASS Fetch with POST with URLSearchParams body
</span><del>-FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</del><ins>+FAIL Fetch with POST with Blob body assert_equals: Request should have header content-type: null expected (object) null but got (string) ""
</ins><span class="cx"> FAIL Fetch with POST with ArrayBuffer body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</span><span class="cx"> FAIL Fetch with POST with Uint8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</span><span class="cx"> FAIL Fetch with POST with Int8Array body assert_equals: Request should have header content-type: null expected (object) null but got (string) "application/x-www-form-urlencoded"
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -468,6 +468,8 @@
</span><span class="cx"> dom/XMLDocument.idl
</span><span class="cx">
</span><span class="cx"> fileapi/Blob.idl
</span><ins>+ fileapi/BlobLineEndings.idl
+ fileapi/BlobPropertyBag.idl
</ins><span class="cx"> fileapi/File.idl
</span><span class="cx"> fileapi/FileError.idl
</span><span class="cx"> fileapi/FileException.idl
</span><span class="lines">@@ -1135,7 +1137,6 @@
</span><span class="cx"> bindings/js/JSEventListener.cpp
</span><span class="cx"> bindings/js/JSEventTargetCustom.cpp
</span><span class="cx"> bindings/js/JSExceptionBase.cpp
</span><del>- bindings/js/JSFileCustom.cpp
</del><span class="cx"> bindings/js/JSFileReaderCustom.cpp
</span><span class="cx"> bindings/js/JSGeolocationCustom.cpp
</span><span class="cx"> bindings/js/JSHTMLAllCollectionCustom.cpp
</span><span class="lines">@@ -1615,6 +1616,7 @@
</span><span class="cx">
</span><span class="cx"> fileapi/AsyncFileStream.cpp
</span><span class="cx"> fileapi/Blob.cpp
</span><ins>+ fileapi/BlobBuilder.cpp
</ins><span class="cx"> fileapi/BlobURL.cpp
</span><span class="cx"> fileapi/File.cpp
</span><span class="cx"> fileapi/FileException.cpp
</span><span class="lines">@@ -1623,7 +1625,6 @@
</span><span class="cx"> fileapi/FileReaderLoader.cpp
</span><span class="cx"> fileapi/FileReaderSync.cpp
</span><span class="cx"> fileapi/ThreadableBlobRegistry.cpp
</span><del>- fileapi/WebKitBlobBuilder.cpp
</del><span class="cx">
</span><span class="cx"> history/BackForwardController.cpp
</span><span class="cx"> history/CachedFrame.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/ChangeLog        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2016-11-30 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove custom bindings for File and Blob constructors
+ https://bugs.webkit.org/show_bug.cgi?id=165218
+
+ Reviewed by Darin Adler.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ Add/remove new files.
+
+ * bindings/js/JSBlobCustom.cpp:
+ (WebCore::constructJSBlob): Deleted.
+ * bindings/js/JSFileCustom.cpp: Removed.
+ Remove custom constructors.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateDefaultValue):
+ (GenerateDictionaryImplementationContent):
+ (GenerateParametersCheck):
+ Add support for optional sequences without default values. Move string default value
+ optimizations into GenerateDefaultValue.
+
+ * fileapi/Blob.cpp:
+ (WebCore::Blob::Blob):
+ * fileapi/Blob.h:
+ (WebCore::Blob::create):
+ * fileapi/Blob.idl:
+ * fileapi/File.cpp:
+ (WebCore::File::File):
+ * fileapi/File.h:
+ * fileapi/File.idl:
+ Add support for the generated constructors.
+
+ * fileapi/BlobBuilder.cpp: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.cpp.
+ * fileapi/BlobBuilder.h: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.h.
+ * fileapi/WebKitBlobBuilder.cpp: Removed.
+ * fileapi/WebKitBlobBuilder.h: Removed.
+ Rename WebKitBlobBuilder to BlobBuilder, and update to work with generated constructor.
+
+ * fileapi/BlobPropertyBag.h: Added.
+ * fileapi/BlobPropertyBag.idl: Added.
+ Added.
+
+ * fileapi/ThreadableBlobRegistry.cpp:
+ (WebCore::ThreadableBlobRegistry::registerBlobURL):
+ * fileapi/ThreadableBlobRegistry.h:
+ * platform/network/BlobRegistry.h:
+ * platform/network/BlobRegistryImpl.cpp:
+ (WebCore::BlobRegistryImpl::registerBlobURL):
+ * platform/network/BlobRegistryImpl.h:
+ Avoid copies of the BlobPart Vector.
+
+ * platform/network/BlobPart.h:
+ Replace header-guards with #pragma once.
+
</ins><span class="cx"> 2016-12-01 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> [Modern Media Controls] Provide a UI object to show a list of tracks
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> #include "JSBiquadFilterNode.cpp"
</span><span class="cx"> #endif
</span><span class="cx"> #include "JSBlob.cpp"
</span><ins>+#include "JSBlobLineEndings.cpp"
+#include "JSBlobPropertyBag.cpp"
</ins><span class="cx"> #include "JSCanvasGradient.cpp"
</span><span class="cx"> #include "JSCanvasPattern.cpp"
</span><span class="cx"> #include "JSCanvasProxy.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/DerivedSources.make        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -389,6 +389,8 @@
</span><span class="cx"> $(WebCore)/dom/WheelEvent.idl \
</span><span class="cx"> $(WebCore)/dom/XMLDocument.idl \
</span><span class="cx"> $(WebCore)/fileapi/Blob.idl \
</span><ins>+ $(WebCore)/fileapi/BlobLineEndings.idl \
+ $(WebCore)/fileapi/BlobPropertyBag.idl \
</ins><span class="cx"> $(WebCore)/fileapi/File.idl \
</span><span class="cx"> $(WebCore)/fileapi/FileError.idl \
</span><span class="cx"> $(WebCore)/fileapi/FileException.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -2129,7 +2129,6 @@
</span><span class="cx">                 516D7D701BB5F0BD00AF7C77 /* IDBConnectionToServerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185FCBD1BB5CB770012898F /* IDBConnectionToServerDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 516D7D711BB5F0BD00AF7C77 /* IDBConnectionToClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516D7D6D1BB5F06500AF7C77 /* IDBConnectionToClient.cpp */; };
</span><span class="cx">                 516D7D721BB5F0BD00AF7C77 /* IDBConnectionToClientDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 516D7D6E1BB5F06500AF7C77 /* IDBConnectionToClientDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                516E54FA1CCB2EA80040D954 /* JSFileCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516E54F91CCB27FF0040D954 /* JSFileCustom.cpp */; };
</del><span class="cx">                 516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 516F7F6C1C31C79D00F111DC /* ServerOpenDBRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 516F7F6E1C31E39C00F111DC /* ServerOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516F7F6B1C31C79D00F111DC /* ServerOpenDBRequest.cpp */; };
</span><span class="cx">                 517138EF1BED1D1A000D5F01 /* IndexKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517138ED1BED1D17000D5F01 /* IndexKey.cpp */; };
</span><span class="lines">@@ -2896,6 +2895,12 @@
</span><span class="cx">                 7C73FB11191EF6F4007DE061 /* JSUserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */; };
</span><span class="cx">                 7C73FB12191EF6F4007DE061 /* JSUserMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C73FB10191EF6F4007DE061 /* JSUserMessageHandler.h */; };
</span><span class="cx">                 7C73FB19191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C73FB17191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp */; };
</span><ins>+                7C77C3D11DEE472400A50BFA /* BlobPropertyBag.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C77C3D01DEE472400A50BFA /* BlobPropertyBag.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                7C77C3D41DEF178E00A50BFA /* JSBlobPropertyBag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C77C3D21DEF178E00A50BFA /* JSBlobPropertyBag.cpp */; };
+                7C77C3D51DEF178E00A50BFA /* JSBlobPropertyBag.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C77C3D31DEF178E00A50BFA /* JSBlobPropertyBag.h */; };
+                7C77C3D71DEF850A00A50BFA /* BlobLineEndings.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C77C3D61DEF850A00A50BFA /* BlobLineEndings.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                7C77C3DB1DEF86D700A50BFA /* JSBlobLineEndings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C77C3D91DEF86D700A50BFA /* JSBlobLineEndings.cpp */; };
+                7C77C3DC1DEF86D700A50BFA /* JSBlobLineEndings.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C77C3DA1DEF86D700A50BFA /* JSBlobLineEndings.h */; };
</ins><span class="cx">                 7C7941E41C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */; };
</span><span class="cx">                 7C7941E51C56C29300A4C58E /* DataDetectorsCoreSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */; };
</span><span class="cx">                 7C83DE861D04CC5D00FEBCF3 /* SpringSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */; };
</span><span class="lines">@@ -3630,8 +3635,8 @@
</span><span class="cx">                 9767CE0C145ABC13005E64DB /* ExceptionInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 9767CE0A145ABC13005E64DB /* ExceptionInterfaces.h */; };
</span><span class="cx">                 976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C59122B8A3D001FD1F7 /* Blob.cpp */; };
</span><span class="cx">                 976D6C79122B8A3D001FD1F7 /* Blob.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C5A122B8A3D001FD1F7 /* Blob.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                976D6C7B122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C5C122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp */; };
-                976D6C7C122B8A3D001FD1F7 /* WebKitBlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C5D122B8A3D001FD1F7 /* WebKitBlobBuilder.h */; };
</del><ins>+                976D6C7B122B8A3D001FD1F7 /* BlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C5C122B8A3D001FD1F7 /* BlobBuilder.cpp */; };
+                976D6C7C122B8A3D001FD1F7 /* BlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C5D122B8A3D001FD1F7 /* BlobBuilder.h */; };
</ins><span class="cx">                 976D6C7E122B8A3D001FD1F7 /* BlobURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C5F122B8A3D001FD1F7 /* BlobURL.cpp */; };
</span><span class="cx">                 976D6C7F122B8A3D001FD1F7 /* BlobURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C60122B8A3D001FD1F7 /* BlobURL.h */; };
</span><span class="cx">                 976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C61122B8A3D001FD1F7 /* File.cpp */; };
</span><span class="lines">@@ -9371,7 +9376,6 @@
</span><span class="cx">                 516C62241950E2B900337E75 /* JSGamepadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGamepadEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 516D7D6D1BB5F06500AF7C77 /* IDBConnectionToClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBConnectionToClient.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 516D7D6E1BB5F06500AF7C77 /* IDBConnectionToClientDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBConnectionToClientDelegate.h; sourceTree = "<group>"; };
</span><del>-                516E54F91CCB27FF0040D954 /* JSFileCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileCustom.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 516F7F6B1C31C79D00F111DC /* ServerOpenDBRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServerOpenDBRequest.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 516F7F6C1C31C79D00F111DC /* ServerOpenDBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerOpenDBRequest.h; sourceTree = "<group>"; };
</span><span class="cx">                 517138ED1BED1D17000D5F01 /* IndexKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IndexKey.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -10382,6 +10386,14 @@
</span><span class="cx">                 7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUserMessageHandler.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C73FB10191EF6F4007DE061 /* JSUserMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUserMessageHandler.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C73FB17191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUserMessageHandlersNamespaceCustom.cpp; sourceTree = "<group>"; };
</span><ins>+                7C77C3CF1DEE471800A50BFA /* BlobPropertyBag.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = BlobPropertyBag.idl; sourceTree = "<group>"; };
+                7C77C3D01DEE472400A50BFA /* BlobPropertyBag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobPropertyBag.h; sourceTree = "<group>"; };
+                7C77C3D21DEF178E00A50BFA /* JSBlobPropertyBag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobPropertyBag.cpp; sourceTree = "<group>"; };
+                7C77C3D31DEF178E00A50BFA /* JSBlobPropertyBag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlobPropertyBag.h; sourceTree = "<group>"; };
+                7C77C3D61DEF850A00A50BFA /* BlobLineEndings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobLineEndings.h; sourceTree = "<group>"; };
+                7C77C3D81DEF854000A50BFA /* BlobLineEndings.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = BlobLineEndings.idl; sourceTree = "<group>"; };
+                7C77C3D91DEF86D700A50BFA /* JSBlobLineEndings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobLineEndings.cpp; sourceTree = "<group>"; };
+                7C77C3DA1DEF86D700A50BFA /* JSBlobLineEndings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlobLineEndings.h; sourceTree = "<group>"; };
</ins><span class="cx">                 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetectorsCoreSoftLink.mm; sourceTree = "<group>"; };
</span><span class="cx">                 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsCoreSoftLink.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpringSolver.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -11211,8 +11223,8 @@
</span><span class="cx">                 9767CE0A145ABC13005E64DB /* ExceptionInterfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionInterfaces.h; sourceTree = "<group>"; };
</span><span class="cx">                 976D6C59122B8A3D001FD1F7 /* Blob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Blob.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 976D6C5A122B8A3D001FD1F7 /* Blob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Blob.h; sourceTree = "<group>"; };
</span><del>-                976D6C5C122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitBlobBuilder.cpp; sourceTree = "<group>"; };
-                976D6C5D122B8A3D001FD1F7 /* WebKitBlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitBlobBuilder.h; sourceTree = "<group>"; };
</del><ins>+                976D6C5C122B8A3D001FD1F7 /* BlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobBuilder.cpp; sourceTree = "<group>"; };
+                976D6C5D122B8A3D001FD1F7 /* BlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobBuilder.h; sourceTree = "<group>"; };
</ins><span class="cx">                 976D6C5F122B8A3D001FD1F7 /* BlobURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobURL.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 976D6C60122B8A3D001FD1F7 /* BlobURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobURL.h; sourceTree = "<group>"; };
</span><span class="cx">                 976D6C61122B8A3D001FD1F7 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -18308,6 +18320,10 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */,
</span><span class="cx">                                 2E2D99CC10E2BBDA00496337 /* JSBlob.h */,
</span><ins>+                                7C77C3D21DEF178E00A50BFA /* JSBlobPropertyBag.cpp */,
+                                7C77C3D31DEF178E00A50BFA /* JSBlobPropertyBag.h */,
+                                7C77C3D91DEF86D700A50BFA /* JSBlobLineEndings.cpp */,
+                                7C77C3DA1DEF86D700A50BFA /* JSBlobLineEndings.h */,
</ins><span class="cx">                                 BC00F0100E0A189500FD04E3 /* JSFile.cpp */,
</span><span class="cx">                                 BC00F0110E0A189500FD04E3 /* JSFile.h */,
</span><span class="cx">                                 2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */,
</span><span class="lines">@@ -19231,6 +19247,12 @@
</span><span class="cx">                                 976D6C59122B8A3D001FD1F7 /* Blob.cpp */,
</span><span class="cx">                                 976D6C5A122B8A3D001FD1F7 /* Blob.h */,
</span><span class="cx">                                 14A98E05136386A200C9FED2 /* Blob.idl */,
</span><ins>+                                976D6C5C122B8A3D001FD1F7 /* BlobBuilder.cpp */,
+                                976D6C5D122B8A3D001FD1F7 /* BlobBuilder.h */,
+                                7C77C3D01DEE472400A50BFA /* BlobPropertyBag.h */,
+                                7C77C3CF1DEE471800A50BFA /* BlobPropertyBag.idl */,
+                                7C77C3D61DEF850A00A50BFA /* BlobLineEndings.h */,
+                                7C77C3D81DEF854000A50BFA /* BlobLineEndings.idl */,
</ins><span class="cx">                                 976D6C5F122B8A3D001FD1F7 /* BlobURL.cpp */,
</span><span class="cx">                                 976D6C60122B8A3D001FD1F7 /* BlobURL.h */,
</span><span class="cx">                                 976D6C61122B8A3D001FD1F7 /* File.cpp */,
</span><span class="lines">@@ -19256,8 +19278,6 @@
</span><span class="cx">                                 E1AB1EBD14E9E3A800449E13 /* FileReaderSync.idl */,
</span><span class="cx">                                 976D6C75122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp */,
</span><span class="cx">                                 976D6C76122B8A3D001FD1F7 /* ThreadableBlobRegistry.h */,
</span><del>-                                976D6C5C122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp */,
-                                976D6C5D122B8A3D001FD1F7 /* WebKitBlobBuilder.h */,
</del><span class="cx">                         );
</span><span class="cx">                         path = fileapi;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -22040,7 +22060,6 @@
</span><span class="cx">                                 ADEC78F718EE5308001315C2 /* JSElementCustom.h */,
</span><span class="cx">                                 A56D02A21D0B9AF30095E5D3 /* JSErrorEventCustom.cpp */,
</span><span class="cx">                                 BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
</span><del>-                                516E54F91CCB27FF0040D954 /* JSFileCustom.cpp */,
</del><span class="cx">                                 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */,
</span><span class="cx">                                 C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */,
</span><span class="cx">                                 1C24EEAA1C72AA0A0080F8FC /* JSFontFaceSetCustom.cpp */,
</span><span class="lines">@@ -24944,6 +24963,7 @@
</span><span class="cx">                                 FD31602512B0267600C1A359 /* BiquadDSPKernel.h in Headers */,
</span><span class="cx">                                 FDC54F051399B0DA008D9117 /* BiquadFilterNode.h in Headers */,
</span><span class="cx">                                 FD31602712B0267600C1A359 /* BiquadProcessor.h in Headers */,
</span><ins>+                                7C77C3D11DEE472400A50BFA /* BlobPropertyBag.h in Headers */,
</ins><span class="cx">                                 A89943280B42338800D7C802 /* BitmapImage.h in Headers */,
</span><span class="cx">                                 976D6C79122B8A3D001FD1F7 /* Blob.h in Headers */,
</span><span class="cx">                                 2EDEF1F4121B0EFC00726DB2 /* BlobData.h in Headers */,
</span><span class="lines">@@ -25428,6 +25448,7 @@
</span><span class="cx">                                 188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
</span><span class="cx">                                 05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */,
</span><span class="cx">                                 76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */,
</span><ins>+                                7C77C3DC1DEF86D700A50BFA /* JSBlobLineEndings.h in Headers */,
</ins><span class="cx">                                 2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */,
</span><span class="cx">                                 CD9DE18217AAD6A400EA386D /* DOMURLMediaSource.h in Headers */,
</span><span class="cx">                                 15FCC9FE1B4DF85E00E72326 /* DOMURLMediaStream.h in Headers */,
</span><span class="lines">@@ -25497,6 +25518,7 @@
</span><span class="cx">                                 8F67561B1288B17B0047ACA3 /* EventQueue.h in Headers */,
</span><span class="cx">                                 E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */,
</span><span class="cx">                                 E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */,
</span><ins>+                                7C77C3D51DEF178E00A50BFA /* JSBlobPropertyBag.h in Headers */,
</ins><span class="cx">                                 97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */,
</span><span class="cx">                                 97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */,
</span><span class="cx">                                 262EC41A1D078FB900BA78FC /* EventTrackingRegions.h in Headers */,
</span><span class="lines">@@ -25895,6 +25917,7 @@
</span><span class="cx">                                 F55B3DC21251F12D003EF269 /* ImageInputType.h in Headers */,
</span><span class="cx">                                 089582560E857A7E00F82C83 /* ImageLoader.h in Headers */,
</span><span class="cx">                                 BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */,
</span><ins>+                                7C77C3D71DEF850A00A50BFA /* BlobLineEndings.h in Headers */,
</ins><span class="cx">                                 2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */,
</span><span class="cx">                                 B51A2F3F17D7D3AE0072517A /* ImageQualityController.h in Headers */,
</span><span class="cx">                                 49291E4B134172C800E753DE /* ImageRenderingMode.h in Headers */,
</span><span class="lines">@@ -28201,7 +28224,7 @@
</span><span class="cx">                                 A584FE301864CB8400843B10 /* WebInjectedScriptManager.h in Headers */,
</span><span class="cx">                                 31C0FF220E4CEB6E007D6FE5 /* WebKitAnimationEvent.h in Headers */,
</span><span class="cx">                                 5DFEBAB718592B6D00C75BEB /* WebKitAvailability.h in Headers */,
</span><del>-                                976D6C7C122B8A3D001FD1F7 /* WebKitBlobBuilder.h in Headers */,
</del><ins>+                                976D6C7C122B8A3D001FD1F7 /* BlobBuilder.h in Headers */,
</ins><span class="cx">                                 498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */,
</span><span class="cx">                                 8AA61D00144D595B00F37350 /* WebKitCSSRegionRule.h in Headers */,
</span><span class="cx">                                 BC9ADD230CC4032600098C4C /* WebKitCSSTransformValue.h in Headers */,
</span><span class="lines">@@ -29890,7 +29913,6 @@
</span><span class="cx">                                 7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */,
</span><span class="cx">                                 8E4C96DC1AD4483500365A50 /* JSFetchResponse.cpp in Sources */,
</span><span class="cx">                                 BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */,
</span><del>-                                516E54FA1CCB2EA80040D954 /* JSFileCustom.cpp in Sources */,
</del><span class="cx">                                 2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */,
</span><span class="cx">                                 898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */,
</span><span class="cx">                                 BC00F0160E0A189500FD04E3 /* JSFileList.cpp in Sources */,
</span><span class="lines">@@ -31657,6 +31679,7 @@
</span><span class="cx">                                 934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */,
</span><span class="cx">                                 C5B4C24E1509236C00A6EF37 /* WebCoreNSURLExtras.mm in Sources */,
</span><span class="cx">                                 CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */,
</span><ins>+                                7C77C3D41DEF178E00A50BFA /* JSBlobPropertyBag.cpp in Sources */,
</ins><span class="cx">                                 B50F5B810E96CD9900AD71A6 /* WebCoreObjCExtras.mm in Sources */,
</span><span class="cx">                                 E180810E16FCECDF00B80D07 /* WebCoreResourceHandleAsDelegate.mm in Sources */,
</span><span class="cx">                                 E152551616FD2350003D7ADB /* WebCoreResourceHandleAsOperationQueueDelegate.mm in Sources */,
</span><span class="lines">@@ -31713,7 +31736,7 @@
</span><span class="cx">                                 A584FE2F1864CB8400843B10 /* WebInjectedScriptManager.cpp in Sources */,
</span><span class="cx">                                 1A7E19461C5863BE00CCDDF3 /* WebKitAdditions.mm in Sources */,
</span><span class="cx">                                 31C0FF210E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp in Sources */,
</span><del>-                                976D6C7B122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp in Sources */,
</del><ins>+                                976D6C7B122B8A3D001FD1F7 /* BlobBuilder.cpp in Sources */,
</ins><span class="cx">                                 498391580F1E776900C23782 /* WebKitCSSMatrix.cpp in Sources */,
</span><span class="cx">                                 8AA61CFF144D595B00F37350 /* WebKitCSSRegionRule.cpp in Sources */,
</span><span class="cx">                                 BC9ADD800CC4092200098C4C /* WebKitCSSTransformValue.cpp in Sources */,
</span><span class="lines">@@ -31728,6 +31751,7 @@
</span><span class="cx">                                 A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */,
</span><span class="cx">                                 5709E8CD1D413D47003244AC /* WebKitSubtleCrypto.cpp in Sources */,
</span><span class="cx">                                 31C0FF240E4CEB6E007D6FE5 /* WebKitTransitionEvent.cpp in Sources */,
</span><ins>+                                7C77C3DB1DEF86D700A50BFA /* JSBlobLineEndings.cpp in Sources */,
</ins><span class="cx">                                 0FCF332E0F2B9A25004B6795 /* WebLayer.mm in Sources */,
</span><span class="cx">                                 0709D78E1AE55554004E42F8 /* WebMediaSessionManager.cpp in Sources */,
</span><span class="cx">                                 0709D7921AE5557E004E42F8 /* WebMediaSessionManagerMac.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -32,18 +32,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "JSBlob.h"
</span><span class="cx">
</span><del>-#include "Blob.h"
-#include "ExceptionCode.h"
</del><span class="cx"> #include "JSDOMBinding.h"
</span><del>-#include "JSDictionary.h"
</del><span class="cx"> #include "JSFile.h"
</span><del>-#include "ScriptExecutionContext.h"
-#include "WebKitBlobBuilder.h"
-#include <runtime/Error.h>
-#include <runtime/JSArray.h>
-#include <runtime/JSArrayBuffer.h>
-#include <runtime/JSArrayBufferView.h>
-#include <wtf/Assertions.h>
</del><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="lines">@@ -61,79 +51,4 @@
</span><span class="cx"> return wrap(state, globalObject, blob);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSBlob(ExecState& exec)
-{
- VM& vm = exec.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
- ASSERT(jsConstructor);
-
- ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();
- if (!context)
- return throwConstructorScriptExecutionContextUnavailableError(exec, scope, "Blob");
-
- if (!exec.argumentCount()) {
- return JSValue::encode(createWrapper<Blob>(jsConstructor->globalObject(), Blob::create()));
- }
-
- unsigned blobPartsLength = 0;
- JSObject* blobParts = toJSSequence(exec, exec.uncheckedArgument(0), blobPartsLength);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
- ASSERT(blobParts);
-
- String type;
- String endings = ASCIILiteral("transparent");
-
- if (exec.argumentCount() > 1) {
- JSValue blobPropertyBagValue = exec.uncheckedArgument(1);
-
- if (!blobPropertyBagValue.isObject())
- return throwVMTypeError(&exec, scope, "Second argument of the constructor is not of type Object");
-
- // Given the above test, this will always yield an object.
- JSObject* blobPropertyBagObject = blobPropertyBagValue.toObject(&exec);
-
- // Create the dictionary wrapper from the initializer object.
- JSDictionary dictionary(&exec, blobPropertyBagObject);
-
- // Attempt to get the endings property and validate it.
- bool containsEndings = dictionary.get("endings", endings);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- if (containsEndings) {
- if (endings != "transparent" && endings != "native")
- return throwVMTypeError(&exec, scope, "The endings property must be either \"transparent\" or \"native\"");
- }
-
- // Attempt to get the type property.
- dictionary.get("type", type);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
- }
-
- ASSERT(endings == "transparent" || endings == "native");
-
- BlobBuilder blobBuilder;
-
- for (unsigned i = 0; i < blobPartsLength; ++i) {
- JSValue item = blobParts->get(&exec, i);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- if (ArrayBuffer* arrayBuffer = toUnsharedArrayBuffer(item))
- blobBuilder.append(arrayBuffer);
- else if (auto arrayBufferView = toUnsharedArrayBufferView(item))
- blobBuilder.append(WTFMove(arrayBufferView));
- else if (Blob* blob = JSBlob::toWrapped(item))
- blobBuilder.append(blob);
- else {
- String string = item.toWTFString(&exec);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
- blobBuilder.append(string, endings);
- }
- }
-
- auto blob = Blob::create(blobBuilder.finalize(), Blob::normalizedContentType(type));
- return JSValue::encode(createWrapper<Blob>(jsConstructor->globalObject(), WTFMove(blob)));
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFileCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSFileCustom.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1,126 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSFile.h"
-
-#include "JSDOMBinding.h"
-#include "JSDictionary.h"
-#include "ScriptExecutionContext.h"
-#include "WebKitBlobBuilder.h"
-#include <runtime/Error.h>
-#include <runtime/JSArray.h>
-#include <runtime/JSArrayBuffer.h>
-#include <runtime/JSArrayBufferView.h>
-#include <wtf/Assertions.h>
-#include <wtf/CurrentTime.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-EncodedJSValue JSC_HOST_CALL constructJSFile(ExecState& exec)
-{
- VM& vm = exec.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- auto* constructor = jsCast<DOMConstructorObject*>(exec.callee());
- ASSERT(constructor);
-
- ScriptExecutionContext* context = constructor->scriptExecutionContext();
- if (!context)
- return throwConstructorScriptExecutionContextUnavailableError(exec, scope, "File");
- ASSERT(context->isDocument());
-
- JSValue arg = exec.argument(0);
- if (arg.isUndefinedOrNull())
- return throwArgumentTypeError(exec, scope, 0, "fileBits", "File", nullptr, "sequence");
-
- unsigned blobPartsLength = 0;
- JSObject* blobParts = toJSSequence(exec, arg, blobPartsLength);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
- ASSERT(blobParts);
-
- arg = exec.argument(1);
- if (arg.isUndefined())
- return throwArgumentTypeError(exec, scope, 1, "filename", "File", nullptr, "DOMString");
-
- String filename = arg.toWTFString(&exec).replace('/', ':');
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- String normalizedType;
- std::optional<int64_t> lastModified;
-
- arg = exec.argument(2);
- if (!arg.isUndefinedOrNull()) {
- JSObject* filePropertyBagObject = arg.getObject();
- if (!filePropertyBagObject)
- return throwArgumentTypeError(exec, scope, 2, "options", "File", nullptr, "FilePropertyBag");
-
- // Create the dictionary wrapper from the initializer object.
- JSDictionary dictionary(&exec, filePropertyBagObject);
-
- // Attempt to get the type property.
- String type;
- dictionary.get("type", type);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- normalizedType = Blob::normalizedContentType(type);
-
- // Only try to parse the lastModified date if there was not an invalid type argument.
- if (type.isEmpty() || !normalizedType.isEmpty()) {
- dictionary.get("lastModified", lastModified);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
- }
- }
-
- if (!lastModified)
- lastModified = currentTimeMS();
-
- BlobBuilder blobBuilder;
-
- for (unsigned i = 0; i < blobPartsLength; ++i) {
- JSValue item = blobParts->get(&exec, i);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- if (ArrayBuffer* arrayBuffer = toUnsharedArrayBuffer(item))
- blobBuilder.append(arrayBuffer);
- else if (RefPtr<ArrayBufferView> arrayBufferView = toUnsharedArrayBufferView(item))
- blobBuilder.append(WTFMove(arrayBufferView));
- else if (Blob* blob = JSBlob::toWrapped(item))
- blobBuilder.append(blob);
- else {
- String string = item.toWTFString(&exec);
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
- blobBuilder.append(string, ASCIILiteral("transparent"));
- }
- }
-
- auto file = File::create(blobBuilder.finalize(), filename, normalizedType, lastModified.value());
- return JSValue::encode(createWrapper<File>(constructor->globalObject(), WTFMove(file)));
-}
-
-} // namespace WebCore
-
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1149,8 +1149,19 @@
</span><span class="cx">
</span><span class="cx"> sub GenerateDefaultValue
</span><span class="cx"> {
</span><del>- my ($interface, $type, $defaultValue) = @_;
</del><ins>+ my ($interface, $context, $type, $defaultValue) = @_;
</ins><span class="cx">
</span><ins>+ if ($codeGenerator->IsStringType($type)) {
+ my $useAtomicString = $context->extendedAttributes->{AtomicString};
+ if ($defaultValue eq "null") {
+ return $useAtomicString ? "nullAtom" : "String()";
+ } elsif ($defaultValue eq "\"\"") {
+ return $useAtomicString ? "emptyAtom" : "emptyString()";
+ } else {
+ return $useAtomicString ? "AtomicString(${defaultValue}, AtomicString::ConstructFromLiteral)" : "ASCIILiteral(${defaultValue})";
+ }
+ }
+
</ins><span class="cx"> if ($codeGenerator->IsEnumType($type)) {
</span><span class="cx"> # FIXME: Would be nice to report an error if the value does not have quote marks around it.
</span><span class="cx"> # FIXME: Would be nice to report an error if the value is not one of the enumeration values.
</span><span class="lines">@@ -1165,12 +1176,17 @@
</span><span class="cx"> my $IDLType = GetIDLType($interface, $type);
</span><span class="cx"> return "convert<${IDLType}>(state, jsNull());";
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> return "jsNull()" if $type->name eq "any";
</span><span class="cx"> return "nullptr" if $codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type);
</span><span class="cx"> return "String()" if $codeGenerator->IsStringType($type);
</span><span class="cx"> return "std::nullopt";
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if ($defaultValue eq "[]") {
</span><ins>+ my $IDLType = GetIDLType($interface, $type);
+ return "Converter<${IDLType}>::ReturnType{ }" if $codeGenerator->IsSequenceOrFrozenArrayType($type);
+
</ins><span class="cx"> my $nativeType = GetNativeType($interface, $type);
</span><span class="cx"> return "$nativeType()"
</span><span class="cx"> }
</span><span class="lines">@@ -1288,7 +1304,7 @@
</span><span class="cx"> # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
</span><span class="cx"> if (!$member->isRequired && defined $member->default) {
</span><span class="cx"> $result .= " } else\n";
</span><del>- $result .= " result.$key = " . GenerateDefaultValue($interface, $member->type, $member->default) . ";\n";
</del><ins>+ $result .= " result.$key = " . GenerateDefaultValue($interface, $member, $member->type, $member->default) . ";\n";
</ins><span class="cx"> } elsif ($member->isRequired) {
</span><span class="cx"> # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
</span><span class="cx"> $result .= " } else {\n";
</span><span class="lines">@@ -4382,6 +4398,9 @@
</span><span class="cx"> # As per Web IDL, optional dictionary arguments are always considered to have a default value of an empty dictionary, unless otherwise specified.
</span><span class="cx"> $argument->default("[]") if $type->name eq "Dictionary" or $codeGenerator->IsDictionaryType($type);
</span><span class="cx">
</span><ins>+ # Treat undefined the same as an empty sequence Or frozen array.
+ $argument->default("[]") if $codeGenerator->IsSequenceOrFrozenArrayType($type);
+
</ins><span class="cx"> # We use undefined as default value for optional arguments of type 'any' unless specified otherwise.
</span><span class="cx"> $argument->default("undefined") if $type->name eq "any";
</span><span class="cx">
</span><span class="lines">@@ -4436,7 +4455,7 @@
</span><span class="cx"> push(@$outputArray, " if (!${name}Value.isUndefined()) {\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@$outputArray, " if (${name}Value.isUndefined())\n");
</span><del>- push(@$outputArray, " $name = " . GenerateDefaultValue($interface, $argument->type, $argument->default) . ";\n");
</del><ins>+ push(@$outputArray, " $name = " . GenerateDefaultValue($interface, $argument, $argument->type, $argument->default) . ";\n");
</ins><span class="cx"> push(@$outputArray, " else {\n");
</span><span class="cx"> }
</span><span class="cx"> $indent = " ";
</span><span class="lines">@@ -4461,19 +4480,7 @@
</span><span class="cx"> if ($argument->isOptional && defined($argument->default) && !WillConvertUndefinedToDefaultParameterValue($type, $argument->default)) {
</span><span class="cx"> my $defaultValue = $argument->default;
</span><span class="cx">
</span><del>- # String-related optimizations.
- if ($codeGenerator->IsStringType($type)) {
- my $useAtomicString = $argument->extendedAttributes->{AtomicString};
- if ($defaultValue eq "null") {
- $defaultValue = $useAtomicString ? "nullAtom" : "String()";
- } elsif ($defaultValue eq "\"\"") {
- $defaultValue = $useAtomicString ? "emptyAtom" : "emptyString()";
- } else {
- $defaultValue = $useAtomicString ? "AtomicString($defaultValue, AtomicString::ConstructFromLiteral)" : "ASCIILiteral($defaultValue)";
- }
- } else {
- $defaultValue = GenerateDefaultValue($interface, $argument->type, $argument->default);
- }
</del><ins>+ $defaultValue = GenerateDefaultValue($interface, $argument, $argument->type, $argument->default);
</ins><span class="cx">
</span><span class="cx"> $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? $defaultValue : ";
</span><span class="cx"> $inner = "state->uncheckedArgument($argumentIndex)";
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -68,13 +68,13 @@
</span><span class="cx"> result.attr2 = convert<IDLDOMString>(state, attr2Value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><del>- result.attr2 = "";
</del><ins>+ result.attr2 = emptyString();
</ins><span class="cx"> JSValue attr3Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr3"));
</span><span class="cx"> if (!attr3Value.isUndefined()) {
</span><span class="cx"> result.attr3 = convert<IDLDOMString>(state, attr3Value);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><del>- result.attr3 = "";
</del><ins>+ result.attr3 = emptyString();
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -624,7 +624,7 @@
</span><span class="cx"> result.stringWithDefault = convert<IDLDOMString>(state, stringWithDefaultValue);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><del>- result.stringWithDefault = "defaultString";
</del><ins>+ result.stringWithDefault = ASCIILiteral("defaultString");
</ins><span class="cx"> JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
</span><span class="cx"> if (!stringWithoutDefaultValue.isUndefined()) {
</span><span class="cx"> result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
</span><span class="lines">@@ -6355,7 +6355,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto array = state->argument(0).isUndefined() ? std::optional<Vector<String>>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</del><ins>+ auto array = state->argument(0).isUndefined() ? Converter<IDLSequence<IDLDOMString>>::ReturnType{ } : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalSequence(WTFMove(array));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6373,7 +6373,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto array = state->argument(0).isUndefined() ? Vector<String>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</del><ins>+ auto array = state->argument(0).isUndefined() ? Converter<IDLSequence<IDLDOMString>>::ReturnType{ } : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.methodWithOptionalSequenceIsEmpty(WTFMove(array));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(state->callee());
</span><span class="cx"> ASSERT(castedThis);
</span><del>- auto sequenceOfStrings = state->argument(0).isUndefined() ? Vector<String>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</del><ins>+ auto sequenceOfStrings = state->argument(0).isUndefined() ? Converter<IDLSequence<IDLDOMString>>::ReturnType{ } : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings));
</span><span class="cx"> return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -498,7 +498,7 @@
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="cx"> UNUSED_PARAM(throwScope);
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto x = state->argument(0).isUndefined() ? Vector<int32_t>() : convert<IDLSequence<IDLLong>>(*state, state->uncheckedArgument(0));
</del><ins>+ auto x = state->argument(0).isUndefined() ? Converter<IDLSequence<IDLLong>>::ReturnType{ } : convert<IDLSequence<IDLLong>>(*state, state->uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> impl.func(WTFMove(x));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/Blob.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "Blob.h"
</span><span class="cx">
</span><ins>+#include "BlobBuilder.h"
+#include "BlobPart.h"
</ins><span class="cx"> #include "BlobURL.h"
</span><span class="cx"> #include "File.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="lines">@@ -74,9 +76,26 @@
</span><span class="cx"> : m_size(0)
</span><span class="cx"> {
</span><span class="cx"> m_internalURL = BlobURL::createInternalURL();
</span><del>- ThreadableBlobRegistry::registerBlobURL(m_internalURL, Vector<BlobPart>(), String());
</del><ins>+ ThreadableBlobRegistry::registerBlobURL(m_internalURL, { }, { });
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+Blob::Blob(Vector<BlobPartVariant>&& blobPartVariants, const BlobPropertyBag& propertyBag)
+ : m_internalURL(BlobURL::createInternalURL())
+ , m_type(normalizedContentType(propertyBag.type))
+ , m_size(-1)
+{
+ BlobBuilder builder(propertyBag.endings);
+ for (auto& blobPartVariant : blobPartVariants) {
+ WTF::switchOn(blobPartVariant,
+ [&] (auto& part) {
+ builder.append(WTFMove(part));
+ }
+ );
+ }
+
+ ThreadableBlobRegistry::registerBlobURL(m_internalURL, builder.finalize(), m_type);
+}
+
</ins><span class="cx"> Blob::Blob(Vector<uint8_t>&& data, const String& contentType)
</span><span class="cx"> : m_type(contentType)
</span><span class="cx"> , m_size(data.size())
</span><span class="lines">@@ -87,14 +106,6 @@
</span><span class="cx"> ThreadableBlobRegistry::registerBlobURL(m_internalURL, WTFMove(blobParts), contentType);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Blob::Blob(Vector<BlobPart>&& blobParts, const String& contentType)
- : m_type(contentType)
- , m_size(-1)
-{
- m_internalURL = BlobURL::createInternalURL();
- ThreadableBlobRegistry::registerBlobURL(m_internalURL, WTFMove(blobParts), contentType);
-}
-
</del><span class="cx"> Blob::Blob(DeserializationContructor, const URL& srcURL, const String& type, long long size, const String& fileBackedPath)
</span><span class="cx"> : m_type(normalizedContentType(type))
</span><span class="cx"> , m_size(size)
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/Blob.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -30,16 +30,24 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "BlobPart.h"
</del><ins>+#include "BlobPropertyBag.h"
</ins><span class="cx"> #include "ScriptWrappable.h"
</span><ins>+#include "URL.h"
</ins><span class="cx"> #include "URLRegistry.h"
</span><del>-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
</del><ins>+#include <wtf/Variant.h>
</ins><span class="cx">
</span><ins>+namespace JSC {
+class ArrayBufferView;
+class ArrayBuffer;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class Blob;
</ins><span class="cx"> class ScriptExecutionContext;
</span><span class="cx">
</span><ins>+using BlobPartVariant = Variant<RefPtr<JSC::ArrayBufferView>, RefPtr<JSC::ArrayBuffer>, RefPtr<Blob>, String>;
+
</ins><span class="cx"> class Blob : public ScriptWrappable, public URLRegistrable, public RefCounted<Blob> {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<Blob> create()
</span><span class="lines">@@ -47,14 +55,14 @@
</span><span class="cx"> return adoptRef(*new Blob);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static Ref<Blob> create(Vector<uint8_t>&& data, const String& contentType)
</del><ins>+ static Ref<Blob> create(Vector<BlobPartVariant>&& blobPartVariants, const BlobPropertyBag& propertyBag)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new Blob(WTFMove(data), contentType));
</del><ins>+ return adoptRef(*new Blob(WTFMove(blobPartVariants), propertyBag));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- static Ref<Blob> create(Vector<BlobPart>&& blobParts, const String& contentType)
</del><ins>+ static Ref<Blob> create(Vector<uint8_t>&& data, const String& contentType)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new Blob(WTFMove(blobParts), contentType));
</del><ins>+ return adoptRef(*new Blob(WTFMove(data), contentType));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Ref<Blob> deserialize(const URL& srcURL, const String& type, long long size, const String& fileBackedPath)
</span><span class="lines">@@ -90,8 +98,8 @@
</span><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> Blob();
</span><ins>+ Blob(Vector<BlobPartVariant>&&, const BlobPropertyBag&);
</ins><span class="cx"> Blob(Vector<uint8_t>&&, const String& contentType);
</span><del>- Blob(Vector<BlobPart>&&, const String& contentType);
</del><span class="cx">
</span><span class="cx"> enum UninitializedContructor { uninitializedContructor };
</span><span class="cx"> Blob(UninitializedContructor);
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.idl (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.idl        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/Blob.idl        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -28,16 +28,23 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+typedef (ArrayBufferView or ArrayBuffer) BufferSource;
+typedef (BufferSource or Blob or USVString) BlobPart;
+
</ins><span class="cx"> [
</span><span class="cx"> Exposed=(Window,Worker),
</span><span class="cx"> GenerateIsReachable=Impl,
</span><span class="cx"> CustomToJSObject,
</span><del>- CustomConstructor,
- CustomConstructor(sequence<any> blobParts, optional BlobPropertyBag options),
</del><ins>+ Constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options),
</ins><span class="cx"> ] interface Blob {
</span><span class="cx"> readonly attribute unsigned long long size;
</span><span class="cx"> readonly attribute DOMString type;
</span><span class="cx">
</span><ins>+ // slice Blob into byte-ranged chunks
</ins><span class="cx"> Blob slice(optional long long start = 0, optional long long end = 0x7FFFFFFFFFFFFFFF, optional DOMString? contentType = null);
</span><ins>+
+ // FIXME: Implement:
+ // readonly attribute boolean isClosed;
+ // void close();
+
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobBuildercppfromrev209152trunkSourceWebCorefileapiWebKitBlobBuildercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/fileapi/BlobBuilder.cpp (from rev 209152, trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp) (0 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobBuilder.cpp         (rev 0)
+++ trunk/Source/WebCore/fileapi/BlobBuilder.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google 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:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "BlobBuilder.h"
+
+#include "Blob.h"
+#include "LineEnding.h"
+#include "TextEncoding.h"
+#include <runtime/ArrayBuffer.h>
+#include <runtime/ArrayBufferView.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+BlobBuilder::BlobBuilder(BlobLineEndings endings)
+ : m_endings(endings)
+{
+}
+
+void BlobBuilder::append(RefPtr<ArrayBuffer>&& arrayBuffer)
+{
+ if (!arrayBuffer)
+ return;
+ m_appendableData.append(static_cast<const char*>(arrayBuffer->data()), arrayBuffer->byteLength());
+}
+
+void BlobBuilder::append(RefPtr<ArrayBufferView>&& arrayBufferView)
+{
+ if (!arrayBufferView)
+ return;
+ m_appendableData.append(static_cast<const char*>(arrayBufferView->baseAddress()), arrayBufferView->byteLength());
+}
+
+void BlobBuilder::append(RefPtr<Blob>&& blob)
+{
+ if (!blob)
+ return;
+ if (!m_appendableData.isEmpty())
+ m_items.append(BlobPart(WTFMove(m_appendableData)));
+ m_items.append(BlobPart(blob->url()));
+}
+
+void BlobBuilder::append(const String& text)
+{
+ CString utf8Text = UTF8Encoding().encode(text, EntitiesForUnencodables);
+
+ if (m_endings == BlobLineEndings::Native)
+ normalizeLineEndingsToNative(utf8Text, m_appendableData);
+ else {
+ ASSERT(m_endings == BlobLineEndings::Transparent);
+ m_appendableData.append(utf8Text.data(), utf8Text.length());
+ }
+}
+
+Vector<BlobPart> BlobBuilder::finalize()
+{
+ if (!m_appendableData.isEmpty())
+ m_items.append(BlobPart(WTFMove(m_appendableData)));
+ return WTFMove(m_items);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobBuilderhfromrev209152trunkSourceWebCorefileapiWebKitBlobBuilderh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/fileapi/BlobBuilder.h (from rev 209152, trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h) (0 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobBuilder.h         (rev 0)
+++ trunk/Source/WebCore/fileapi/BlobBuilder.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google 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:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "BlobPart.h"
+#include "BlobPropertyBag.h"
+
+namespace JSC {
+class ArrayBuffer;
+class ArrayBufferView;
+}
+
+namespace WebCore {
+
+class Blob;
+
+class BlobBuilder {
+public:
+ BlobBuilder(BlobLineEndings);
+
+ void append(RefPtr<JSC::ArrayBuffer>&&);
+ void append(RefPtr<JSC::ArrayBufferView>&&);
+ void append(RefPtr<Blob>&&);
+ void append(const String& text);
+
+ Vector<BlobPart> finalize();
+
+private:
+ BlobLineEndings m_endings;
+ Vector<BlobPart> m_items;
+ Vector<uint8_t> m_appendableData;
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobLineEndingsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/fileapi/BlobLineEndings.h (0 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobLineEndings.h         (rev 0)
+++ trunk/Source/WebCore/fileapi/BlobLineEndings.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+enum class BlobLineEndings {
+ Transparent,
+ Native
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobLineEndingsidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/fileapi/BlobLineEndings.idl (0 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobLineEndings.idl         (rev 0)
+++ trunk/Source/WebCore/fileapi/BlobLineEndings.idl        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// FIXME: This is no longer in the FileAPI spec.
+enum BlobLineEndings { "transparent", "native" };
</ins></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobPropertyBagh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/fileapi/BlobPropertyBag.h (0 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobPropertyBag.h         (rev 0)
+++ trunk/Source/WebCore/fileapi/BlobPropertyBag.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "BlobLineEndings.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct BlobPropertyBag {
+ String type;
+ BlobLineEndings endings = BlobLineEndings::Transparent;
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobPropertyBagidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/fileapi/BlobPropertyBag.idl (0 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobPropertyBag.idl         (rev 0)
+++ trunk/Source/WebCore/fileapi/BlobPropertyBag.idl        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary BlobPropertyBag {
+ DOMString type = "";
+
+ // FIXME: This is no longer in the FileAPI spec.
+ BlobLineEndings endings = "transparent";
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorefileapiFilecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/File.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/File.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/File.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -64,10 +64,17 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-File::File(Vector<BlobPart>&& blobParts, const String& filename, const String& contentType, int64_t lastModified)
- : Blob(WTFMove(blobParts), contentType)
</del><ins>+static BlobPropertyBag convertPropertyBag(const File::PropertyBag& initialBag)
+{
+ BlobPropertyBag bag;
+ bag.type = initialBag.type;
+ return bag;
+}
+
+File::File(Vector<BlobPartVariant>&& blobPartVariants, const String& filename, const PropertyBag& propertyBag)
+ : Blob(WTFMove(blobPartVariants), convertPropertyBag(propertyBag))
</ins><span class="cx"> , m_name(filename)
</span><del>- , m_overrideLastModifiedDate(lastModified)
</del><ins>+ , m_overrideLastModifiedDate(propertyBag.lastModified.value_or(currentTimeMS()))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFileh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/File.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/File.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/File.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -37,6 +37,10 @@
</span><span class="cx">
</span><span class="cx"> class File final : public Blob {
</span><span class="cx"> public:
</span><ins>+ struct PropertyBag : BlobPropertyBag {
+ std::optional<long long> lastModified;
+ };
+
</ins><span class="cx"> static Ref<File> create(const String& path)
</span><span class="cx"> {
</span><span class="cx"> return adoptRef(*new File(path));
</span><span class="lines">@@ -43,9 +47,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Create a File using the 'new File' constructor.
</span><del>- static Ref<File> create(Vector<BlobPart> blobParts, const String& filename, const String& contentType, int64_t lastModified)
</del><ins>+ static Ref<File> create(Vector<BlobPartVariant>&& blobPartVariants, const String& filename, const PropertyBag& propertyBag)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new File(WTFMove(blobParts), filename, contentType, lastModified));
</del><ins>+ return adoptRef(*new File(WTFMove(blobPartVariants), filename, propertyBag));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Ref<File> deserialize(const String& path, const URL& srcURL, const String& type, const String& name)
</span><span class="lines">@@ -76,7 +80,7 @@
</span><span class="cx"> private:
</span><span class="cx"> WEBCORE_EXPORT explicit File(const String& path);
</span><span class="cx"> File(const String& path, const String& nameOverride);
</span><del>- File(Vector<BlobPart>&& blobParts, const String& filename, const String& contentType, int64_t lastModified);
</del><ins>+ File(Vector<BlobPartVariant>&& blobPartVariants, const String& filename, const PropertyBag&);
</ins><span class="cx">
</span><span class="cx"> File(DeserializationContructor, const String& path, const URL& srcURL, const String& type, const String& name);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFileidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/File.idl (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/File.idl        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/File.idl        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -23,14 +23,21 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+typedef (ArrayBufferView or ArrayBuffer) BufferSource;
+typedef (BufferSource or Blob or USVString) BlobPart;
+
+// FIXME: This should be exposed on Workers as well.
</ins><span class="cx"> [
</span><ins>+ Constructor(sequence<BlobPart> fileBits, USVString fileName, optional FilePropertyBag options),
+ ExportMacro=WEBCORE_EXPORT,
</ins><span class="cx"> Exposed=(Window),
</span><ins>+ JSGenerateToJSObject,
</ins><span class="cx"> JSGenerateToNativeObject,
</span><del>- JSGenerateToJSObject,
- ExportMacro=WEBCORE_EXPORT,
- CustomConstructor(sequence<any> fileBits, DOMString fileName, optional FilePropertyBag options),
</del><span class="cx"> ] interface File : Blob {
</span><span class="cx"> readonly attribute DOMString name;
</span><span class="cx"> readonly attribute long long lastModified;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+dictionary FilePropertyBag : BlobPropertyBag {
+ long long lastModified;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ThreadableBlobRegistry::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
</del><ins>+void ThreadableBlobRegistry::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> if (isMainThread())
</span><span class="cx"> blobRegistry().registerBlobURL(url, WTFMove(blobParts), contentType);
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> class ThreadableBlobRegistry {
</span><span class="cx"> public:
</span><span class="cx"> static void registerFileBlobURL(const URL&, const String& path, const String& contentType);
</span><del>- static void registerBlobURL(const URL&, Vector<BlobPart> blobParts, const String& contentType);
</del><ins>+ static void registerBlobURL(const URL&, Vector<BlobPart>&& blobParts, const String& contentType);
</ins><span class="cx"> static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL);
</span><span class="cx"> static void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
</span><span class="cx"> static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end);
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiWebKitBlobBuildercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "WebKitBlobBuilder.h"
-
-#include "Blob.h"
-#include "Document.h"
-#include "File.h"
-#include "LineEnding.h"
-#include "TextEncoding.h"
-#include <runtime/ArrayBuffer.h>
-#include <runtime/ArrayBufferView.h>
-#include <wtf/Vector.h>
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringView.h>
-
-namespace WebCore {
-
-enum BlobConstructorArrayBufferOrView {
- BlobConstructorArrayBuffer,
- BlobConstructorArrayBufferView,
- BlobConstructorArrayBufferOrViewMax,
-};
-
-BlobBuilder::BlobBuilder()
-{
-}
-
-void BlobBuilder::append(const String& text, const String& endingType)
-{
- CString utf8Text = UTF8Encoding().encode(text, EntitiesForUnencodables);
-
- if (endingType == "native")
- normalizeLineEndingsToNative(utf8Text, m_appendableData);
- else {
- ASSERT(endingType == "transparent");
- m_appendableData.append(utf8Text.data(), utf8Text.length());
- }
-}
-
-void BlobBuilder::append(ArrayBuffer* arrayBuffer)
-{
- if (!arrayBuffer)
- return;
-
- m_appendableData.append(static_cast<const char*>(arrayBuffer->data()), arrayBuffer->byteLength());
-}
-
-void BlobBuilder::append(RefPtr<ArrayBufferView>&& arrayBufferView)
-{
- if (!arrayBufferView)
- return;
-
- m_appendableData.append(static_cast<const char*>(arrayBufferView->baseAddress()), arrayBufferView->byteLength());
-}
-
-void BlobBuilder::append(Blob* blob)
-{
- if (!blob)
- return;
- if (!m_appendableData.isEmpty())
- m_items.append(BlobPart(WTFMove(m_appendableData)));
- m_items.append(BlobPart(blob->url()));
-}
-
-Vector<BlobPart> BlobBuilder::finalize()
-{
- if (!m_appendableData.isEmpty())
- m_items.append(BlobPart(WTFMove(m_appendableData)));
- return WTFMove(m_items);
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorefileapiWebKitBlobBuilderh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "BlobPart.h"
-
-namespace JSC {
-class ArrayBuffer;
-class ArrayBufferView;
-}
-
-namespace WebCore {
-
-class Blob;
-
-class BlobBuilder {
-public:
- BlobBuilder();
-
- void append(Blob*);
- void append(const String& text, const String& ending);
- void append(JSC::ArrayBuffer*);
- void append(RefPtr<JSC::ArrayBufferView>&&);
-
- Vector<BlobPart> finalize();
-
-private:
- Vector<BlobPart> m_items;
- Vector<uint8_t> m_appendableData;
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobParth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobPart.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobPart.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/platform/network/BlobPart.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef BlobPart_h
-#define BlobPart_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "URL.h"
</span><span class="cx">
</span><span class="lines">@@ -86,5 +85,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // BlobPart_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> virtual void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) = 0;
</span><span class="cx">
</span><span class="cx"> // Registers a blob URL referring to the specified blob data.
</span><del>- virtual void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) = 0;
</del><ins>+ virtual void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) = 0;
</ins><span class="cx">
</span><span class="cx"> // Registers a new blob URL referring to the blob data identified by the specified srcURL.
</span><span class="cx"> virtual void registerBlobURL(const URL&, const URL& srcURL) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx"> m_blobs.set(url.string(), WTFMove(blobData));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BlobRegistryImpl::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
</del><ins>+void BlobRegistryImpl::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> registerBlobResourceHandleConstructor();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> void appendStorageItems(BlobData*, const BlobDataItemList&, long long offset, long long length);
</span><span class="cx">
</span><span class="cx"> void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) override;
</span><del>- void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) override;
</del><ins>+ void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) override;
</ins><span class="cx"> void registerBlobURL(const URL&, const URL& srcURL) override;
</span><span class="cx"> void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) override;
</span><span class="cx"> void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebKit2/ChangeLog        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-11-30 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove custom bindings for File and Blob constructors
+ https://bugs.webkit.org/show_bug.cgi?id=165218
+
+ Reviewed by Darin Adler.
+
+ * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+ (WebKit::NetworkBlobRegistry::registerBlobURL):
+ * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
+ * NetworkProcess/NetworkConnectionToWebProcess.h:
+ * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+ (WebKit::BlobRegistryProxy::registerBlobURL):
+ * WebProcess/FileAPI/BlobRegistryProxy.h:
+ Avoid copies of the BlobPart Vector.
+
</ins><span class="cx"> 2016-11-30 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> mapIterator->value.add(url);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, Vector<WebCore::BlobPart> blobParts, const String& contentType)
</del><ins>+void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, Vector<WebCore::BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> blobRegistry().registerBlobURL(url, WTFMove(blobParts), contentType);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> static NetworkBlobRegistry& singleton();
</span><span class="cx">
</span><span class="cx"> void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType);
</span><del>- void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);
</del><ins>+ void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
</ins><span class="cx"> void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL);
</span><span class="cx"> void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType);
</span><span class="cx"> void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -251,7 +251,7 @@
</span><span class="cx"> NetworkBlobRegistry::singleton().registerFileBlobURL(this, url, path, WTFMove(extension), contentType);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
</del><ins>+void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> NetworkBlobRegistry::singleton().registerBlobURL(this, url, WTFMove(blobParts), contentType);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> void addCookie(WebCore::SessionID, const WebCore::URL&, const WebCore::Cookie&);
</span><span class="cx">
</span><span class="cx"> void registerFileBlobURL(const WebCore::URL&, const String& path, const SandboxExtension::Handle&, const String& contentType);
</span><del>- void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);
</del><ins>+ void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
</ins><span class="cx"> void registerBlobURLFromURL(const WebCore::URL&, const WebCore::URL& srcURL);
</span><span class="cx"> void preregisterSandboxExtensionsForOptionallyFileBackedBlob(const Vector<String>& fileBackedPath, const SandboxExtension::HandleArray&);
</span><span class="cx"> void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
</del><ins>+void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h (209183 => 209184)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2016-12-01 17:48:28 UTC (rev 209183)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2016-12-01 18:04:58 UTC (rev 209184)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> class BlobRegistryProxy final : public WebCore::BlobRegistry {
</span><span class="cx"> public:
</span><span class="cx"> void registerFileBlobURL(const WebCore::URL&, Ref<WebCore::BlobDataFileReference>&&, const String& contentType) override;
</span><del>- void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType) override;
</del><ins>+ void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>&&, const String& contentType) override;
</ins><span class="cx"> void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL) override;
</span><span class="cx"> void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) override;
</span><span class="cx"> void unregisterBlobURL(const WebCore::URL&) override;
</span></span></pre>
</div>
</div>
</body>
</html>