<!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>[195954] 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/195954">195954</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-02-01 03:05:39 -0800 (Mon, 01 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Fetch API] Implement Fetch API Request
https://bugs.webkit.org/show_bug.cgi?id=153437

LayoutTests/imported/w3c:

Reviewed by Darin Adler.

* web-platform-tests/fetch/api/headers/headers-basic.html:
* web-platform-tests/fetch/api/request/request-clone.sub-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-clone.sub.html: Added.
* web-platform-tests/fetch/api/request/request-consume-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-consume.html: Added.
* web-platform-tests/fetch/api/request/request-disturbed-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-disturbed.html: Added.
* web-platform-tests/fetch/api/request/request-error-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-error.html: Added.
* web-platform-tests/fetch/api/request/request-headers-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-headers.html: Added.
* web-platform-tests/fetch/api/request/request-idl-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-idl.html: Added.
* web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-init-001.sub.html: Added.
* web-platform-tests/fetch/api/request/request-init-002-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-init-002.html: Added.
* web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-init-003.sub.html: Added.
* web-platform-tests/fetch/api/request/request-structure-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-structure.html: Added.
* web-platform-tests/fetch/api/resources/authentication.py: Added.
(main):
* web-platform-tests/fetch/api/resources/clean-stash.py: Added.
(main):
* web-platform-tests/fetch/api/resources/inspect-headers.py: Added.
(main):
* web-platform-tests/fetch/api/resources/method.py: Added.
(main):
* web-platform-tests/fetch/api/resources/preflight.py: Added.
(main):
* web-platform-tests/fetch/api/resources/redirect.py: Added.
(main):
* web-platform-tests/fetch/api/resources/top.txt: Added.
* web-platform-tests/fetch/api/resources/trickle.py: Added.
(main):
* web-platform-tests/fetch/api/resources/utils.js: Added.
(catch):
(dirname):
(checkRequest):
(readTextStream):

Source/WebCore:

Added support for Fetch Request and Body.
Body is sharing functionality between Request and Response.
Conversion between various body types are not implemented yet.

Added a FetchOptions class. Options in this class are partially redundant with ResourceLoaderOptions.

Fixing bug in Headers constructor.
Making error reporting in case of modifying headers compliant with the spec.

Reviewed by Darin Adler.

Tests: imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html
       imported/w3c/web-platform-tests/fetch/api/request/request-consume.html
       imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html
       imported/w3c/web-platform-tests/fetch/api/request/request-error.html
       imported/w3c/web-platform-tests/fetch/api/request/request-headers.html
       imported/w3c/web-platform-tests/fetch/api/request/request-idl.html
       imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html
       imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
       imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
       imported/w3c/web-platform-tests/fetch/api/request/request-structure.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/fetch/FetchBody.cpp: Added.
(WebCore::FetchBody::initBody):
(WebCore::FetchBody::clear):
(WebCore::FetchBody::processIfEmptyOrDisturbed):
(WebCore::FetchBody::arrayBuffer):
(WebCore::FetchBody::formData):
(WebCore::FetchBody::blob):
(WebCore::FetchBody::text):
(WebCore::FetchBody::json):
* Modules/fetch/FetchBody.h: Added.
(WebCore::FetchBody::~FetchBody):
(WebCore::FetchBody::isEmpty):
(WebCore::FetchBody::isDisturbed):
(WebCore::FetchBody::setDisturbed):
(WebCore::FetchBody::setMimeType):
(WebCore::FetchBody::mimeType):
* Modules/fetch/FetchBody.idl: Added.
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader):
(WebCore::FetchHeaders::append):
(WebCore::FetchHeaders::remove):
(WebCore::FetchHeaders::set):
(WebCore::FetchHeaders::fill): Helper routine implementing https://fetch.spec.whatwg.org/#concept-headers-fill
* Modules/fetch/FetchHeaders.h: Adding header getter/setter for FetchRequest.
(WebCore::FetchHeaders::fastGet):
(WebCore::FetchHeaders::fastSet):
* Modules/fetch/FetchHeaders.js: Fixing bug in constructor (covered by modified headers-basc.html test).
(initializeFetchHeaders):
* Modules/fetch/FetchOptions.h: Added.
(WebCore::FetchOptions::FetchOptions):
(WebCore::FetchOptions::type):
(WebCore::FetchOptions::destination):
(WebCore::FetchOptions::mode):
(WebCore::FetchOptions::credentials):
(WebCore::FetchOptions::cache):
(WebCore::FetchOptions::redirect):
(WebCore::FetchOptions::referrerPolicy):
(WebCore::FetchOptions::setType):
(WebCore::FetchOptions::setDestination):
(WebCore::FetchOptions::setMode):
(WebCore::FetchOptions::setCredentials):
(WebCore::FetchOptions::setCache):
(WebCore::FetchOptions::setRedirect):
(WebCore::FetchOptions::setReferrerPolicy):
* Modules/fetch/FetchRequest.cpp: Added.
(WebCore::FetchRequest::create):
(WebCore::FetchRequest::FetchRequest):
(WebCore::FetchRequest::init):
(WebCore::FetchRequest::setReferrer):
(WebCore::FetchRequest::setReferrerPolicy):
(WebCore::FetchRequest::setMode):
(WebCore::FetchRequest::setCredentials):
(WebCore::FetchRequest::setCache):
(WebCore::FetchRequest::setRedirect):
(WebCore::FetchRequest::type):
(WebCore::FetchRequest::destination):
(WebCore::FetchRequest::referrerPolicy):
(WebCore::FetchRequest::referrer):
(WebCore::FetchRequest::mode):
(WebCore::FetchRequest::credentials):
(WebCore::FetchRequest::cache):
(WebCore::FetchRequest::redirect):
(WebCore::FetchRequest::setMethod):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchRequest.h: Added.
(WebCore::FetchRequest::method):
(WebCore::FetchRequest::url):
(WebCore::FetchRequest::integrity):
(WebCore::FetchRequest::headers):
* Modules/fetch/FetchRequest.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/Dictionary.h:
(WebCore::Dictionary::execState):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::get):

LayoutTests:

Reviewed by Darin Adler.

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheadersbasichtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html</a></li>
<li><a href="#trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt">trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformefljsdomglobalconstructorsattributesdedicatedworkerexpectedtxt">trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformefljsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkjsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacjsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmavericksjsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacyosemitejsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwinjsdomglobalconstructorsattributesexpectedtxt">trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-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="#trunkSourceWebCoreModulesfetchFetchHeaderscpp">trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchHeadersh">trunk/Source/WebCore/Modules/fetch/FetchHeaders.h</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchHeadersjs">trunk/Source/WebCore/Modules/fetch/FetchHeaders.js</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsDictionaryh">trunk/Source/WebCore/bindings/js/Dictionary.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionarycpp">trunk/Source/WebCore/bindings/js/JSDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionaryh">trunk/Source/WebCore/bindings/js/JSDictionary.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestclonesubexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestclonesubhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestconsumeexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestconsumehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestdisturbedexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestdisturbedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequesterrorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequesterrorhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestheadersexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestheadershtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestidlexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestidlhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit001subexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit001subhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit002html">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit003subexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit003subhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequeststructureexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequeststructurehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure.html</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesauthenticationpy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/authentication.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcescleanstashpy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/clean-stash.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesinspectheaderspy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/inspect-headers.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesmethodpy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/method.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcespreflightpy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/preflight.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesredirectpy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/redirect.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcestoptxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/top.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcestricklepy">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/trickle.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesutilsjs">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchBodycpp">trunk/Source/WebCore/Modules/fetch/FetchBody.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchBodyh">trunk/Source/WebCore/Modules/fetch/FetchBody.h</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchBodyidl">trunk/Source/WebCore/Modules/fetch/FetchBody.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchOptionsh">trunk/Source/WebCore/Modules/fetch/FetchOptions.h</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchRequestcpp">trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchRequesth">trunk/Source/WebCore/Modules/fetch/FetchRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchRequestidl">trunk/Source/WebCore/Modules/fetch/FetchRequest.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/ChangeLog        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-02-01  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Fetch API] Implement Fetch API Request
+        https://bugs.webkit.org/show_bug.cgi?id=153437
+
+        Reviewed by Darin Adler.
+
+        * js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+        * js/dom/global-constructors-attributes-expected.txt:
+        * platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+        * platform/efl/js/dom/global-constructors-attributes-expected.txt:
+        * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+        * platform/win/js/dom/global-constructors-attributes-expected.txt:
+
</ins><span class="cx"> 2016-01-31  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add resize event for HTMLMediaElement
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2016-02-01  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Fetch API] Implement Fetch API Request
+        https://bugs.webkit.org/show_bug.cgi?id=153437
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/fetch/api/headers/headers-basic.html:
+        * web-platform-tests/fetch/api/request/request-clone.sub-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-clone.sub.html: Added.
+        * web-platform-tests/fetch/api/request/request-consume-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-consume.html: Added.
+        * web-platform-tests/fetch/api/request/request-disturbed-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-disturbed.html: Added.
+        * web-platform-tests/fetch/api/request/request-error-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-error.html: Added.
+        * web-platform-tests/fetch/api/request/request-headers-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-headers.html: Added.
+        * web-platform-tests/fetch/api/request/request-idl-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-idl.html: Added.
+        * web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-init-001.sub.html: Added.
+        * web-platform-tests/fetch/api/request/request-init-002-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-init-002.html: Added.
+        * web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-init-003.sub.html: Added.
+        * web-platform-tests/fetch/api/request/request-structure-expected.txt: Added.
+        * web-platform-tests/fetch/api/request/request-structure.html: Added.
+        * web-platform-tests/fetch/api/resources/authentication.py: Added.
+        (main):
+        * web-platform-tests/fetch/api/resources/clean-stash.py: Added.
+        (main):
+        * web-platform-tests/fetch/api/resources/inspect-headers.py: Added.
+        (main):
+        * web-platform-tests/fetch/api/resources/method.py: Added.
+        (main):
+        * web-platform-tests/fetch/api/resources/preflight.py: Added.
+        (main):
+        * web-platform-tests/fetch/api/resources/redirect.py: Added.
+        (main):
+        * web-platform-tests/fetch/api/resources/top.txt: Added.
+        * web-platform-tests/fetch/api/resources/trickle.py: Added.
+        (main):
+        * web-platform-tests/fetch/api/resources/utils.js: Added.
+        (catch):
+        (dirname):
+        (checkRequest):
+        (readTextStream):
+
</ins><span class="cx"> 2016-01-31  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add resize event for HTMLMediaElement
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheadersbasichtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx">           assert_equals(headers.get(name), String(headerDict[name]),
</span><span class="cx">             &quot;name: &quot; + name + &quot; has value: &quot; + headerDict[name]);
</span><span class="cx">         }
</span><ins>+        assert_equals(headers.get(&quot;length&quot;), null, &quot;init should be treated as a sequence, not as a dictionary&quot;);
</ins><span class="cx">       }, &quot;Create headers with sequence&quot;);
</span><span class="cx"> 
</span><span class="cx">       test(function() {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestclonesubexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+FAIL Check cloning a request ExpectedValuesDict[&quot;headers&quot;].keys is not a function. (In 'ExpectedValuesDict[&quot;headers&quot;].keys()', 'ExpectedValuesDict[&quot;headers&quot;].keys' is undefined)
+PASS Check cloning a request copies the headers 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestclonesubhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request clone&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      var headers = new Headers( {&quot;name&quot; : &quot;value&quot;} );
+      var emptyHeaders = new Headers();
+
+      var initValuesDict = {&quot;method&quot; : &quot;POST&quot;,
+                            &quot;referrer&quot; : &quot;http://{{host}}:{{ports[http][0]}}/&quot;,
+                            &quot;referrerPolicy&quot; : &quot;origin-only&quot;,
+                            &quot;mode&quot; : &quot;same-origin&quot;,
+                            &quot;credentials&quot; : &quot;include&quot;,
+                            &quot;cache&quot; : &quot;no-cache&quot;,
+                            &quot;redirect&quot; : &quot;error&quot;,
+                            &quot;integrity&quot; : &quot;Request's Integrity&quot;,
+                            &quot;headers&quot; : headers,
+                            &quot;body&quot; : &quot;Request's body&quot;
+      };
+
+      var expectedInitialized = {&quot;method&quot; : &quot;POST&quot;,
+                                 &quot;referrer&quot; : &quot;http://{{host}}:{{ports[http][0]}}/&quot;,
+                                 &quot;referrerPolicy&quot; : &quot;origin-only&quot;,
+                                 &quot;mode&quot; : &quot;same-origin&quot;,
+                                 &quot;credentials&quot; : &quot;include&quot;,
+                                 &quot;cache&quot; : &quot;no-cache&quot;,
+                                 &quot;redirect&quot; : &quot;error&quot;,
+                                 &quot;integrity&quot; : &quot;Request's Integrity&quot;,
+                                 &quot;headers&quot; : headers,
+                                 &quot;body&quot; : &quot;Request's body&quot;
+      };
+
+      test(function() {
+        var RequestInitialized = new Request(&quot;&quot;, initValuesDict);
+        var requestToCheck = RequestInitialized.clone();
+        checkRequest(requestToCheck, expectedInitialized);
+      }, &quot;Check cloning a request&quot;);
+
+      test(function() {
+        var initialRequest = new Request(&quot;&quot;, {&quot;headers&quot; : new Headers({&quot;a&quot;: &quot;1&quot;, &quot;b&quot; : &quot;2&quot;})});
+        var request = initialRequest.clone();
+        assert_equals(request.headers.get(&quot;a&quot;), &quot;1&quot;, &quot;cloned request should have header 'a'&quot;);
+        assert_equals(request.headers.get(&quot;b&quot;), &quot;2&quot;, &quot;cloned request should have header 'b'&quot;);
+
+        initialRequest.headers.delete(&quot;a&quot;);
+        assert_equals(request.headers.get(&quot;a&quot;), &quot;1&quot;, &quot;cloned request should still have header 'a'&quot;);
+
+        request.headers.delete(&quot;a&quot;);
+        assert_equals(initialRequest.headers.get(&quot;b&quot;), &quot;2&quot;, &quot;initial request should have header 'b'&quot;);
+
+      }, &quot;Check cloning a request copies the headers&quot;);
+
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestconsumeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+
+PASS Consume request's body as text 
+FAIL Consume request's body as blob promise_test: Unhandled rejection with value: undefined
+PASS Consume request's body as arrayBuffer 
+PASS Consume request's body as json 
+FAIL Consume request's body as formData promise_test: Unhandled rejection with value: undefined
+PASS Consume JSON from text: '&quot;null&quot;' 
+PASS Consume JSON from text: '&quot;1&quot;' 
+PASS Consume JSON from text: '&quot;true&quot;' 
+PASS Consume JSON from text: '&quot;\&quot;string\&quot;&quot;' 
+PASS Trying to consume bad JSON text as JSON: 'undefined' 
+PASS Trying to consume bad JSON text as JSON: '{' 
+PASS Trying to consume bad JSON text as JSON: 'a' 
+PASS Trying to consume bad JSON text as JSON: '[' 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestconsumehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request consume&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#body-mixin&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+    function checkBodyText(request, expectedBody) {
+      return request.text().then( function(bodyAsText) {
+        assert_equals(bodyAsText, expectedBody, &quot;Retrieve and verify request's body&quot;);
+        assert_true(request.bodyUsed, &quot;body as text: bodyUsed turned true&quot;);
+      });
+    }
+
+    function checkBodyBlob(request, expectedBody) {
+      return request.blob().then(function(bodyAsBlob) {
+        var promise = new Promise(function (resolve, reject) {
+          var reader = new FileReader();
+          reader.onload = function(evt) {
+            resolve(reader.result)
+          };
+          reader.onerror = function() {
+            reject(&quot;Blob's reader failed&quot;);
+          };
+          reader.readAsText(bodyAsBlob);
+        });
+        return promise.then(function(body) {
+          assert_equals(body, expectedBody, &quot;Retrieve and verify request's body&quot;);
+          assert_true(request.bodyUsed, &quot;body as blob: bodyUsed turned true&quot;);
+        });
+      });
+    }
+
+    &lt;!-- Taken from https://developers.google.com --&gt;
+    function str2ab(str) {
+      var buf = new ArrayBuffer(str.length*2); // 2 bytes for each char
+      var bufView = new Uint16Array(buf);
+      for (var i=0, strLen=str.length; i &lt; strLen; i++) {
+        bufView[i] = str.charCodeAt(i);
+      }
+      return buf;
+    }
+
+    function checkBodyArrayBuffer(request, expectedBody) {
+      return request.arrayBuffer().then( function(bodyAsArrayBuffer) {
+        assert_array_equals(bodyAsArrayBuffer, str2ab(expectedBody), &quot;Retrieve and verify request's body&quot;);
+        assert_true(request.bodyUsed, &quot;body as arrayBuffer: bodyUsed turned true&quot;);
+      });
+    }
+
+    function checkBodyJSON(request, expectedBody) {
+      return request.json().then(function(bodyAsJSON) {
+        var strBody = JSON.stringify(bodyAsJSON)
+        assert_equals(strBody, expectedBody, &quot;Retrieve and verify request's body&quot;);
+        assert_true(request.bodyUsed, &quot;body as json: bodyUsed turned true&quot;);
+      });
+    }
+
+    function checkBodyFormData(request, expectedBody) {
+      return request.formData().then(function(bodyAsFormData) {
+        assert_true(bodyAsFormData instanceof FormData, &quot;Should receive a FormData&quot;);
+        assert_true(request.bodyUsed, &quot;body as formData: bodyUsed turned true&quot;);
+     });
+    }
+
+    function checkRequestBody(body, bodyType, checkFunction) {
+      promise_test(function(test) {
+        var request = new Request(&quot;&quot;, {&quot;method&quot;: &quot;POST&quot;, &quot;body&quot;: body });
+        assert_false(request.bodyUsed, &quot;bodyUsed is false at init&quot;);
+        return checkFunction(request, body);
+      }, &quot;Consume request's body as &quot; + bodyType);
+    }
+
+    var formData = new FormData();
+    formData.append(&quot;name&quot;, &quot;value&quot;)
+    checkRequestBody(&quot;This is request's body&quot;, &quot;text&quot;, checkBodyText);
+    checkRequestBody(&quot;This is request's body&quot;, &quot;blob&quot;, checkBodyBlob);
+    checkRequestBody(&quot;This is request's body&quot;, &quot;arrayBuffer&quot;, checkBodyArrayBuffer);
+    checkRequestBody(JSON.stringify(&quot;This is request's body&quot;), &quot;json&quot;, checkBodyJSON);
+    checkRequestBody(formData, &quot;formData&quot;, checkBodyFormData);
+
+    var goodJSONValues = [&quot;null&quot;, &quot;1&quot;, &quot;true&quot;, &quot;\&quot;string\&quot;&quot;];
+    goodJSONValues.forEach(function(value) {
+      promise_test(function(test) {
+        var request = new Request(&quot;&quot;, {&quot;method&quot;: &quot;POST&quot;, &quot;body&quot;: value});
+        return request.json().then(function(v) {
+          assert_equals(v, JSON.parse(value));
+        });
+      }, &quot;Consume JSON from text: '&quot; + JSON.stringify(value) + &quot;'&quot;);
+    });
+
+    var badJSONValues = [&quot;undefined&quot;, &quot;{&quot;, &quot;a&quot;, &quot;[&quot;];
+    badJSONValues.forEach(function(value) {
+      promise_test(function(test) {
+        var request = new Request(&quot;&quot;, {&quot;method&quot;: &quot;POST&quot;, &quot;body&quot;: &quot;{&quot;});
+        return promise_rejects(test, new SyntaxError(), request.json());
+      }, &quot;Trying to consume bad JSON text as JSON: '&quot; + value + &quot;'&quot;);
+    });
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestdisturbedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS Request without body cannot be disturbed 
+PASS Check cloning a disturbed request 
+PASS Check creating a new request from a disturbed request 
+PASS Input request used for creating new request became disturbed 
+PASS Check consuming a disturbed request 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestdisturbedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request disturbed&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#body-mixin&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      var initValuesDict = {&quot;method&quot; : &quot;POST&quot;,
+                            &quot;body&quot; : &quot;Request's body&quot;
+      };
+
+      var noBodyConsumed = new Request(&quot;&quot;);
+      noBodyConsumed.blob();
+      var bodyConsumed = new Request(&quot;&quot;, initValuesDict);
+      bodyConsumed.blob();
+
+      test(function() {
+        assert_false(noBodyConsumed.bodyUsed , &quot;bodyUsed is false when request is not disturbed&quot;);
+        try {
+          noBodyConsumed.clone();
+        } catch (e) {
+          assert_unreached(&quot;Can use request not disturbed for creating or cloning request&quot;);
+        }
+      }, &quot;Request without body cannot be disturbed&quot;);
+
+      test(function() {
+        assert_true(bodyConsumed.bodyUsed , &quot;bodyUsed is true when request is disturbed&quot;);
+        assert_throws(new TypeError(), function() { bodyConsumed.clone(); });
+      }, &quot;Check cloning a disturbed request&quot;);
+
+      test(function() {
+        assert_true(bodyConsumed.bodyUsed , &quot;bodyUsed is true when request is disturbed&quot;);
+        assert_throws(new TypeError(), function() { new Request(bodyConsumed); });
+      }, &quot;Check creating a new request from a disturbed request&quot;);
+
+      test(function() {
+        var bodyRequest = new Request(&quot;&quot;, initValuesDict);
+        assert_false(bodyRequest.bodyUsed , &quot;bodyUsed is false when request is not disturbed&quot;);
+        var requestFromRequest = new Request(bodyRequest);
+        assert_true(bodyRequest.bodyUsed , &quot;bodyUsed is true when request is disturbed&quot;);
+      }, &quot;Input request used for creating new request became disturbed&quot;);
+
+      promise_test(function(test) {
+        assert_true(bodyConsumed.bodyUsed , &quot;bodyUsed is true when request is disturbed&quot;);
+        return promise_rejects(test, new TypeError(), bodyConsumed.blob());
+      }, &quot;Check consuming a disturbed request&quot;);
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequesterrorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+
+PASS RequestInit's window is not null 
+PASS Input URL is not valid 
+PASS Input URL has credentials 
+PASS RequestInit's mode is navigate 
+PASS RequestInit's referrer is invalid 
+PASS RequestInit's referrer has invalid origin 
+PASS RequestInit's method is invalid 
+PASS RequestInit's method is forbidden 
+PASS RequestInit's mode is no-cors and method is not simple 
+PASS RequestInit's mode is no-cors and integrity is not empty 
+PASS Bad referrerPolicy init parameter value 
+PASS Bad mode init parameter value 
+PASS Bad credentials init parameter value 
+PASS Bad cache init parameter value 
+PASS Bad redirect init parameter value 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequesterrorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-error.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request error&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#body-mixin&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;&quot;, {&quot;window&quot; : &quot;whatever&quot;}); },
+          &quot;Expect TypeError exception&quot;);
+      },&quot;RequestInit's window is not null&quot;);
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;http://:not a valid URL&quot;); },
+          &quot;Expect TypeError exception&quot;);
+      },&quot;Input URL is not valid&quot;)
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;http://user:pass@test.url&quot;); },
+          &quot;Expect TypeError exception&quot;);
+      },&quot;Input URL has credentials&quot;);
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;&quot;, {&quot;mode&quot; : &quot;navigate&quot;}); },
+          &quot;Expect TypeError exception&quot;);
+      },&quot;RequestInit's mode is navigate&quot;);
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;&quot;, {&quot;referrer&quot; : &quot;http://:not a valid URL&quot;}); },
+          &quot;Expect TypeError exception&quot;);
+      },&quot;RequestInit's referrer is invalid&quot;);
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;&quot;, {&quot;referrer&quot; : &quot;http://test.url&quot;}); },
+          &quot;Expect TypeError exception&quot;);
+      },&quot;RequestInit's referrer has invalid origin&quot;)
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;&quot;, {&quot;method&quot; : &quot;IN VALID&quot;}); },
+          &quot;Expect TypeError exception&quot;);
+      }, &quot;RequestInit's method is invalid&quot;);
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;&quot;, {&quot;method&quot; : &quot;TRACE&quot;}); },
+          &quot;Expect TypeError exception&quot;);
+      }, &quot;RequestInit's method is forbidden&quot;);
+
+      test(function() {
+        assert_throws(new TypeError() , function() { new Request(&quot;&quot;, {&quot;mode&quot; : &quot;no-cors&quot;, &quot;method&quot; : &quot;PUT&quot;}); },
+          &quot;Expect TypeError exception&quot;);
+      },&quot;RequestInit's mode is no-cors and method is not simple&quot;);
+
+      test(function() {
+        assert_throws(new TypeError() ,
+                      function() { new Request(&quot;&quot;, {&quot;mode&quot; : &quot;no-cors&quot;, &quot;integrity&quot; : &quot;not  an empty string&quot;}); },
+                      &quot;Expect TypeError exception&quot;);
+      },&quot;RequestInit's mode is no-cors and integrity is not empty&quot;);
+
+      var parameters = [&quot;referrerPolicy&quot;, &quot;mode&quot;, &quot;credentials&quot;, &quot;cache&quot;, &quot;redirect&quot;];
+      parameters.forEach(function(parameter) {
+        test(function() {
+          var options = { };
+          options[parameter] = &quot;BAD&quot;;
+          assert_throws(new TypeError(), () =&gt; new Request(&quot;&quot;, options));
+        },&quot;Bad &quot; + parameter +&quot; init parameter value&quot;);
+      });
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestheadersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+
+PASS Adding valid request header &quot;Content-Type: OK&quot; 
+PASS Adding valid request header &quot;Potato: OK&quot; 
+PASS Adding valid request header &quot;proxy: OK&quot; 
+PASS Adding valid request header &quot;proxya: OK&quot; 
+PASS Adding valid request header &quot;sec: OK&quot; 
+PASS Adding valid request header &quot;secb: OK&quot; 
+PASS Adding invalid request header &quot;Accept-Charset: KO&quot; 
+PASS Adding invalid request header &quot;accept-charset: KO&quot; 
+PASS Adding invalid request header &quot;ACCEPT-ENCODING: KO&quot; 
+PASS Adding invalid request header &quot;Accept-Encoding: KO&quot; 
+PASS Adding invalid request header &quot;Access-Control-Request-Headers: KO&quot; 
+PASS Adding invalid request header &quot;Access-Control-Request-Method: KO&quot; 
+PASS Adding invalid request header &quot;Connection: KO&quot; 
+PASS Adding invalid request header &quot;Content-Length: KO&quot; 
+PASS Adding invalid request header &quot;Cookie: KO&quot; 
+PASS Adding invalid request header &quot;Cookie2: KO&quot; 
+PASS Adding invalid request header &quot;Date: KO&quot; 
+PASS Adding invalid request header &quot;DNT: KO&quot; 
+PASS Adding invalid request header &quot;Expect: KO&quot; 
+PASS Adding invalid request header &quot;Host: KO&quot; 
+PASS Adding invalid request header &quot;Keep-Alive: KO&quot; 
+PASS Adding invalid request header &quot;Origin: KO&quot; 
+PASS Adding invalid request header &quot;Referer: KO&quot; 
+PASS Adding invalid request header &quot;TE: KO&quot; 
+PASS Adding invalid request header &quot;Trailer: KO&quot; 
+PASS Adding invalid request header &quot;Transfer-Encoding: KO&quot; 
+PASS Adding invalid request header &quot;Upgrade: KO&quot; 
+PASS Adding invalid request header &quot;Via: KO&quot; 
+PASS Adding invalid request header &quot;Proxy-: KO&quot; 
+PASS Adding invalid request header &quot;proxy-a: KO&quot; 
+PASS Adding invalid request header &quot;Sec-: KO&quot; 
+PASS Adding invalid request header &quot;sec-b: KO&quot; 
+PASS Adding valid no-cors request header &quot;Accept: OK&quot; 
+PASS Adding valid no-cors request header &quot;Accept-Language: OK&quot; 
+PASS Adding valid no-cors request header &quot;content-language: OK&quot; 
+PASS Adding valid no-cors request header &quot;content-type: application/x-www-form-urlencoded&quot; 
+PASS Adding valid no-cors request header &quot;content-type: application/x-www-form-urlencoded;charset=UTF-8&quot; 
+PASS Adding valid no-cors request header &quot;content-type: multipart/form-data&quot; 
+PASS Adding valid no-cors request header &quot;content-type: multipart/form-data;charset=UTF-8&quot; 
+PASS Adding valid no-cors request header &quot;content-TYPE: text/plain&quot; 
+PASS Adding valid no-cors request header &quot;CONTENT-type: text/plain;charset=UTF-8&quot; 
+PASS Adding invalid no-cors request header &quot;Content-Type: KO&quot; 
+PASS Adding invalid no-cors request header &quot;Potato: KO&quot; 
+PASS Adding invalid no-cors request header &quot;proxy: KO&quot; 
+PASS Adding invalid no-cors request header &quot;proxya: KO&quot; 
+PASS Adding invalid no-cors request header &quot;sec: KO&quot; 
+PASS Adding invalid no-cors request header &quot;secb: KO&quot; 
+PASS Check that request constructor is filtering headers provided as init parameter 
+PASS Check that no-cors request constructor is filtering headers provided as init parameter 
+PASS Check that no-cors request constructor is filtering headers provided as part of request parameter 
+PASS Request should get its content-type from the init request 
+PASS Request should not get its content-type from the init request if init headers are provided 
+PASS Request should get its content-type from the body if none is provided 
+PASS Request should get its content-type from init headers if one is provided 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestheadershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-headers.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,150 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request Headers&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      var validRequestHeaders = [
+        [&quot;Content-Type&quot;, &quot;OK&quot;],
+        [&quot;Potato&quot;, &quot;OK&quot;],
+        [&quot;proxy&quot;, &quot;OK&quot;],
+        [&quot;proxya&quot;, &quot;OK&quot;],
+        [&quot;sec&quot;, &quot;OK&quot;],
+        [&quot;secb&quot;, &quot;OK&quot;],
+      ];
+      var invalidRequestHeaders = [
+        [&quot;Accept-Charset&quot;, &quot;KO&quot;],
+        [&quot;accept-charset&quot;, &quot;KO&quot;],
+        [&quot;ACCEPT-ENCODING&quot;, &quot;KO&quot;],
+        [&quot;Accept-Encoding&quot;, &quot;KO&quot;],
+        [&quot;Access-Control-Request-Headers&quot;, &quot;KO&quot;],
+        [&quot;Access-Control-Request-Method&quot;, &quot;KO&quot;],
+        [&quot;Connection&quot;, &quot;KO&quot;],
+        [&quot;Content-Length&quot;, &quot;KO&quot;],
+        [&quot;Cookie&quot;, &quot;KO&quot;],
+        [&quot;Cookie2&quot;, &quot;KO&quot;],
+        [&quot;Date&quot;, &quot;KO&quot;],
+        [&quot;DNT&quot;, &quot;KO&quot;],
+        [&quot;Expect&quot;, &quot;KO&quot;],
+        [&quot;Host&quot;, &quot;KO&quot;],
+        [&quot;Keep-Alive&quot;, &quot;KO&quot;],
+        [&quot;Origin&quot;, &quot;KO&quot;],
+        [&quot;Referer&quot;, &quot;KO&quot;],
+        [&quot;TE&quot;, &quot;KO&quot;],
+        [&quot;Trailer&quot;, &quot;KO&quot;],
+        [&quot;Transfer-Encoding&quot;, &quot;KO&quot;],
+        [&quot;Upgrade&quot;, &quot;KO&quot;],
+        [&quot;Via&quot;, &quot;KO&quot;],
+        [&quot;Proxy-&quot;, &quot;KO&quot;],
+        [&quot;proxy-a&quot;, &quot;KO&quot;],
+        [&quot;Sec-&quot;, &quot;KO&quot;],
+        [&quot;sec-b&quot;, &quot;KO&quot;],
+      ];
+
+      var validRequestNoCorsHeaders = [
+        [&quot;Accept&quot;, &quot;OK&quot;],
+        [&quot;Accept-Language&quot;, &quot;OK&quot;],
+        [&quot;content-language&quot;, &quot;OK&quot;],
+        [&quot;content-type&quot;, &quot;application/x-www-form-urlencoded&quot;],
+        [&quot;content-type&quot;, &quot;application/x-www-form-urlencoded;charset=UTF-8&quot;],
+        [&quot;content-type&quot;, &quot;multipart/form-data&quot;],
+        [&quot;content-type&quot;, &quot;multipart/form-data;charset=UTF-8&quot;],
+        [&quot;content-TYPE&quot;, &quot;text/plain&quot;],
+        [&quot;CONTENT-type&quot;, &quot;text/plain;charset=UTF-8&quot;],
+      ];
+      var invalidRequestNoCorsHeaders = [
+        [&quot;Content-Type&quot;, &quot;KO&quot;],
+        [&quot;Potato&quot;, &quot;KO&quot;],
+        [&quot;proxy&quot;, &quot;KO&quot;],
+        [&quot;proxya&quot;, &quot;KO&quot;],
+        [&quot;sec&quot;, &quot;KO&quot;],
+        [&quot;secb&quot;, &quot;KO&quot;],
+      ];
+
+      validRequestHeaders.forEach(function(header) {
+        test(function() {
+          var request = new Request(&quot;&quot;);
+          request.headers.set(header[0], header[1]);
+          assert_equals(request.headers.get(header[0]), header[1]);
+        }, &quot;Adding valid request header \&quot;&quot; + header[0] + &quot;: &quot; + header[1] + &quot;\&quot;&quot;);
+      });
+      invalidRequestHeaders.forEach(function(header) {
+        test(function() {
+          var request = new Request(&quot;&quot;);
+          request.headers.set(header[0], header[1]);
+          assert_equals(request.headers.get(header[0]), null);
+        }, &quot;Adding invalid request header \&quot;&quot; + header[0] + &quot;: &quot; + header[1] + &quot;\&quot;&quot;);
+      });
+
+      validRequestNoCorsHeaders.forEach(function(header) {
+        test(function() {
+          var requestNoCors = new Request(&quot;&quot;, {&quot;mode&quot;: &quot;no-cors&quot;});
+          requestNoCors.headers.set(header[0], header[1]);
+          assert_equals(requestNoCors.headers.get(header[0]), header[1]);
+        }, &quot;Adding valid no-cors request header \&quot;&quot; + header[0] + &quot;: &quot; + header[1] + &quot;\&quot;&quot;);
+      });
+      invalidRequestNoCorsHeaders.forEach(function(header) {
+        test(function() {
+          var requestNoCors = new Request(&quot;&quot;, {&quot;mode&quot;: &quot;no-cors&quot;});
+          requestNoCors.headers.set(header[0], header[1]);
+          assert_equals(requestNoCors.headers.get(header[0]), null);
+        }, &quot;Adding invalid no-cors request header \&quot;&quot; + header[0] + &quot;: &quot; + header[1] + &quot;\&quot;&quot;);
+      });
+
+      test(function() {
+        var headers = new Headers([[&quot;Cookie2&quot;, &quot;potato&quot;]]);
+        var request = new Request(&quot;&quot;, {&quot;headers&quot;: headers});
+        assert_equals(request.headers.get(&quot;Cookie2&quot;), null);
+      }, &quot;Check that request constructor is filtering headers provided as init parameter&quot;);
+
+      test(function() {
+        var headers = new Headers([[&quot;Content-Type&quot;, &quot;potato&quot;]]);
+        var request = new Request(&quot;&quot;, {&quot;headers&quot;: headers, &quot;mode&quot;: &quot;no-cors&quot;});
+        assert_equals(request.headers.get(&quot;Content-Type&quot;), null);
+      }, &quot;Check that no-cors request constructor is filtering headers provided as init parameter&quot;);
+
+      test(function() {
+        var headers = new Headers([[&quot;Content-Type&quot;, &quot;potato&quot;]]);
+        var initialRequest = new Request(&quot;&quot;, {&quot;headers&quot;: headers});
+        var request = new Request(initialRequest, {&quot;mode&quot;: &quot;no-cors&quot;});
+        assert_equals(request.headers.get(&quot;Content-Type&quot;), null);
+      }, &quot;Check that no-cors request constructor is filtering headers provided as part of request parameter&quot;);
+
+      test(function() {
+        var initialHeaders = new Headers([[&quot;Content-Type&quot;, &quot;potato&quot;]]);
+        var initialRequest = new Request(&quot;&quot;, {&quot;headers&quot; : initialHeaders});
+        var request = new Request(initialRequest);
+        assert_equals(request.headers.get(&quot;Content-Type&quot;), &quot;potato&quot;);
+      }, &quot;Request should get its content-type from the init request&quot;);
+
+      test(function() {
+        var initialHeaders = new Headers([[&quot;Content-Type&quot;, &quot;potato&quot;]]);
+        var initialRequest = new Request(&quot;&quot;, {&quot;headers&quot; : initialHeaders});
+        var headers = new Headers([]);
+        var request = new Request(initialRequest, {&quot;headers&quot; : headers});
+        assert_false(request.headers.has(&quot;Content-Type&quot;));
+      }, &quot;Request should not get its content-type from the init request if init headers are provided&quot;);
+
+      test(function() {
+        var initialHeaders = new Headers([[&quot;Content-Type-Extra&quot;, &quot;potato&quot;]]);
+        var initialRequest = new Request(&quot;&quot;, {&quot;headers&quot; : initialHeaders, &quot;body&quot; : &quot;this is my plate&quot;, &quot;method&quot; : &quot;POST&quot;});
+        var request = new Request(initialRequest);
+        assert_equals(request.headers.get(&quot;Content-Type&quot;), &quot;text/plain;charset=UTF-8&quot;);
+      }, &quot;Request should get its content-type from the body if none is provided&quot;);
+
+      test(function() {
+        var initialHeaders = new Headers([[&quot;Content-Type&quot;, &quot;potato&quot;]]);
+        var initialRequest = new Request(&quot;&quot;, {&quot;headers&quot; : initialHeaders, &quot;body&quot; : &quot;this is my plate&quot;, &quot;method&quot; : &quot;POST&quot;});
+        var request = new Request(initialRequest);
+        assert_equals(request.headers.get(&quot;Content-Type&quot;), &quot;potato&quot;);
+      }, &quot;Request should get its content-type from init headers if one is provided&quot;);
+
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestidlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+
+FAIL Request interface: existence and properties of interface object assert_equals: class string of Request expected &quot;[object Function]&quot; but got &quot;[object RequestConstructor]&quot;
+PASS Request interface object length 
+PASS Request interface object name 
+PASS Request interface: existence and properties of interface prototype object 
+PASS Request interface: existence and properties of interface prototype object's &quot;constructor&quot; property 
+FAIL Request interface: attribute method assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute url assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute headers assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute type assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute destination assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute referrer assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute referrerPolicy assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute mode assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute credentials assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute cache assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute redirect assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: attribute integrity assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+PASS Request interface: operation clone() 
+FAIL Request interface: attribute bodyUsed assert_equals: getter must be Function expected &quot;function&quot; but got &quot;undefined&quot;
+FAIL Request interface: operation arrayBuffer() assert_throws: calling operation with this = null didn't throw TypeError function &quot;function () {
+                memberHolderObject[member.n...&quot; did not throw
+FAIL Request interface: operation blob() assert_throws: calling operation with this = null didn't throw TypeError function &quot;function () {
+                memberHolderObject[member.n...&quot; did not throw
+FAIL Request interface: operation formData() assert_throws: calling operation with this = null didn't throw TypeError function &quot;function () {
+                memberHolderObject[member.n...&quot; did not throw
+FAIL Request interface: operation json() assert_throws: calling operation with this = null didn't throw TypeError function &quot;function () {
+                memberHolderObject[member.n...&quot; did not throw
+FAIL Request interface: operation text() assert_throws: calling operation with this = null didn't throw TypeError function &quot;function () {
+                memberHolderObject[member.n...&quot; did not throw
+PASS Request must be primary interface of new Request(&quot;&quot;) 
+PASS Stringification of new Request(&quot;&quot;) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;method&quot; with the proper type (0) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;url&quot; with the proper type (1) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;headers&quot; with the proper type (2) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;type&quot; with the proper type (3) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;destination&quot; with the proper type (4) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;referrer&quot; with the proper type (5) 
+FAIL Request interface: new Request(&quot;&quot;) must inherit property &quot;referrerPolicy&quot; with the proper type (6) Unrecognized type ReferrerPolicy
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;mode&quot; with the proper type (7) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;credentials&quot; with the proper type (8) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;cache&quot; with the proper type (9) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;redirect&quot; with the proper type (10) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;integrity&quot; with the proper type (11) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;clone&quot; with the proper type (12) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;bodyUsed&quot; with the proper type (13) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;arrayBuffer&quot; with the proper type (14) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;blob&quot; with the proper type (15) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;formData&quot; with the proper type (16) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;json&quot; with the proper type (17) 
+PASS Request interface: new Request(&quot;&quot;) must inherit property &quot;text&quot; with the proper type (18) 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestidlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-idl.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request idl interface&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#response&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/WebIDLParser.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/idlharness.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script id=&quot;body-idl&quot; type=&quot;text/plain&quot;&gt;
+      typedef any JSON;
+      typedef (Blob or BufferSource or FormData or URLSearchParams or USVString) BodyInit;
+
+      [NoInterfaceObject,
+      Exposed=(Window,Worker)]
+      interface Body {
+        readonly attribute boolean bodyUsed;
+        [NewObject] Promise&lt;ArrayBuffer&gt; arrayBuffer();
+        [NewObject] Promise&lt;Blob&gt; blob();
+        [NewObject] Promise&lt;FormData&gt; formData();
+        [NewObject] Promise&lt;JSON&gt; json();
+        [NewObject] Promise&lt;USVString&gt; text();
+      };
+    &lt;/script&gt;
+    &lt;script id=&quot;request-idl&quot; type=&quot;text/plain&quot;&gt;
+      typedef (Request or USVString) RequestInfo;
+
+      [Constructor(RequestInfo input, optional RequestInit init),
+      Exposed=(Window,Worker)]
+      interface Request {
+        readonly attribute ByteString method;
+        readonly attribute USVString url;
+        [SameObject] readonly attribute Headers headers;
+
+        readonly attribute RequestType type;
+        readonly attribute RequestDestination destination;
+        readonly attribute USVString referrer;
+        readonly attribute ReferrerPolicy referrerPolicy;
+        readonly attribute RequestMode mode;
+        readonly attribute RequestCredentials credentials;
+        readonly attribute RequestCache cache;
+        readonly attribute RequestRedirect redirect;
+        readonly attribute DOMString integrity;
+
+        [NewObject] Request clone();
+      };
+      Request implements Body;
+
+      dictionary RequestInit {
+        ByteString method;
+        HeadersInit headers;
+        BodyInit? body;
+        USVString referrer;
+        ReferrerPolicy referrerPolicy;
+        RequestMode mode;
+        RequestCredentials credentials;
+        RequestCache cache;
+        RequestRedirect redirect;
+        DOMString integrity;
+        any window; // can only be set to null
+      };
+
+      enum RequestType { &quot;&quot;, &quot;audio&quot;, &quot;font&quot;, &quot;image&quot;, &quot;script&quot;, &quot;style&quot;, &quot;track&quot;, &quot;video&quot; };
+      enum RequestDestination { &quot;&quot;, &quot;document&quot;, &quot;sharedworker&quot;, &quot;subresource&quot;, &quot;unknown&quot;, &quot;worker&quot; };
+      enum RequestMode { &quot;navigate&quot;, &quot;same-origin&quot;, &quot;no-cors&quot;, &quot;cors&quot; };
+      enum RequestCredentials { &quot;omit&quot;, &quot;same-origin&quot;, &quot;include&quot; };
+      enum RequestCache { &quot;default&quot;, &quot;no-store&quot;, &quot;reload&quot;, &quot;no-cache&quot;, &quot;force-cache&quot;, &quot;only-if-cached&quot; };
+      enum RequestRedirect { &quot;follow&quot;, &quot;error&quot;, &quot;manual&quot; };
+    &lt;/script&gt;
+    &lt;script&gt;
+      var idlsArray = new IdlArray();
+      var idl = document.getElementById(&quot;body-idl&quot;).innerHTML
+      idl += document.getElementById(&quot;request-idl&quot;).innerHTML
+
+      idlsArray.add_idls(idl);
+      idlsArray.add_untested_idls(&quot;interface Headers {};&quot;);
+      idlsArray.add_objects({ Request: ['new Request(&quot;&quot;)'] });
+      idlsArray.test();
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit001subexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+
+PASS Check method init value of GET and associated getter 
+PASS Check method init value of HEAD and associated getter 
+PASS Check method init value of POST and associated getter 
+PASS Check method init value of PUT and associated getter 
+PASS Check method init value of DELETE and associated getter 
+PASS Check method init value of OPTIONS and associated getter 
+PASS Check method init value of head and associated getter 
+PASS Check referrer init value of /relative/ressource and associated getter 
+PASS Check referrer init value of http://localhost:8800/relative/ressource?query=true#fragment and associated getter 
+PASS Check referrer init value of http://localhost:8800/ and associated getter 
+PASS Check referrer init value of  and associated getter 
+PASS Check referrerPolicy init value of  and associated getter 
+PASS Check referrerPolicy init value of no-referrer and associated getter 
+PASS Check referrerPolicy init value of no-referrer-when-downgrade and associated getter 
+PASS Check referrerPolicy init value of origin-only and associated getter 
+PASS Check referrerPolicy init value of origin-when-cross-origin and associated getter 
+PASS Check referrerPolicy init value of unsafe-url and associated getter 
+PASS Check mode init value of same-origin and associated getter 
+PASS Check mode init value of no-cors and associated getter 
+PASS Check mode init value of cors and associated getter 
+PASS Check credentials init value of omit and associated getter 
+PASS Check credentials init value of same-origin and associated getter 
+PASS Check credentials init value of include and associated getter 
+PASS Check cache init value of default and associated getter 
+PASS Check cache init value of no-store and associated getter 
+PASS Check cache init value of reload and associated getter 
+PASS Check cache init value of no-cache and associated getter 
+PASS Check cache init value of force-cache and associated getter 
+PASS Check redirect init value of follow and associated getter 
+PASS Check redirect init value of error and associated getter 
+PASS Check redirect init value of manual and associated getter 
+PASS Check integrity init value of  and associated getter 
+PASS Check integrity init value of AZERTYUIOP1234567890 and associated getter 
+PASS Check window init value of null and associated getter 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit001subhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request init: simple cases&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      var methods = {&quot;givenValues&quot; : [&quot;GET&quot;, &quot;HEAD&quot;, &quot;POST&quot;, &quot;PUT&quot;, &quot;DELETE&quot;, &quot;OPTIONS&quot;, &quot;head&quot;],
+                     &quot;expectedValues&quot; : [&quot;GET&quot;, &quot;HEAD&quot;, &quot;POST&quot;, &quot;PUT&quot;, &quot;DELETE&quot;, &quot;OPTIONS&quot;, &quot;HEAD&quot;]
+      };
+      var referrers = {&quot;givenValues&quot; : [&quot;/relative/ressource&quot;,
+                                        &quot;http://{{host}}:{{ports[http][0]}}/relative/ressource?query=true#fragment&quot;,
+                                        &quot;http://{{host}}:{{ports[http][0]}}/&quot;,
+                                        &quot;&quot;
+                                       ],
+                       &quot;expectedValues&quot; : [&quot;http://{{host}}:{{ports[http][0]}}/relative/ressource&quot;,
+                                           &quot;http://{{host}}:{{ports[http][0]}}/relative/ressource?query=true#fragment&quot;,
+                                           &quot;http://{{host}}:{{ports[http][0]}}/&quot;,
+                                           &quot;&quot;
+                                          ]
+      };
+      var referrerPolicies = {&quot;givenValues&quot; : [ &quot;&quot;,
+                                                &quot;no-referrer&quot;,
+                                                &quot;no-referrer-when-downgrade&quot;,
+                                                &quot;origin-only&quot;,
+                                                &quot;origin-when-cross-origin&quot;,
+                                                &quot;unsafe-url&quot;
+                                              ],
+                              &quot;expectedValues&quot; : [&quot;&quot;,
+                                                  &quot;no-referrer&quot;,
+                                                  &quot;no-referrer-when-downgrade&quot;,
+                                                  &quot;origin-only&quot;,
+                                                  &quot;origin-when-cross-origin&quot;,
+                                                  &quot;unsafe-url&quot;
+                                                  ]
+      };
+      var modes = {&quot;givenValues&quot; : [&quot;same-origin&quot;, &quot;no-cors&quot;, &quot;cors&quot;],
+                   &quot;expectedValues&quot; : [&quot;same-origin&quot;, &quot;no-cors&quot;, &quot;cors&quot;]
+      };
+      var credentials = {&quot;givenValues&quot; : [&quot;omit&quot;, &quot;same-origin&quot;, &quot;include&quot;],
+                          &quot;expectedValues&quot; : [&quot;omit&quot;, &quot;same-origin&quot;, &quot;include&quot;]
+      };
+      var caches = {&quot;givenValues&quot; : [ &quot;default&quot;, &quot;no-store&quot;, &quot;reload&quot;, &quot;no-cache&quot;, &quot;force-cache&quot;],
+                    &quot;expectedValues&quot; : [ &quot;default&quot;, &quot;no-store&quot;, &quot;reload&quot;, &quot;no-cache&quot;, &quot;force-cache&quot;]
+      };
+      var redirects = {&quot;givenValues&quot; : [&quot;follow&quot;, &quot;error&quot;, &quot;manual&quot;],
+                       &quot;expectedValues&quot; : [&quot;follow&quot;, &quot;error&quot;, &quot;manual&quot;]
+      };
+      var integrities = {&quot;givenValues&quot; : [&quot;&quot;, &quot;AZERTYUIOP1234567890&quot; ],
+                         &quot;expectedValues&quot; : [&quot;&quot;, &quot;AZERTYUIOP1234567890&quot;]
+      };
+
+      //there is no getter for window, init's window might be null
+      var windows = {&quot;givenValues&quot; : [ null ],
+                     &quot;expectedValues&quot; : [undefined]
+      };
+
+      var initValuesDict = { &quot;method&quot; : methods,
+                             &quot;referrer&quot; : referrers,
+                             &quot;referrerPolicy&quot; : referrerPolicies,
+                             &quot;mode&quot; : modes,
+                             &quot;credentials&quot; : credentials,
+                             &quot;cache&quot; : caches,
+                             &quot;redirect&quot; : redirects,
+                             &quot;integrity&quot; : integrities,
+                             &quot;window&quot; : windows
+      };
+
+      for (var attributeName in initValuesDict) {
+        var valuesToTest = initValuesDict[attributeName];
+        for (var valueIdx in valuesToTest[&quot;givenValues&quot;]) {
+          var givenValue = valuesToTest[&quot;givenValues&quot;][valueIdx];
+          var expectedValue = valuesToTest[&quot;expectedValues&quot;][valueIdx];
+          test(function() {
+            var requestInit = {};
+            requestInit[attributeName] = givenValue
+            var request = new Request(&quot;&quot;, requestInit);
+            assert_equals(request[attributeName], expectedValue,
+              &quot;Expect request's &quot; + attributeName + &quot; is &quot; + expectedValue + &quot; when initialized with &quot; + givenValue);
+          }, &quot;Check &quot; + attributeName + &quot; init value of &quot; + givenValue + &quot; and associated getter&quot;);
+        }
+      }
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit002expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS Initialize Request with headers values 
+FAIL Initialize Request's body with application/octet-binary promise_test: Unhandled rejection with value: undefined
+FAIL Initialize Request's body with multipart/form-data promise_test: Unhandled rejection with value: undefined
+PASS Initialize Request's body with text/plain;charset=UTF-8 
+FAIL Initialize Request's body with application/x-www-form-urlencoded;charset=UTF-8 promise_test: Unhandled rejection with value: &quot;URLSearchParams not supported&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit002html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request init: headers and body&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      test(function() {
+        var headerDict = {&quot;name1&quot;: &quot;value1&quot;,
+                          &quot;name2&quot;: &quot;value2&quot;,
+                          &quot;name3&quot;: &quot;value3&quot;
+                         };
+        var headers = new Headers(headerDict);
+        var request = new Request(&quot;&quot;, { &quot;headers&quot; : headers })
+        for (var name in headerDict) {
+          assert_equals(request.headers.get(name), headerDict[name],
+           &quot;request's headers has &quot; + name + &quot; : &quot; + headerDict[name]);
+        }
+      }, &quot;Initialize Request with headers values&quot;);
+
+      function checkRequestInit(body, bodyType, expectedTextBody) {
+        promise_test(function(test) {
+          var request = new Request(&quot;&quot;, {&quot;method&quot;: &quot;POST&quot;, &quot;body&quot;: body});
+          assert_throws(new TypeError(),
+                        function() { new Request(&quot;&quot;, {&quot;method&quot;: &quot;GET&quot;, &quot;body&quot;: body}); }
+          );
+          assert_throws(new TypeError(),
+                        function() { new Request(&quot;&quot;, {&quot;method&quot;: &quot;HEAD&quot;, &quot;body&quot;: body}); }
+          );
+          var reqHeaders = request.headers;
+          var mime = reqHeaders.get(&quot;Content-Type&quot;);
+          assert_true(mime &amp;&amp; mime.search(bodyType) &gt; -1, &quot;Content-Type header should be \&quot;&quot; + bodyType + &quot;\&quot;, not \&quot;&quot; + mime + &quot;\&quot;&quot;);
+          return request.text().then(function(bodyAsText) {
+            //not equals: cannot guess formData exact value
+            assert_true( bodyAsText.search(expectedTextBody) &gt; -1, &quot;Retrieve and verify request body&quot;);
+          });
+        }, &quot;Initialize Request's body with &quot; + bodyType);
+      }
+
+      var blob = new Blob([&quot;This is a blob&quot;], {type: &quot;application/octet-binary&quot;});
+      var formaData = new FormData();
+      formaData.append(&quot;name&quot;, &quot;value&quot;);
+      var usvString = &quot;This is a USVString&quot;
+
+      checkRequestInit(blob, &quot;application/octet-binary&quot;, &quot;This is a blob&quot;);
+      checkRequestInit(formaData, &quot;multipart/form-data&quot;, &quot;name=\&quot;name\&quot;\r\n\r\nvalue&quot;);
+      checkRequestInit(usvString, &quot;text/plain;charset=UTF-8&quot;, &quot;This is a USVString&quot;);
+
+      // Ensure test does not time out in case of missing URLSearchParams support.
+      if (window.URLSearchParams) {
+        var urlSearchParams = new URLSearchParams(&quot;name=value&quot;);
+        checkRequestInit(urlSearchParams, &quot;application/x-www-form-urlencoded;charset=UTF-8&quot;, &quot;name=value&quot;);
+      } else {
+        promise_test(function(test) {
+          return Promise.reject(&quot;URLSearchParams not supported&quot;);
+        }, &quot;Initialize Request's body with application/x-www-form-urlencoded;charset=UTF-8&quot;);
+      }
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit003subexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+FAIL Check request values when initialized from Request ExpectedValuesDict[&quot;headers&quot;].keys is not a function. (In 'ExpectedValuesDict[&quot;headers&quot;].keys()', 'ExpectedValuesDict[&quot;headers&quot;].keys' is undefined)
+FAIL Check request values when initialized from Request and init values ExpectedValuesDict[&quot;headers&quot;].keys is not a function. (In 'ExpectedValuesDict[&quot;headers&quot;].keys()', 'ExpectedValuesDict[&quot;headers&quot;].keys' is undefined)
+FAIL Check request values when initialized from url string assert_equals: Check url attribute expected &quot;http://url.test:1234/path/subpath?query=true&quot; but got &quot;http://url.test:1234/path/subpath?query=true#fragment&quot;
+FAIL Check request values when initialized from url and init values ExpectedValuesDict[&quot;headers&quot;].keys is not a function. (In 'ExpectedValuesDict[&quot;headers&quot;].keys()', 'ExpectedValuesDict[&quot;headers&quot;].keys' is undefined)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequestinit003subhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request: init with request or url&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://url.spec.whatwg.org/#concept-url-serializer&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script src=&quot;../resources/utils.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+      var headers = new Headers( {&quot;name&quot;:&quot;value&quot;} );
+      var emptyHeaders = new Headers();
+
+      var initValuesDict = {&quot;method&quot; : &quot;POST&quot;,
+                            &quot;referrer&quot; : &quot;http://{{host}}:{{ports[http][0]}}/&quot;,
+                            &quot;referrerPolicy&quot; : &quot;origin-only&quot;,
+                            &quot;mode&quot; : &quot;same-origin&quot;,
+                            &quot;credentials&quot; : &quot;include&quot;,
+                            &quot;cache&quot; : &quot;no-cache&quot;,
+                            &quot;redirect&quot; : &quot;error&quot;,
+                            &quot;integrity&quot; : &quot;Request's Integrity&quot;,
+                            &quot;headers&quot; : headers,
+                            &quot;body&quot; : &quot;Request's body&quot;
+      };
+
+      var expectedInitialized = {&quot;method&quot; : &quot;POST&quot;,
+                                 &quot;referrer&quot; : &quot;http://{{host}}:{{ports[http][0]}}/&quot;,
+                                 &quot;referrerPolicy&quot; : &quot;origin-only&quot;,
+                                 &quot;mode&quot; : &quot;same-origin&quot;,
+                                 &quot;credentials&quot; : &quot;include&quot;,
+                                 &quot;cache&quot; : &quot;no-cache&quot;,
+                                 &quot;redirect&quot; : &quot;error&quot;,
+                                 &quot;integrity&quot; : &quot;Request's Integrity&quot;,
+                                 &quot;headers&quot; : headers,
+                                 &quot;body&quot; : &quot;Request's body&quot;
+      };
+
+      var expectedDefault = {&quot;method&quot; : &quot;GET&quot;,
+                             &quot;url&quot; : location.ref,
+                             &quot;referrer&quot; : &quot;http://{{host}}:{{ports[http][0]}}/&quot;,
+                             &quot;referrerPolicy&quot; : &quot;&quot;,
+                             &quot;mode&quot; : &quot;cors&quot;,
+                             &quot;credentials&quot; : &quot;omit&quot;,
+                             &quot;cache&quot; : &quot;default&quot;,
+                             &quot;redirect&quot; : &quot;follow&quot;,
+                             &quot;integrity&quot; : &quot;&quot;,
+                             &quot;headers&quot; : emptyHeaders
+      };
+
+      var RequestDefault = new Request(&quot;&quot;);
+      var RequestInitialized = new Request(&quot;&quot;, initValuesDict);
+
+      test(function() {
+        var requestToCheck = new Request(RequestInitialized);
+        checkRequest(requestToCheck, expectedInitialized);
+      }, &quot;Check request values when initialized from Request&quot;);
+
+      test(function() {
+        var requestToCheck = new Request(RequestDefault, initValuesDict);
+        checkRequest(requestToCheck, expectedInitialized);
+      }, &quot;Check request values when initialized from Request and init values&quot;);
+
+      test(function() {
+        var url = &quot;http://url.test:1234/path/subpath?query=true&quot;;
+        expectedDefault[&quot;url&quot;] = url;
+        url += &quot;#fragment&quot;;
+        var requestToCheck = new Request(url);
+        checkRequest(requestToCheck, expectedDefault);
+      }, &quot;Check request values when initialized from url string&quot;);
+
+      test(function() {
+        var url = &quot;http://url.test:1234/path/subpath?query=true&quot;;
+        expectedInitialized[&quot;url&quot;] = url;
+        url += &quot;#fragment&quot;;
+        var requestToCheck = new Request(url , initValuesDict);
+        checkRequest(requestToCheck, expectedInitialized);
+      }, &quot;Check request values when initialized from url and init values&quot;);
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequeststructureexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure-expected.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+
+PASS Request has clone method 
+PASS Request has arrayBuffer method 
+PASS Request has blob method 
+PASS Request has formData method 
+PASS Request has json method 
+PASS Request has text method 
+PASS Check method attribute 
+PASS Check url attribute 
+PASS Check headers attribute 
+PASS Check type attribute 
+PASS Check destination attribute 
+PASS Check referrer attribute 
+PASS Check referrerPolicy attribute 
+PASS Check mode attribute 
+PASS Check credentials attribute 
+PASS Check cache attribute 
+PASS Check redirect attribute 
+PASS Check integrity attribute 
+PASS Check bodyUsed attribute 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapirequestrequeststructurehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure.html (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-structure.html        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,134 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Request structure&lt;/title&gt;
+    &lt;meta name=&quot;help&quot; href=&quot;https://fetch.spec.whatwg.org/#request&quot;&gt;
+    &lt;meta name=&quot;author&quot; title=&quot;Canon Research France&quot; href=&quot;https://www.crf.canon.fr&quot;&gt;
+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;script&gt;
+      var request = new Request(&quot;&quot;);
+      var methods = [&quot;clone&quot;,
+                     //Request implements Body
+                     &quot;arrayBuffer&quot;,
+                     &quot;blob&quot;,
+                     &quot;formData&quot;,
+                     &quot;json&quot;,
+                     &quot;text&quot;
+                    ];
+      var attributes = [&quot;method&quot;,
+                        &quot;url&quot;,
+                        &quot;headers&quot;,
+                        &quot;type&quot;,
+                        &quot;destination&quot;,
+                        &quot;referrer&quot;,
+                        &quot;referrerPolicy&quot;,
+                        &quot;mode&quot;,
+                        &quot;credentials&quot;,
+                        &quot;cache&quot;,
+                        &quot;redirect&quot;,
+                        &quot;integrity&quot;,
+                        //Request implements Body
+                        &quot;bodyUsed&quot;
+                       ];
+
+      function IsreadOnly(request, attributeToCheck) {
+        var defaultValue = undefined;
+        var newValue = undefined;
+        switch (attributeToCheck) {
+          case &quot;method&quot;:
+            defaultValue = &quot;GET&quot;;
+            newValue = &quot;POST&quot;;
+            break;
+
+          case &quot;url&quot;:
+            //default value is base url
+            //i.e http://web-platform.test:8000/fetch/api/request-structure.html
+            newValue = &quot;http://url.test&quot;;
+            break;
+
+          case &quot;headers&quot;:
+            request.headers = new Headers ({&quot;name&quot;:&quot;value&quot;});
+            assert_false(request.headers.has(&quot;name&quot;), &quot;Headers attribute is read only&quot;);
+            return;
+            break;
+
+          case &quot;type&quot;:
+            defaultValue = &quot;&quot;;
+            newValue = &quot;style&quot;;
+            break;
+
+          case &quot;destination&quot;:
+            defaultValue = &quot;&quot;;
+            newValue = &quot;worker&quot;;
+            break;
+
+          case &quot;referrer&quot;:
+            defaultValue = &quot;about:client&quot;;
+            newValue = &quot;http://url.test&quot;;
+            break;
+
+          case &quot;referrerPolicy&quot;:
+            defaultValue = &quot;&quot;;
+            newValue = &quot;unsafe-url&quot;;
+            break;
+
+          case &quot;mode&quot;:
+            defaultValue = &quot;cors&quot;;
+            newValue = &quot;navigate&quot;;
+            break;
+
+          case &quot;credentials&quot;:
+            defaultValue = &quot;omit&quot;;
+            newValue = &quot;cors&quot;;
+            break;
+
+          case &quot;cache&quot;:
+            defaultValue = &quot;default&quot;;
+            newValue = &quot;reload&quot;;
+            break;
+
+          case &quot;redirect&quot;:
+            defaultValue = &quot;follow&quot;;
+            newValue = &quot;manual&quot;;
+            break;
+
+          case &quot;integrity&quot;:
+            newValue = &quot;CannotWriteIntegrity&quot;;
+            break;
+
+          case &quot;bodyUsed&quot;:
+            defaultValue = false;
+            newValue = true;
+            break;
+
+          default:
+            return;
+        }
+
+        request[attributeToCheck] = newValue;
+        if (defaultValue === undefined)
+          assert_not_equals(request[attributeToCheck], newValue, &quot;Attribute &quot; + attributeToCheck + &quot; is read only&quot;);
+        else
+          assert_equals(request[attributeToCheck], defaultValue,
+           &quot;Attribute &quot; + attributeToCheck + &quot; is read only. Default value is &quot; + defaultValue);
+      }
+
+      for (var idx in methods) {
+        test(function() {
+          assert_true(methods[idx] in request, &quot;request has &quot; + methods[idx] + &quot; method&quot;);
+        }, &quot;Request has &quot; + methods[idx] + &quot; method&quot;);
+      }
+
+      for (var idx in attributes) {
+        test(function() {
+          assert_true(attributes[idx] in request, &quot;request has &quot; + attributes[idx] + &quot; attribute&quot;);
+          IsreadOnly(request, attributes[idx]);
+        }, &quot;Check &quot; + attributes[idx] + &quot; attribute&quot;);
+      }
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesauthenticationpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/authentication.py (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/authentication.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/authentication.py        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+def main(request, response):
+    user = request.auth.username
+    password = request.auth.password
+
+    if user == &quot;user&quot; and password == &quot;password&quot;:
+        return &quot;Authentication done&quot;
+
+    realm = &quot;test&quot;
+    if &quot;realm&quot; in request.GET:
+        realm = request.GET.first(&quot;realm&quot;)
+
+    return ((401, &quot;Unauthorized&quot;),
+            [(&quot;WWW-Authenticate&quot;, 'Basic realm=&quot;' + realm + '&quot;')],
+            &quot;Please login with credentials 'user' and 'password'&quot;)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcescleanstashpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/clean-stash.py (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/clean-stash.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/clean-stash.py        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+def main(request, response):
+    token = request.GET.first(&quot;token&quot;)
+    if request.server.stash.take(token) is not None:
+        return &quot;1&quot;
+    else:
+        return &quot;0&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesinspectheaderspy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/inspect-headers.py (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/inspect-headers.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/inspect-headers.py        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+def main(request, response):
+    headers = []
+    request_headers = []
+    if &quot;headers&quot; in request.GET:
+        checked_headers = request.GET.first(&quot;headers&quot;).split(&quot;|&quot;)
+        for header in checked_headers:
+          if header in request.headers:
+              headers.append((&quot;x-request-&quot; + header, request.headers.get(header, &quot;&quot;) ))
+
+    if &quot;cors&quot; in request.GET:
+        if &quot;Origin&quot; in request.headers:
+            headers.append((&quot;Access-Control-Allow-Origin&quot;, request.headers.get(&quot;Origin&quot;, &quot;&quot;)))
+        else:
+            headers.append((&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;))
+        headers.append((&quot;Access-Control-Allow-Credentials&quot;, &quot;true&quot;))
+        headers.append((&quot;Access-Control-Allow-Methods&quot;, &quot;GET, POST, HEAD&quot;))
+        exposed_headers = [&quot;x-request-&quot; + header for header in checked_headers]
+        headers.append((&quot;Access-Control-Expose-Headers&quot;, &quot;, &quot;.join(exposed_headers)))
+        headers.append((&quot;Access-Control-Allow-Headers&quot;, &quot;, &quot;.join(request.headers)))
+
+    headers.append((&quot;content-type&quot;, &quot;text/plain&quot;))
+    return headers, &quot;&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesmethodpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/method.py (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/method.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/method.py        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+def main(request, response):
+    headers = []
+    if &quot;cors&quot; in request.GET:
+        headers.append((&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;))
+        headers.append((&quot;Access-Control-Allow-Credentials&quot;, &quot;true&quot;))
+        headers.append((&quot;Access-Control-Allow-Methods&quot;, &quot;GET, POST, PUT, FOO&quot;))
+        headers.append((&quot;Access-Control-Allow-Headers&quot;, &quot;x-test, x-foo&quot;))
+        headers.append((&quot;Access-Control-Expose-Headers&quot;, &quot;x-request-method&quot;))
+
+    headers.append((&quot;x-request-method&quot;, request.method))
+    return headers, &quot;&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcespreflightpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/preflight.py (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/preflight.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/preflight.py        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+def main(request, response):
+    headers = [(&quot;Content-Type&quot;, &quot;text/plain&quot;)]
+    stashed_data = {'control_request_headers': &quot;&quot;, 'preflight': &quot;0&quot;, 'preflight_referrer': &quot;&quot;}
+
+    if &quot;origin&quot; in request.GET:
+        for origin in request.GET['origin'].split(&quot;, &quot;):
+            headers.append((&quot;Access-Control-Allow-Origin&quot;, origin))
+    else:
+        headers.append((&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;))
+
+    if request.method == &quot;OPTIONS&quot;:
+        if not &quot;Access-Control-Request-Method&quot; in request.headers:
+            response.set_error(400, &quot;No Access-Control-Request-Method header&quot;)
+            return &quot;ERROR: No access-control-request-method in preflight!&quot;
+
+        if &quot;control_request_headers&quot; in request.GET:
+            stashed_data['control_request_headers'] = request.headers.get(&quot;Access-Control-Request-Headers&quot;, &quot;&quot;)
+
+        if &quot;max_age&quot; in request.GET:
+            headers.append((&quot;Access-Control-Max-Age&quot;, request.GET['max_age']))
+
+        if &quot;allow_headers&quot; in request.GET:
+            headers.append((&quot;Access-Control-Allow-Headers&quot;, request.GET['allow_headers']))
+
+        if &quot;allow_methods&quot; in request.GET:
+            headers.append((&quot;Access-Control-Allow-Methods&quot;, request.GET['allow_methods']))
+
+        preflight_status = 200
+        if &quot;preflight_status&quot; in request.GET:
+            preflight_status = int(request.GET.first(&quot;preflight_status&quot;))
+
+        stashed_data['preflight'] = &quot;1&quot;
+        stashed_data['preflight_referrer'] = request.headers.get(&quot;Referer&quot;, &quot;&quot;)
+        request.server.stash.put(request.GET.first(&quot;token&quot;), stashed_data)
+
+        return preflight_status, headers, &quot;&quot;
+
+    token = None
+    if &quot;token&quot; in request.GET:
+        token = request.GET.first(&quot;token&quot;)
+        data = request.server.stash.take(token)
+        if data:
+            stashed_data = data
+
+    #use x-* headers for returning value to bodyless responses
+    headers.append((&quot;Access-Control-Expose-Headers&quot;, &quot;x-did-preflight, x-control-request-headers, x-referrer, x-preflight-referrer, x-origin&quot;))
+    headers.append((&quot;x-did-preflight&quot;, stashed_data['preflight']))
+    headers.append((&quot;x-control-request-headers&quot;, stashed_data['control_request_headers']))
+    headers.append((&quot;x-preflight-referrer&quot;, stashed_data['preflight_referrer']))
+    headers.append((&quot;x-referrer&quot;, request.headers.get(&quot;Referer&quot;, &quot;&quot;) ))
+    headers.append((&quot;x-origin&quot;, request.headers.get(&quot;Origin&quot;, &quot;&quot;) ))
+
+    if token:
+      request.server.stash.put(token, stashed_data)
+
+    return headers, &quot;&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesredirectpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/redirect.py (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/redirect.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/redirect.py        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+def main(request, response):
+    stashed_data = {'count': 0, 'preflight': &quot;0&quot;}
+    status = 302
+    headers = [(&quot;Content-Type&quot;, &quot;text/plain&quot;),
+               (&quot;Cache-Control&quot;, &quot;no-cache&quot;),
+               (&quot;Pragma&quot;, &quot;no-cache&quot;),
+               (&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)]
+    token = None
+
+    if &quot;token&quot; in request.GET:
+        token = request.GET.first(&quot;token&quot;)
+        data = request.server.stash.take(token)
+        if data:
+            stashed_data = data
+
+    if request.method == &quot;OPTIONS&quot;:
+        if &quot;allow_headers&quot; in request.GET:
+            headers.append((&quot;Access-Control-Allow-Headers&quot;, request.GET['allow_headers']))
+        stashed_data['preflight'] = &quot;1&quot;
+        #Preflight is not redirected: return 200
+        if not &quot;redirect_preflight&quot; in request.GET:
+            if token:
+              request.server.stash.put(request.GET.first(&quot;token&quot;), stashed_data)
+            return 200, headers, &quot;&quot;
+
+    if &quot;redirect_status&quot; in request.GET:
+        status = int(request.GET['redirect_status'])
+
+    stashed_data['count'] += 1
+
+    #keep url parameters in location
+    url_parameters = &quot;?&quot; + &quot;&amp;&quot;.join(map(lambda x: x[0][0] + &quot;=&quot; + x[1][0], request.GET.items()))
+    #make sure location changes during redirection loop
+    url_parameters += &quot;&amp;count=&quot; + str(stashed_data['count'])
+
+    if &quot;location&quot; in request.GET:
+        headers.append((&quot;Location&quot;, request.GET['location'] + url_parameters))
+
+    if token:
+        request.server.stash.put(request.GET.first(&quot;token&quot;), stashed_data)
+        if &quot;max_count&quot; in request.GET:
+            max_count =  int(request.GET['max_count'])
+            #stop redirecting and return count
+            if stashed_data['count'] &gt; max_count:
+                # -1 because the last is not a redirection
+                return str(stashed_data['count'] - 1)
+
+    return status, headers, &quot;&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcestoptxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/top.txt (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/top.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/top.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+top
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcestricklepy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/trickle.py (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/trickle.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/trickle.py        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+import time
+
+def main(request, response):
+    delay = float(request.GET.first(&quot;ms&quot;, 500)) / 1E3
+    count = int(request.GET.first(&quot;count&quot;, 50))
+    time.sleep(delay)
+    response.headers.set(&quot;Content-type&quot;, &quot;text/plain&quot;)
+    response.write_status_headers()
+    time.sleep(delay);
+    for i in xrange(count):
+        response.writer.write_content(&quot;TEST_TRICKLE\n&quot;)
+        time.sleep(delay)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresourcesutilsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+var inWorker = false;
+var RESOURCES_DIR = &quot;../resources/&quot;;
+
+try {
+  inWorker = !(self instanceof Window);
+} catch (e) {
+  inWorker = true;
+}
+
+function dirname(path) {
+    return path.replace(/\/[^\/]*$/, '/')
+}
+
+function checkRequest(request, ExpectedValuesDict) {
+  for (var attribute in ExpectedValuesDict) {
+    switch(attribute) {
+      case &quot;headers&quot;:
+          for (var key of ExpectedValuesDict[&quot;headers&quot;].keys())
+            assert_equals(request[&quot;headers&quot;].get(key), ExpectedValuesDict[&quot;headers&quot;].get(key),
+              &quot;Check headers attribute has &quot; + key + &quot;:&quot; + ExpectedValuesDict[&quot;headers&quot;].get(key));
+        break;
+
+      case &quot;body&quot;:
+        //for checking body's content, a dedicated asyncronous/promise test should be used
+        assert_true(request[&quot;headers&quot;].has(&quot;Content-Type&quot;) , &quot;Check request has body using Content-Type header&quot;)
+        break;
+
+      case &quot;method&quot;:
+      case &quot;referrer&quot;:
+      case &quot;referrerPolicy&quot;:
+      case &quot;credentials&quot;:
+      case &quot;cache&quot;:
+      case &quot;redirect&quot;:
+      case &quot;integrity&quot;:
+      case &quot;url&quot;:
+      case &quot;destination&quot;:
+        assert_equals(request[attribute], ExpectedValuesDict[attribute], &quot;Check &quot; + attribute + &quot; attribute&quot;)
+        break;
+
+      default:
+        break;
+    }
+  }
+}
+
+//check reader's text content in an asyncronous test
+function readTextStream(reader, asyncTest, expectedValue, retrievedText) {
+  if (!retrievedText)
+    retrievedText = &quot;&quot;;
+  reader.read().then(function(data) {
+    if (!data.done) {
+      var decoder = new TextDecoder();
+      retrievedText += decoder.decode(data.value);
+      readTextStream(reader, asyncTest, expectedValue, retrievedText);
+    }
+    asyncTest.step(function() {
+      assert_equals(retrievedText, expectedValue, &quot;Retrieve and verify stream&quot;);
+      asyncTest.done();
+    });
+  }).catch(function(e) {
+    asyncTest.step(function() {
+      assert_unreached(&quot;Cannot read stream &quot; + e);
+      asyncTest.done();
+    });
+  });
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomglobalconstructorsattributesdedicatedworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -64,6 +64,11 @@
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
</span><ins>+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').value is URL
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').hasOwnProperty('get') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -938,6 +938,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').value is RGBColor
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformefljsdomglobalconstructorsattributesdedicatedworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -64,6 +64,11 @@
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
</span><ins>+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').value is URL
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').hasOwnProperty('get') is false
</span><span class="cx"> PASS [Worker] Object.getOwnPropertyDescriptor(global, 'URL').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformefljsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -998,6 +998,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').value is RGBColor
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -1018,6 +1018,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').value is RGBColor
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -1023,6 +1023,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').value is RGBColor
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacmavericksjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -998,6 +998,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').value is RGBColor
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacyosemitejsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -1073,6 +1073,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'Rect').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'Rect').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'SQLException').value is SQLException
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'SQLException').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinjsdomglobalconstructorsattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -873,6 +873,11 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'ProgressEvent').configurable is true
</span><ins>+PASS Object.getOwnPropertyDescriptor(global, 'Request').value is Request
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'Request').configurable is true
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').value is RGBColor
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('get') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'RGBColor').hasOwnProperty('set') is false
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -172,7 +172,9 @@
</span><span class="cx">     Modules/battery/BatteryManager.idl
</span><span class="cx">     Modules/battery/NavigatorBattery.idl
</span><span class="cx"> 
</span><ins>+    Modules/fetch/FetchBody.idl
</ins><span class="cx">     Modules/fetch/FetchHeaders.idl
</span><ins>+    Modules/fetch/FetchRequest.idl
</ins><span class="cx"> 
</span><span class="cx">     Modules/geolocation/Coordinates.idl
</span><span class="cx">     Modules/geolocation/Geolocation.idl
</span><span class="lines">@@ -815,7 +817,9 @@
</span><span class="cx">     Modules/battery/BatteryStatus.cpp
</span><span class="cx">     Modules/battery/NavigatorBattery.cpp
</span><span class="cx"> 
</span><ins>+    Modules/fetch/FetchBody.cpp
</ins><span class="cx">     Modules/fetch/FetchHeaders.cpp
</span><ins>+    Modules/fetch/FetchRequest.cpp
</ins><span class="cx"> 
</span><span class="cx">     Modules/geolocation/Coordinates.cpp
</span><span class="cx">     Modules/geolocation/GeoNotifier.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/ChangeLog        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -1,3 +1,111 @@
</span><ins>+2016-02-01  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Fetch API] Implement Fetch API Request
+        https://bugs.webkit.org/show_bug.cgi?id=153437
+
+        Added support for Fetch Request and Body.
+        Body is sharing functionality between Request and Response.
+        Conversion between various body types are not implemented yet.
+
+        Added a FetchOptions class. Options in this class are partially redundant with ResourceLoaderOptions.
+
+        Fixing bug in Headers constructor.
+        Making error reporting in case of modifying headers compliant with the spec.
+
+        Reviewed by Darin Adler.
+
+        Tests: imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-consume.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-error.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-headers.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-idl.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
+               imported/w3c/web-platform-tests/fetch/api/request/request-structure.html
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * Modules/fetch/FetchBody.cpp: Added.
+        (WebCore::FetchBody::initBody):
+        (WebCore::FetchBody::clear):
+        (WebCore::FetchBody::processIfEmptyOrDisturbed):
+        (WebCore::FetchBody::arrayBuffer):
+        (WebCore::FetchBody::formData):
+        (WebCore::FetchBody::blob):
+        (WebCore::FetchBody::text):
+        (WebCore::FetchBody::json):
+        * Modules/fetch/FetchBody.h: Added.
+        (WebCore::FetchBody::~FetchBody):
+        (WebCore::FetchBody::isEmpty):
+        (WebCore::FetchBody::isDisturbed):
+        (WebCore::FetchBody::setDisturbed):
+        (WebCore::FetchBody::setMimeType):
+        (WebCore::FetchBody::mimeType):
+        * Modules/fetch/FetchBody.idl: Added.
+        * Modules/fetch/FetchHeaders.cpp:
+        (WebCore::canWriteHeader):
+        (WebCore::FetchHeaders::append):
+        (WebCore::FetchHeaders::remove):
+        (WebCore::FetchHeaders::set):
+        (WebCore::FetchHeaders::fill): Helper routine implementing https://fetch.spec.whatwg.org/#concept-headers-fill
+        * Modules/fetch/FetchHeaders.h: Adding header getter/setter for FetchRequest.
+        (WebCore::FetchHeaders::fastGet):
+        (WebCore::FetchHeaders::fastSet):
+        * Modules/fetch/FetchHeaders.js: Fixing bug in constructor (covered by modified headers-basc.html test).
+        (initializeFetchHeaders):
+        * Modules/fetch/FetchOptions.h: Added.
+        (WebCore::FetchOptions::FetchOptions):
+        (WebCore::FetchOptions::type):
+        (WebCore::FetchOptions::destination):
+        (WebCore::FetchOptions::mode):
+        (WebCore::FetchOptions::credentials):
+        (WebCore::FetchOptions::cache):
+        (WebCore::FetchOptions::redirect):
+        (WebCore::FetchOptions::referrerPolicy):
+        (WebCore::FetchOptions::setType):
+        (WebCore::FetchOptions::setDestination):
+        (WebCore::FetchOptions::setMode):
+        (WebCore::FetchOptions::setCredentials):
+        (WebCore::FetchOptions::setCache):
+        (WebCore::FetchOptions::setRedirect):
+        (WebCore::FetchOptions::setReferrerPolicy):
+        * Modules/fetch/FetchRequest.cpp: Added.
+        (WebCore::FetchRequest::create):
+        (WebCore::FetchRequest::FetchRequest):
+        (WebCore::FetchRequest::init):
+        (WebCore::FetchRequest::setReferrer):
+        (WebCore::FetchRequest::setReferrerPolicy):
+        (WebCore::FetchRequest::setMode):
+        (WebCore::FetchRequest::setCredentials):
+        (WebCore::FetchRequest::setCache):
+        (WebCore::FetchRequest::setRedirect):
+        (WebCore::FetchRequest::type):
+        (WebCore::FetchRequest::destination):
+        (WebCore::FetchRequest::referrerPolicy):
+        (WebCore::FetchRequest::referrer):
+        (WebCore::FetchRequest::mode):
+        (WebCore::FetchRequest::credentials):
+        (WebCore::FetchRequest::cache):
+        (WebCore::FetchRequest::redirect):
+        (WebCore::FetchRequest::setMethod):
+        (WebCore::FetchRequest::clone):
+        * Modules/fetch/FetchRequest.h: Added.
+        (WebCore::FetchRequest::method):
+        (WebCore::FetchRequest::url):
+        (WebCore::FetchRequest::integrity):
+        (WebCore::FetchRequest::headers):
+        * Modules/fetch/FetchRequest.idl: Added.
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/Dictionary.h:
+        (WebCore::Dictionary::execState):
+        * bindings/js/JSDictionary.cpp:
+        (WebCore::JSDictionary::convertValue):
+        * bindings/js/JSDictionary.h:
+        (WebCore::JSDictionary::get):
+
</ins><span class="cx"> 2016-01-31  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add resize event for HTMLMediaElement
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -154,7 +154,9 @@
</span><span class="cx"> #include &quot;JSEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSEventSource.cpp&quot;
</span><span class="cx"> #include &quot;JSEventTarget.cpp&quot;
</span><ins>+#include &quot;JSFetchBody.cpp&quot;
</ins><span class="cx"> #include &quot;JSFetchHeaders.cpp&quot;
</span><ins>+#include &quot;JSFetchRequest.cpp&quot;
</ins><span class="cx"> #include &quot;JSFile.cpp&quot;
</span><span class="cx"> #include &quot;JSFileError.cpp&quot;
</span><span class="cx"> #include &quot;JSFileException.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/DerivedSources.make        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -79,7 +79,9 @@
</span><span class="cx">     $(WebCore)/Modules/encryptedmedia/MediaKeyNeededEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/encryptedmedia/MediaKeySession.idl \
</span><span class="cx">     $(WebCore)/Modules/encryptedmedia/MediaKeys.idl \
</span><ins>+    $(WebCore)/Modules/fetch/FetchBody.idl \
</ins><span class="cx">     $(WebCore)/Modules/fetch/FetchHeaders.idl \
</span><ins>+    $(WebCore)/Modules/fetch/FetchRequest.idl \
</ins><span class="cx">     $(WebCore)/Modules/gamepad/Gamepad.idl \
</span><span class="cx">     $(WebCore)/Modules/gamepad/GamepadButton.idl \
</span><span class="cx">     $(WebCore)/Modules/gamepad/GamepadEvent.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchBodycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/fetch/FetchBody.cpp (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchBody.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchBody.cpp        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon 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 CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;FetchBody.h&quot;
+
+#if ENABLE(FETCH_API)
+
+#include &quot;Dictionary.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &quot;JSBlob.h&quot;
+#include &quot;JSDOMFormData.h&quot;
+#include &lt;runtime/JSONObject.h&gt;
+
+namespace WebCore {
+
+FetchBody::FetchBody(Ref&lt;Blob&gt;&amp;&amp; blob)
+    : m_type(Type::Blob)
+    , m_mimeType(blob-&gt;type())
+    , m_blob(WTFMove(blob))
+{
+}
+
+FetchBody::FetchBody(Ref&lt;DOMFormData&gt;&amp;&amp; formData)
+    : m_type(Type::FormData)
+    , m_mimeType(ASCIILiteral(&quot;multipart/form-data&quot;))
+    , m_formData(WTFMove(formData))
+{
+    // FIXME: Handle the boundary parameter of multipart/form-data MIME type.
+}
+
+FetchBody::FetchBody(String&amp;&amp; text)
+    : m_type(Type::Text)
+    , m_mimeType(ASCIILiteral(&quot;text/plain;charset=UTF-8&quot;))
+    , m_text(WTFMove(text))
+{
+}
+
+FetchBody FetchBody::fromJSValue(JSC::ExecState&amp; state, JSC::JSValue value)
+{
+    if (value.inherits(JSBlob::info()))
+        return FetchBody(*JSBlob::toWrapped(value));
+    if (value.inherits(JSDOMFormData::info()))
+        return FetchBody(*JSDOMFormData::toWrapped(value));
+    if (value.isString())
+        return FetchBody(value.toWTFString(&amp;state));
+    return FetchBody();
+}
+
+// FIXME: Once FetchResponse is added, check whether using a move constructor instead.
+// Ensure whether resetting m_mimeType to the empty string be not observable.
+FetchBody FetchBody::fromRequestBody(FetchBody* body)
+{
+    if (!body)
+        return FetchBody();
+
+    FetchBody result;
+    result.m_type = body-&gt;m_type;
+    result.m_mimeType = body-&gt;m_mimeType;
+
+    result.m_blob = WTFMove(body-&gt;m_blob);
+    result.m_formData = WTFMove(body-&gt;m_formData);
+    result.m_text = WTFMove(body-&gt;m_text);
+
+    body-&gt;m_isDisturbed = true;
+
+    return result;
+}
+
+template&lt;typename T&gt; inline bool FetchBody::processIfEmptyOrDisturbed(DOMPromise&lt;T, ExceptionCode&gt;&amp; promise)
+{
+    if (m_type == Type::None) {
+        promise.resolve(T());
+        return true;
+    }
+
+    if (m_isDisturbed) {
+        promise.reject(TypeError);
+        return true;
+    }
+    m_isDisturbed = true;
+    return false;
+}
+
+void FetchBody::arrayBuffer(ArrayBufferPromise&amp;&amp; promise)
+{
+    if (processIfEmptyOrDisturbed(promise))
+        return;
+
+    if (m_type == Type::Text) {
+        // FIXME: promise expects a Vector&lt;unsigned char&gt; that will be converted to an ArrayBuffer.
+        // We should try to create a Vector&lt;unsigned char&gt; or an ArrayBuffer directly from m_text.
+        CString data = m_text.utf8();
+        Vector&lt;unsigned char&gt; value(data.length());
+        memcpy(value.data(), data.data(), data.length());
+        promise.resolve(WTFMove(value));
+        return;
+    }
+    // FIXME: Support other types.
+    promise.reject(0);
+}
+
+void FetchBody::formData(FormDataPromise&amp;&amp; promise)
+{
+    if (m_type == Type::None || m_isDisturbed) {
+        promise.reject(TypeError);
+        return;
+    }
+    m_isDisturbed = true;
+
+    // FIXME: Support other types.
+    promise.reject(0);
+}
+
+void FetchBody::blob(BlobPromise&amp;&amp; promise)
+{
+    if (processIfEmptyOrDisturbed(promise))
+        return;
+
+    // FIXME: Support other types.
+    promise.reject(0);
+}
+
+void FetchBody::text(TextPromise&amp;&amp; promise)
+{
+    if (processIfEmptyOrDisturbed(promise))
+        return;
+
+    if (m_type == Type::Text) {
+        promise.resolve(m_text);
+        return;
+    }
+    // FIXME: Support other types.
+    promise.reject(0);
+}
+
+void FetchBody::json(JSC::ExecState&amp; state, JSONPromise&amp;&amp; promise)
+{
+    if (processIfEmptyOrDisturbed(promise))
+        return;
+
+    if (m_type == Type::Text) {
+        JSC::JSValue value = JSC::JSONParse(&amp;state, m_text);
+        if (!value)
+            promise.reject(SYNTAX_ERR);
+        else
+            promise.resolve(value);
+        return;
+    }
+    // FIXME: Support other types.
+    promise.reject(0);
+}
+
+}
+
+#endif // ENABLE(FETCH_API)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchBodyhfromrev195953trunkSourceWebCoreModulesfetchFetchHeadersh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/fetch/FetchBody.h (from rev 195953, trunk/Source/WebCore/Modules/fetch/FetchHeaders.h) (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchBody.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchBody.h        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon 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 CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FetchBody_h
+#define FetchBody_h
+
+#if ENABLE(FETCH_API)
+
+#include &quot;Blob.h&quot;
+#include &quot;DOMFormData.h&quot;
+#include &quot;JSDOMPromise.h&quot;
+
+namespace JSC {
+class ExecState;
+class JSValue;
+};
+
+namespace WebCore {
+
+class Dictionary;
+typedef int ExceptionCode;
+
+class FetchBody {
+public:
+    typedef DOMPromise&lt;Vector&lt;unsigned char&gt;, ExceptionCode&gt; ArrayBufferPromise;
+    void arrayBuffer(ArrayBufferPromise&amp;&amp;);
+
+    typedef DOMPromise&lt;RefPtr&lt;DOMFormData&gt;, ExceptionCode&gt; FormDataPromise;
+    void formData(FormDataPromise&amp;&amp;);
+
+    typedef DOMPromise&lt;RefPtr&lt;Blob&gt;, ExceptionCode&gt; BlobPromise;
+    void blob(BlobPromise&amp;&amp;);
+
+    typedef DOMPromise&lt;JSC::JSValue, ExceptionCode&gt; JSONPromise;
+    void json(JSC::ExecState&amp;, JSONPromise&amp;&amp;);
+
+    typedef DOMPromise&lt;String, ExceptionCode&gt; TextPromise;
+    void text(TextPromise&amp;&amp;);
+
+    bool isDisturbed() const { return m_isDisturbed; }
+    bool isEmpty() const { return m_type == Type::None; }
+
+    void setMimeType(const String&amp; mimeType) { m_mimeType = mimeType; }
+    String mimeType() const { return m_mimeType; }
+
+    static FetchBody fromJSValue(JSC::ExecState&amp;, JSC::JSValue);
+    static FetchBody fromRequestBody(FetchBody*);
+
+private:
+    template&lt;typename T&gt; bool processIfEmptyOrDisturbed(DOMPromise&lt;T, ExceptionCode&gt;&amp;);
+
+    enum class Type { None, Text, Blob, FormData };
+
+    FetchBody(Ref&lt;Blob&gt;&amp;&amp;);
+    FetchBody(Ref&lt;DOMFormData&gt;&amp;&amp;);
+    FetchBody(String&amp;&amp;);
+    FetchBody() { }
+
+    Type m_type = Type::None;
+    String m_mimeType;
+    bool m_isDisturbed = false;
+
+    // FIXME: Add support for BufferSource and URLSearchParams.
+    RefPtr&lt;Blob&gt; m_blob;
+    RefPtr&lt;DOMFormData&gt; m_formData;
+    String m_text;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FETCH_API)
+
+#endif // FetchBody_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchBodyidlfromrev195953trunkSourceWebCoreModulesfetchFetchHeadersh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/fetch/FetchBody.idl (from rev 195953, trunk/Source/WebCore/Modules/fetch/FetchHeaders.h) (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchBody.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchBody.idl        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon 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 CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND 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.
+ */
+
+[
+    Conditional=FETCH_API,
+    GlobalContext=DOMWindow&amp;WorkerGlobalScope,
+    InterfaceName=Body,
+    NoInterfaceObject
+]
+interface FetchBody {
+    [ImplementedAs=isDisturbed] readonly attribute boolean bodyUsed;
+    [NewObject] Promise arrayBuffer();
+    [NewObject] Promise blob();
+    [NewObject] Promise formData();
+    [CallWith=ScriptState, NewObject] Promise json();
+    [NewObject] Promise text();
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchHeaderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -101,12 +101,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool canWriteHeader(const String&amp; name, const String&amp; value, FetchHeaders::Guard guard)
</del><ins>+static bool canWriteHeader(const String&amp; name, const String&amp; value, FetchHeaders::Guard guard, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!isValidHTTPToken(name) || !isValidHTTPHeaderValue(value))
</del><ins>+    if (!isValidHTTPToken(name) || !isValidHTTPHeaderValue(value)) {
+        ec = TypeError;
</ins><span class="cx">         return false;
</span><del>-    if (guard == FetchHeaders::Guard::Immutable)
</del><ins>+    }
+    if (guard == FetchHeaders::Guard::Immutable) {
+        ec = TypeError;
</ins><span class="cx">         return false;
</span><ins>+    }
</ins><span class="cx">     if (guard == FetchHeaders::Guard::Request &amp;&amp; isForbiddenHeaderName(name))
</span><span class="cx">         return false;
</span><span class="cx">     if (guard == FetchHeaders::Guard::RequestNoCors &amp;&amp; !isSimpleHeader(name, value))
</span><span class="lines">@@ -119,19 +123,15 @@
</span><span class="cx"> void FetchHeaders::append(const String&amp; name, const String&amp; value, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     String normalizedValue = stripLeadingAndTrailingHTTPSpaces(value);
</span><del>-    if (!canWriteHeader(name, normalizedValue, m_guard)) {
-        ec = TypeError;
</del><ins>+    if (!canWriteHeader(name, normalizedValue, m_guard, ec))
</ins><span class="cx">         return;
</span><del>-    }
</del><span class="cx">     m_headers.add(name, normalizedValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FetchHeaders::remove(const String&amp; name, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!canWriteHeader(name, String(), m_guard)) {
-        ec = TypeError;
</del><ins>+    if (!canWriteHeader(name, String(), m_guard, ec))
</ins><span class="cx">         return;
</span><del>-    }
</del><span class="cx">     m_headers.remove(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -156,13 +156,29 @@
</span><span class="cx"> void FetchHeaders::set(const String&amp; name, const String&amp; value, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     String normalizedValue = stripLeadingAndTrailingHTTPSpaces(value);
</span><del>-    if (!canWriteHeader(name, normalizedValue, m_guard)) {
-        ec = TypeError;
</del><ins>+    if (!canWriteHeader(name, normalizedValue, m_guard, ec))
</ins><span class="cx">         return;
</span><del>-    }
</del><span class="cx">     m_headers.set(name, normalizedValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FetchHeaders::fill(const FetchHeaders* headers)
+{
+    if (!headers)
+        return;
+
+    ASSERT(m_guard != Guard::Immutable);
+
+    ExceptionCode ec;
+    for (auto&amp; header : headers-&gt;m_headers) {
+        if (canWriteHeader(header.key, header.value, m_guard, ec)) {
+            if (header.keyAsHTTPHeaderName)
+                m_headers.add(header.keyAsHTTPHeaderName.value(), header.value);
+            else
+                m_headers.add(header.key, header.value);
+        }
+    }
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(FETCH_API)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchHeadersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.h (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.h        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.h        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;FetchHeaders&gt; create(Guard guard = Guard::None) { return adoptRef(*new FetchHeaders(guard)); }
</span><ins>+    static Ref&lt;FetchHeaders&gt; create(const FetchHeaders&amp; headers) { return adoptRef(*new FetchHeaders(headers.m_guard, headers.m_headers)); }
</ins><span class="cx"> 
</span><span class="cx">     void append(const String&amp; name, const String&amp; value, ExceptionCode&amp;);
</span><span class="cx">     void remove(const String&amp;, ExceptionCode&amp;);
</span><span class="lines">@@ -56,9 +57,14 @@
</span><span class="cx">     void set(const String&amp; name, const String&amp; value, ExceptionCode&amp;);
</span><span class="cx"> 
</span><span class="cx">     void initializeWith(const FetchHeaders*, ExceptionCode&amp;);
</span><ins>+    void fill(const FetchHeaders*);
</ins><span class="cx"> 
</span><ins>+    String fastGet(HTTPHeaderName name) const { return m_headers.get(name); }
+    void fastSet(HTTPHeaderName name, const String&amp; value) { m_headers.set(name, value); }
+
</ins><span class="cx"> private:
</span><span class="cx">     FetchHeaders(Guard guard) : m_guard(guard) { }
</span><ins>+    FetchHeaders(Guard guard, const HTTPHeaderMap&amp; headers) : m_guard(guard), m_headers(headers) { }
</ins><span class="cx"> 
</span><span class="cx">     Guard m_guard;
</span><span class="cx">     HTTPHeaderMap m_headers;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchHeadersjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.js (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.js        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.js        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">                 throw new @TypeError(&quot;headersInit sequence items should contain two values&quot;);
</span><span class="cx">             this.@appendFromJS(header[0], header[1]);
</span><span class="cx">         }
</span><ins>+        return this;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @Object.@getOwnPropertyNames(headersInit).forEach((name) =&gt; {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchOptionsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/fetch/FetchOptions.h (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchOptions.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchOptions.h        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon 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 CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FetchOptions_h
+#define FetchOptions_h
+
+#if ENABLE(FETCH_API)
+
+namespace WebCore {
+
+class FetchOptions {
+public:
+    enum class Type {
+        Default,
+        Audio,
+        Font,
+        Image,
+        Script,
+        Style,
+        Track,
+        Video
+    };
+    enum class Destination {
+        Default,
+        Document,
+        SharedWorker,
+        Subresource,
+        Unknown,
+        Worker
+    };
+    enum class Mode {
+        NoCors,
+        Navigate,
+        SameOrigin,
+        Cors
+    };
+    enum class Credentials {
+        Omit,
+        SameOrigin,
+        Include
+    };
+    enum class Cache {
+        Default,
+        NoStore,
+        Reload,
+        NoCache,
+        ForceCache,
+    };
+    enum class Redirect {
+        Follow,
+        Error,
+        Manual
+    };
+    enum class ReferrerPolicy {
+        Empty,
+        NoReferrer,
+        NoReferrerWhenDowngrade,
+        OriginOnly,
+        OriginWhenCrossOrigin,
+        UnsafeURL
+    };
+
+    FetchOptions() { }
+    FetchOptions(Type, Destination, Mode, Credentials, Cache, Redirect, ReferrerPolicy);
+
+    Type type() const { return m_type; }
+    Destination destination() const { return m_destination; }
+    Mode mode() const { return m_mode; }
+    Credentials credentials() const { return m_credentials; }
+    Cache cache() const { return m_cache; }
+    Redirect redirect() const { return m_redirect; }
+    ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
+
+    void setType(Type type) { m_type = type; }
+    void setDestination(Destination destination) { m_destination = destination; }
+    void setMode(Mode mode) { m_mode = mode; }
+    void setCredentials(Credentials credentials) { m_credentials = credentials; }
+    void setCache(Cache cache) { m_cache = cache; }
+    void setRedirect(Redirect redirect) { m_redirect = redirect; }
+    void setReferrerPolicy(ReferrerPolicy referrerPolicy) { m_referrerPolicy = referrerPolicy; }
+
+private:
+    Type m_type = Type::Default;
+    Destination m_destination = Destination::Default;
+    Mode m_mode = Mode::NoCors;
+    Credentials m_credentials = Credentials::Omit;
+    Cache m_cache = Cache::Default;
+    Redirect m_redirect = Redirect:: Follow;
+    ReferrerPolicy m_referrerPolicy = ReferrerPolicy::Empty;
+};
+
+inline FetchOptions::FetchOptions(Type type, Destination destination, Mode mode, Credentials credentials, Cache cache, Redirect redirect, ReferrerPolicy referrerPolicy)
+    : m_type(type)
+    , m_destination(destination)
+    , m_mode(mode)
+    , m_credentials(credentials)
+    , m_cache(cache)
+    , m_redirect(redirect)
+    , m_referrerPolicy(referrerPolicy)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FETCH_API)
+
+#endif // FetchOptions_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequestcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,451 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon 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 CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;FetchRequest.h&quot;
+
+#if ENABLE(FETCH_API)
+
+#include &quot;Dictionary.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &quot;HTTPParsers.h&quot;
+#include &quot;ScriptExecutionContext.h&quot;
+#include &quot;SecurityOrigin.h&quot;
+
+namespace WebCore {
+
+static bool setReferrerPolicy(FetchOptions&amp; options, const String&amp; referrerPolicy)
+{
+    if (referrerPolicy.isEmpty())
+        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::Empty);
+    else if (referrerPolicy == &quot;no-referrer&quot;)
+        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::NoReferrer);
+    else if (referrerPolicy == &quot;no-referrer-when-downgrade&quot;)
+        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::NoReferrerWhenDowngrade);
+    else if (referrerPolicy == &quot;origin-only&quot;)
+        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::OriginOnly);
+    else if (referrerPolicy == &quot;origin-when-cross-origin&quot;)
+        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::OriginWhenCrossOrigin);
+    else if (referrerPolicy == &quot;unsafe-url&quot;)
+        options.setReferrerPolicy(FetchOptions::ReferrerPolicy::UnsafeURL);
+    else
+        return false;
+    return true;
+}
+
+static bool setMode(FetchOptions&amp; options, const String&amp; mode)
+{
+    if (mode == &quot;navigate&quot;)
+        options.setMode(FetchOptions::Mode::Navigate);
+    else if (mode == &quot;same-origin&quot;)
+        options.setMode(FetchOptions::Mode::SameOrigin);
+    else if (mode == &quot;no-cors&quot;)
+        options.setMode(FetchOptions::Mode::NoCors);
+    else if (mode == &quot;cors&quot;)
+        options.setMode(FetchOptions::Mode::Cors);
+    else
+        return false;
+    return true;
+}
+
+static bool setCredentials(FetchOptions&amp; options, const String&amp; credentials)
+{
+    if (credentials == &quot;omit&quot;)
+        options.setCredentials(FetchOptions::Credentials::Omit);
+    else if (credentials == &quot;same-origin&quot;)
+        options.setCredentials(FetchOptions::Credentials::SameOrigin);
+    else if (credentials == &quot;include&quot;)
+        options.setCredentials(FetchOptions::Credentials::Include);
+    else
+        return false;
+    return true;
+}
+
+static bool setCache(FetchOptions&amp; options, const String&amp; cache)
+{
+    if (cache == &quot;default&quot;)
+        options.setCache(FetchOptions::Cache::Default);
+    else if (cache == &quot;no-store&quot;)
+        options.setCache(FetchOptions::Cache::NoStore);
+    else if (cache == &quot;reload&quot;)
+        options.setCache(FetchOptions::Cache::Reload);
+    else if (cache == &quot;no-cache&quot;)
+        options.setCache(FetchOptions::Cache::NoCache);
+    else if (cache == &quot;force-cache&quot;)
+        options.setCache(FetchOptions::Cache::ForceCache);
+    else
+        return false;
+    return true;
+}
+
+static bool setRedirect(FetchOptions&amp; options, const String&amp; redirect)
+{
+    if (redirect == &quot;follow&quot;)
+        options.setRedirect(FetchOptions::Redirect::Follow);
+    else if (redirect == &quot;error&quot;)
+        options.setRedirect(FetchOptions::Redirect::Error);
+    else if (redirect == &quot;manual&quot;)
+        options.setRedirect(FetchOptions::Redirect::Manual);
+    else
+        return false;
+    return true;
+}
+
+static bool setMethod(ResourceRequest&amp; request, const String&amp; initMethod)
+{
+    if (!isValidHTTPToken(initMethod))
+        return false;
+
+    String method = initMethod.convertToASCIIUppercase();
+    if (method == &quot;CONNECT&quot; || method == &quot;TRACE&quot; || method == &quot;TRACK&quot;)
+        return false;
+
+    request.setHTTPMethod((method == &quot;DELETE&quot; || method == &quot;GET&quot; || method == &quot;HEAD&quot; || method == &quot;OPTIONS&quot; || method == &quot;POST&quot; || method == &quot;PUT&quot;) ? method : initMethod);
+
+    return true;
+}
+
+static bool setReferrer(FetchRequest::InternalRequest&amp; request, ScriptExecutionContext&amp; context, const Dictionary&amp; init)
+{
+    String referrer;
+    if (!init.get(&quot;referrer&quot;, referrer))
+        return true;
+    if (referrer.isEmpty()) {
+        request.referrer = ASCIILiteral(&quot;no-referrer&quot;);
+        return true;
+    }
+    // FIXME: Tighten the URL parsing algorithm according https://url.spec.whatwg.org/#concept-url-parser.
+    URL referrerURL = context.completeURL(referrer);
+    if (!referrerURL.isValid())
+        return false;
+
+    if (referrerURL.protocolIs(&quot;about&quot;) &amp;&amp; referrerURL.path() == &quot;client&quot;) {
+        request.referrer = ASCIILiteral(&quot;client&quot;);
+        return true;
+    }
+
+    if (!(context.securityOrigin() &amp;&amp; context.securityOrigin()-&gt;canRequest(referrerURL)))
+        return false;
+
+    request.referrer = referrerURL.string();
+    return true;
+}
+
+static bool buildOptions(FetchRequest::InternalRequest&amp; request, ScriptExecutionContext&amp; context, const Dictionary&amp; init)
+{
+    JSC::JSValue window;
+    if (init.get(&quot;window&quot;, window)) {
+        if (!window.isNull())
+            return false;
+    }
+
+    if (!setReferrer(request, context, init))
+        return false;
+
+    String value;
+    if (init.get(&quot;referrerPolicy&quot;, value) &amp;&amp; !setReferrerPolicy(request.options, value))
+        return false;
+
+    if (init.get(&quot;mode&quot;, value) &amp;&amp; !setMode(request.options, value))
+        return false;
+    if (request.options.mode() == FetchOptions::Mode::Navigate)
+        return false;
+
+    if (init.get(&quot;credentials&quot;, value) &amp;&amp; !setCredentials(request.options, value))
+        return false;
+
+    if (init.get(&quot;cache&quot;, value) &amp;&amp; !setCache(request.options, value))
+        return false;
+
+    if (init.get(&quot;redirect&quot;, value) &amp;&amp; !setRedirect(request.options, value))
+        return false;
+
+    init.get(&quot;integrity&quot;, request.integrity);
+
+    if (init.get(&quot;method&quot;, value) &amp;&amp; !setMethod(request.request, value))
+        return false;
+
+    return true;
+}
+
+static RefPtr&lt;FetchHeaders&gt; buildHeaders(const Dictionary&amp; init, const FetchRequest::InternalRequest&amp; request, const FetchHeaders* inputHeaders = nullptr)
+{
+    FetchHeaders::Guard guard = FetchHeaders::Guard::Request;
+    if (request.options.mode() == FetchOptions::Mode::NoCors) {
+        const String&amp; method = request.request.httpMethod();
+        if (method != &quot;GET&quot; &amp;&amp; method != &quot;POST&quot; &amp;&amp; method != &quot;HEAD&quot;)
+            return nullptr;
+        if (!request.integrity.isEmpty())
+            return nullptr;
+        guard = FetchHeaders::Guard::RequestNoCors;
+    }
+
+    RefPtr&lt;FetchHeaders&gt; initialHeaders;
+    RefPtr&lt;FetchHeaders&gt; headers = FetchHeaders::create(guard);
+    headers-&gt;fill(init.get(&quot;headers&quot;, initialHeaders) ? initialHeaders.get() : inputHeaders);
+
+    return headers;
+}
+
+static FetchBody buildBody(const Dictionary&amp; init, FetchHeaders&amp; headers, FetchBody* inputBody = nullptr)
+{
+    JSC::JSValue value;
+    bool hasInitBody = init.get(&quot;body&quot;, value);
+    FetchBody body = hasInitBody ? FetchBody::fromJSValue(*init.execState(), value) : FetchBody::fromRequestBody(inputBody);
+
+    String type = headers.fastGet(HTTPHeaderName::ContentType);
+    if (hasInitBody &amp;&amp; type.isEmpty() &amp;&amp; !body.mimeType().isEmpty()) {
+        type = body.mimeType();
+        headers.fastSet(HTTPHeaderName::ContentType, type);
+    }
+    body.setMimeType(type);
+    return body;
+}
+
+static bool validateBodyAndMethod(const FetchBody&amp; body, const FetchRequest::InternalRequest&amp; internalRequest)
+{
+    if (body.isEmpty())
+        return true;
+    return internalRequest.request.httpMethod() != &quot;GET&quot; &amp;&amp; internalRequest.request.httpMethod() != &quot;HEAD&quot;;
+}
+
+RefPtr&lt;FetchRequest&gt; FetchRequest::create(ScriptExecutionContext&amp; context, const String&amp; url, const Dictionary&amp; init, ExceptionCode&amp; ec)
+{
+    // FIXME: Tighten the URL parsing algorithm according https://url.spec.whatwg.org/#concept-url-parser.
+    URL requestURL = context.completeURL(url);
+    if (!requestURL.isValid() || !requestURL.user().isEmpty() || !requestURL.pass().isEmpty()) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    FetchRequest::InternalRequest internalRequest;
+    internalRequest.options.setMode(FetchOptions::Mode::Cors);
+    internalRequest.options.setCredentials(FetchOptions::Credentials::Omit);
+    internalRequest.referrer = ASCIILiteral(&quot;client&quot;);
+    internalRequest.request.setURL(requestURL);
+
+    if (!buildOptions(internalRequest, context, init)) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    RefPtr&lt;FetchHeaders&gt; headers = buildHeaders(init, internalRequest);
+    if (!headers) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    FetchBody body = buildBody(init, *headers);
+    if (!validateBodyAndMethod(body, internalRequest)) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    return adoptRef(*new FetchRequest(WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest)));
+}
+
+RefPtr&lt;FetchRequest&gt; FetchRequest::create(ScriptExecutionContext&amp; context, FetchRequest* input, const Dictionary&amp; init, ExceptionCode&amp; ec)
+{
+    ASSERT(input);
+
+    if (input-&gt;isDisturbed()) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    FetchRequest::InternalRequest internalRequest(input-&gt;m_internalRequest);
+
+    if (!buildOptions(internalRequest, context, init)) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    RefPtr&lt;FetchHeaders&gt; headers = buildHeaders(init, internalRequest, input-&gt;m_headers.ptr());
+    if (!headers) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    FetchBody body = buildBody(init, *headers, &amp;input-&gt;m_body);
+    if (!validateBodyAndMethod(body, internalRequest)) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    return adoptRef(*new FetchRequest(WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest)));
+}
+
+String FetchRequest::type() const
+{
+    switch (m_internalRequest.options.type()) {
+    case FetchOptions::Type::Default:
+        return String();
+    case FetchOptions::Type::Audio :
+        return ASCIILiteral(&quot;audio&quot;);
+    case FetchOptions::Type::Font :
+        return ASCIILiteral(&quot;font&quot;);
+    case FetchOptions::Type::Image :
+        return ASCIILiteral(&quot;image&quot;);
+    case FetchOptions::Type::Script :
+        return ASCIILiteral(&quot;script&quot;);
+    case FetchOptions::Type::Style :
+        return ASCIILiteral(&quot;style&quot;);
+    case FetchOptions::Type::Track :
+        return ASCIILiteral(&quot;track&quot;);
+    case FetchOptions::Type::Video :
+        return ASCIILiteral(&quot;video&quot;);
+    };
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+String FetchRequest::destination() const
+{
+    switch (m_internalRequest.options.destination()) {
+    case FetchOptions::Destination::Default:
+        return String();
+    case FetchOptions::Destination::Document:
+        return ASCIILiteral(&quot;document&quot;);
+    case FetchOptions::Destination::SharedWorker:
+        return ASCIILiteral(&quot;sharedworker&quot;);
+    case FetchOptions::Destination::Subresource:
+        return ASCIILiteral(&quot;subresource&quot;);
+    case FetchOptions::Destination::Unknown:
+        return ASCIILiteral(&quot;unknown&quot;);
+    case FetchOptions::Destination::Worker:
+        return ASCIILiteral(&quot;worker&quot;);
+    }
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+String FetchRequest::referrerPolicy() const
+{
+    switch (m_internalRequest.options.referrerPolicy()) {
+    case FetchOptions::ReferrerPolicy::Empty:
+        return String();
+    case FetchOptions::ReferrerPolicy::NoReferrer:
+        return ASCIILiteral(&quot;no-referrer&quot;);
+    case FetchOptions::ReferrerPolicy::NoReferrerWhenDowngrade:
+        return ASCIILiteral(&quot;no-referrer-when-downgrade&quot;);
+    case FetchOptions::ReferrerPolicy::OriginOnly:
+        return ASCIILiteral(&quot;origin-only&quot;);
+    case FetchOptions::ReferrerPolicy::OriginWhenCrossOrigin:
+        return ASCIILiteral(&quot;origin-when-cross-origin&quot;);
+    case FetchOptions::ReferrerPolicy::UnsafeURL:
+        return ASCIILiteral(&quot;unsafe-url&quot;);
+    }
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+String FetchRequest::referrer() const
+{
+    if (m_internalRequest.referrer == &quot;no-referrer&quot;)
+        return String();
+    if (m_internalRequest.referrer == &quot;client&quot;)
+        return ASCIILiteral(&quot;about:client&quot;);
+    return m_internalRequest.referrer;
+}
+
+String FetchRequest::mode() const
+{
+    switch (m_internalRequest.options.mode()) {
+    case FetchOptions::Mode::Navigate:
+        return ASCIILiteral(&quot;navigate&quot;);
+    case FetchOptions::Mode::SameOrigin:
+        return ASCIILiteral(&quot;same-origin&quot;);
+    case FetchOptions::Mode::NoCors:
+        return ASCIILiteral(&quot;no-cors&quot;);
+    case FetchOptions::Mode::Cors:
+        return ASCIILiteral(&quot;cors&quot;);
+    };
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+String FetchRequest::credentials() const
+{
+    switch (m_internalRequest.options.credentials()) {
+    case FetchOptions::Credentials::Omit:
+        return ASCIILiteral(&quot;omit&quot;);
+    case FetchOptions::Credentials::SameOrigin:
+        return ASCIILiteral(&quot;same-origin&quot;);
+    case FetchOptions::Credentials::Include:
+        return ASCIILiteral(&quot;include&quot;);
+    };
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+String FetchRequest::cache() const
+{
+    switch (m_internalRequest.options.cache()) {
+    case FetchOptions::Cache::Default:
+        return ASCIILiteral(&quot;default&quot;);
+    case FetchOptions::Cache::NoStore:
+        return ASCIILiteral(&quot;no-store&quot;);
+    case FetchOptions::Cache::Reload:
+        return ASCIILiteral(&quot;reload&quot;);
+    case FetchOptions::Cache::NoCache:
+        return ASCIILiteral(&quot;no-cache&quot;);
+    case FetchOptions::Cache::ForceCache:
+        return ASCIILiteral(&quot;force-cache&quot;);
+    }
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+String FetchRequest::redirect() const
+{
+    switch (m_internalRequest.options.redirect()) {
+    case FetchOptions::Redirect::Follow:
+        return ASCIILiteral(&quot;follow&quot;);
+    case FetchOptions::Redirect::Error:
+        return ASCIILiteral(&quot;error&quot;);
+    case FetchOptions::Redirect::Manual:
+        return ASCIILiteral(&quot;manual&quot;);
+    }
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+RefPtr&lt;FetchRequest&gt; FetchRequest::clone(ExceptionCode&amp; ec)
+{
+    if (isDisturbed()) {
+        ec = TypeError;
+        return nullptr;
+    }
+
+    // FIXME: Validate body teeing.
+    return adoptRef(*new FetchRequest(FetchBody(m_body), FetchHeaders::create(m_headers.get()), FetchRequest::InternalRequest(m_internalRequest)));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FETCH_API)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequesth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/fetch/FetchRequest.h (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.h        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon 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 CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FetchRequest_h
+#define FetchRequest_h
+
+#if ENABLE(FETCH_API)
+
+#include &quot;FetchBody.h&quot;
+#include &quot;FetchHeaders.h&quot;
+#include &quot;FetchOptions.h&quot;
+#include &quot;ResourceRequest.h&quot;
+
+namespace WebCore {
+
+class Dictionary;
+class ScriptExecutionContext;
+
+typedef int ExceptionCode;
+
+class FetchRequest : public RefCounted&lt;FetchRequest&gt; {
+public:
+    static RefPtr&lt;FetchRequest&gt; create(ScriptExecutionContext&amp;, FetchRequest*, const Dictionary&amp;, ExceptionCode&amp;);
+    static RefPtr&lt;FetchRequest&gt; create(ScriptExecutionContext&amp;, const String&amp;, const Dictionary&amp;, ExceptionCode&amp;);
+
+    // Request API
+    const String&amp; method() const { return m_internalRequest.request.httpMethod(); }
+    const String&amp; url() const { return m_internalRequest.request.url().string(); }
+    FetchHeaders&amp; headers() { return m_headers.get(); }
+
+    String type() const;
+    String destination() const;
+    String referrer() const;
+    String referrerPolicy() const;
+    String mode() const;
+    String credentials() const;
+    String cache() const;
+    String redirect() const;
+    const String&amp; integrity() const { return m_internalRequest.integrity; }
+
+    RefPtr&lt;FetchRequest&gt; clone(ExceptionCode&amp;);
+
+    // Body API
+    bool isDisturbed() const { return m_body.isDisturbed(); }
+    void arrayBuffer(FetchBody::ArrayBufferPromise&amp;&amp; promise) { m_body.arrayBuffer(WTFMove(promise)); }
+    void formData(FetchBody::FormDataPromise&amp;&amp; promise) { m_body.formData(WTFMove(promise)); }
+    void blob(FetchBody::BlobPromise&amp;&amp; promise) { m_body.blob(WTFMove(promise)); }
+    void json(JSC::ExecState&amp; state, FetchBody::JSONPromise&amp;&amp; promise) { m_body.json(state, WTFMove(promise)); }
+    void text(FetchBody::TextPromise&amp;&amp; promise) { m_body.text(WTFMove(promise)); }
+
+    struct InternalRequest {
+        ResourceRequest request;
+        FetchOptions options;
+        String referrer;
+        String integrity;
+    };
+
+    FetchBody&amp; body() { return m_body; }
+
+private:
+    FetchRequest(FetchBody&amp;&amp;, Ref&lt;FetchHeaders&gt;&amp;&amp;, InternalRequest&amp;&amp;);
+
+    FetchBody m_body;
+    Ref&lt;FetchHeaders&gt; m_headers;
+    InternalRequest m_internalRequest;
+};
+
+inline FetchRequest::FetchRequest(FetchBody&amp;&amp; body, Ref&lt;FetchHeaders&gt;&amp;&amp; headers, InternalRequest&amp;&amp; internalRequest)
+    : m_body(WTFMove(body))
+    , m_headers(WTFMove(headers))
+    , m_internalRequest(WTFMove(internalRequest))
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FETCH_API)
+
+#endif // FetchRequest_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchRequestidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/fetch/FetchRequest.idl (0 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchRequest.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.idl        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2016 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon 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 CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND 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.
+ */
+
+enum RequestType { &quot;&quot;, &quot;audio&quot;, &quot;font&quot;, &quot;image&quot;, &quot;script&quot;, &quot;style&quot;, &quot;track&quot;, &quot;video&quot; };
+enum RequestDestination { &quot;&quot;, &quot;document&quot;, &quot;sharedworker&quot;, &quot;subresource&quot;, &quot;unknown&quot;, &quot;worker&quot; };
+enum RequestMode { &quot;navigate&quot;, &quot;same-origin&quot;, &quot;no-cors&quot;, &quot;cors&quot; };
+enum RequestCredentials { &quot;omit&quot;, &quot;same-origin&quot;, &quot;include&quot; };
+enum RequestCache { &quot;default&quot;, &quot;no-store&quot;, &quot;reload&quot;, &quot;no-cache&quot;, &quot;force-cache&quot; };
+enum RequestRedirect { &quot;follow&quot;, &quot;error&quot;, &quot;manual&quot; };
+enum ReferrerPolicy { &quot;&quot;, &quot;no-referrer&quot;,  &quot;no-referrer-when-downgrade&quot;, &quot;origin-only&quot;, &quot;origin-when-cross-origin&quot;, &quot;unsafe-url&quot; };
+
+[
+    Conditional=FETCH_API,
+    ConstructorCallWith=ScriptExecutionContext,
+    ConstructorRaisesException,
+    Constructor(FetchRequest input, [Default=Undefined] optional Dictionary init),
+    Constructor(DOMString input, [Default=Undefined]  optional Dictionary init),
+    GlobalContext=DOMWindow&amp;WorkerGlobalScope,
+    ImplementationLacksVTable,
+    InterfaceName=Request
+]
+interface FetchRequest {
+    readonly attribute DOMString method;
+    readonly attribute DOMString url;
+    readonly attribute FetchHeaders headers;
+
+    readonly attribute RequestType type;
+    readonly attribute RequestDestination destination;
+    readonly attribute DOMString referrer;
+    readonly attribute ReferrerPolicy referrerPolicy;
+    readonly attribute RequestMode mode;
+    readonly attribute RequestCredentials credentials;
+    readonly attribute RequestCache cache;
+    readonly attribute RequestRedirect redirect;
+    readonly attribute DOMString integrity;
+
+    [RaisesException, NewObject] FetchRequest clone();
+};
+FetchRequest implements FetchBody;
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -1547,7 +1547,9 @@
</span><span class="cx">                 41F066E50F64BCF600A07EAC /* ScriptGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F066E30F64BCF600A07EAC /* ScriptGlobalObject.cpp */; };
</span><span class="cx">                 41F1D21F0EF35C2A00DA8753 /* ScriptCachedFrameData.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F1D21D0EF35C2A00DA8753 /* ScriptCachedFrameData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 41F1D2200EF35C2A00DA8753 /* ScriptCachedFrameData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */; };
</span><ins>+                41F54F8B1C50C50300338488 /* FetchBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F54F7D1C50C4F600338488 /* FetchBody.cpp */; };
</ins><span class="cx">                 41F54F8D1C50C50800338488 /* FetchHeaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F54F821C50C4F600338488 /* FetchHeaders.cpp */; };
</span><ins>+                41F54F8E1C50C50C00338488 /* FetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F54F871C50C4F600338488 /* FetchRequest.cpp */; };
</ins><span class="cx">                 41F584C7104652CB009CAA64 /* JSMessagePortCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F584C6104652CB009CAA64 /* JSMessagePortCustom.h */; };
</span><span class="cx">                 41FA303E1316C29C00C0BFC5 /* RenderMediaControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41FA303C1316C29C00C0BFC5 /* RenderMediaControls.cpp */; };
</span><span class="cx">                 41FA303F1316C29C00C0BFC5 /* RenderMediaControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FA303D1316C29C00C0BFC5 /* RenderMediaControls.h */; };
</span><span class="lines">@@ -2793,6 +2795,8 @@
</span><span class="cx">                 7E474E1E12494DC900235364 /* SQLiteDatabaseTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7E474E1F12494DC900235364 /* SQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7E474E2012494DC900235364 /* SQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */; };
</span><ins>+                7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */; };
+                7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */; };
</ins><span class="cx">                 7E4DE10D198B10B60051CB02 /* DiskCacheMonitorCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */; };
</span><span class="cx">                 7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */; };
</span><span class="cx">                 7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */; };
</span><span class="lines">@@ -2829,6 +2833,8 @@
</span><span class="cx">                 7EE6847012D26E3800E79415 /* ResourceResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EE6845D12D26E3800E79415 /* ResourceResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7EE6847112D26E3800E79415 /* ResourceResponseCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EE6845E12D26E3800E79415 /* ResourceResponseCFNet.cpp */; };
</span><span class="cx">                 7EE6847512D26E7000E79415 /* ResourceLoaderCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EE6847412D26E7000E79415 /* ResourceLoaderCFNet.cpp */; };
</span><ins>+                7F4C96DC1AD4483500365A50 /* JSFetchBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F4C96D81AD4483500365A50 /* JSFetchBody.cpp */; };
+                7F4C96DD1AD4483500365A50 /* JSFetchBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 7F4C96D91AD4483500365A50 /* JSFetchBody.h */; };
</ins><span class="cx">                 8102C5881325BB1100DDE67A /* StringCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8102C5871325BB1100DDE67A /* StringCallback.cpp */; };
</span><span class="cx">                 81AC5999131636E60009A7E0 /* DataTransferItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 81AC5997131636E60009A7E0 /* DataTransferItem.h */; };
</span><span class="cx">                 81AC599A131636E60009A7E0 /* DataTransferItemList.h in Headers */ = {isa = PBXBuildFile; fileRef = 81AC5998131636E60009A7E0 /* DataTransferItemList.h */; };
</span><span class="lines">@@ -8959,10 +8965,17 @@
</span><span class="cx">                 41F066E30F64BCF600A07EAC /* ScriptGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGlobalObject.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41F1D21D0EF35C2A00DA8753 /* ScriptCachedFrameData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptCachedFrameData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptCachedFrameData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                41F54F7D1C50C4F600338488 /* FetchBody.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchBody.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                41F54F7E1C50C4F600338488 /* FetchBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchBody.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                41F54F7F1C50C4F600338488 /* FetchBody.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchBody.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 41F54F821C50C4F600338488 /* FetchHeaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchHeaders.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41F54F831C50C4F600338488 /* FetchHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchHeaders.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41F54F841C50C4F600338488 /* FetchHeaders.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchHeaders.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41F54F851C50C4F600338488 /* FetchHeaders.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = FetchHeaders.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                41F54F861C50C4F600338488 /* FetchOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchOptions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                41F54F871C50C4F600338488 /* FetchRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchRequest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                41F54F881C50C4F600338488 /* FetchRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                41F54F891C50C4F600338488 /* FetchRequest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchRequest.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 41F584C6104652CB009CAA64 /* JSMessagePortCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessagePortCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41FA303C1316C29C00C0BFC5 /* RenderMediaControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMediaControls.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41FA303D1316C29C00C0BFC5 /* RenderMediaControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMediaControls.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10358,6 +10371,8 @@
</span><span class="cx">                 7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTrackerClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteDatabaseTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchRequest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7E4C96D91AD4483500365A50 /* JSFetchRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskCacheMonitorCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OESElementIndexUint.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OESElementIndexUint.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10396,6 +10411,8 @@
</span><span class="cx">                 7EE6845D12D26E3800E79415 /* ResourceResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceResponse.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7EE6845E12D26E3800E79415 /* ResourceResponseCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceResponseCFNet.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7EE6847412D26E7000E79415 /* ResourceLoaderCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoaderCFNet.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7F4C96D81AD4483500365A50 /* JSFetchBody.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchBody.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7F4C96D91AD4483500365A50 /* JSFetchBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchBody.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 8102C5871325BB1100DDE67A /* StringCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 81AC5997131636E60009A7E0 /* DataTransferItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataTransferItem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 81AC5998131636E60009A7E0 /* DataTransferItemList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataTransferItemList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16619,10 +16636,17 @@
</span><span class="cx">                 41F54F7C1C50C4F600338488 /* fetch */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                41F54F7D1C50C4F600338488 /* FetchBody.cpp */,
+                                41F54F7E1C50C4F600338488 /* FetchBody.h */,
+                                41F54F7F1C50C4F600338488 /* FetchBody.idl */,
</ins><span class="cx">                                 41F54F821C50C4F600338488 /* FetchHeaders.cpp */,
</span><span class="cx">                                 41F54F831C50C4F600338488 /* FetchHeaders.h */,
</span><span class="cx">                                 41F54F841C50C4F600338488 /* FetchHeaders.idl */,
</span><span class="cx">                                 41F54F851C50C4F600338488 /* FetchHeaders.js */,
</span><ins>+                                41F54F861C50C4F600338488 /* FetchOptions.h */,
+                                41F54F871C50C4F600338488 /* FetchRequest.cpp */,
+                                41F54F881C50C4F600338488 /* FetchRequest.h */,
+                                41F54F891C50C4F600338488 /* FetchRequest.idl */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = fetch;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -16630,6 +16654,10 @@
</span><span class="cx">                 42A023FA1A39F13A00F722CF /* FetchAPI */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                7F4C96D81AD4483500365A50 /* JSFetchBody.cpp */,
+                                7F4C96D91AD4483500365A50 /* JSFetchBody.h */,
+                                7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */,
+                                7E4C96D91AD4483500365A50 /* JSFetchRequest.h */,
</ins><span class="cx">                                 7D4C96D81AD4483500365A50 /* JSFetchHeaders.cpp */,
</span><span class="cx">                                 7D4C96D91AD4483500365A50 /* JSFetchHeaders.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -26483,6 +26511,8 @@
</span><span class="cx">                                 077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */,
</span><span class="cx">                                 B658FFA21522EF3A00DD5595 /* JSRadioNodeList.h in Headers */,
</span><span class="cx">                                 65DF320209D1CC60000BE325 /* JSRange.h in Headers */,
</span><ins>+                                7F4C96DD1AD4483500365A50 /* JSFetchBody.h in Headers */,
+                                7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */,
</ins><span class="cx">                                 7D4C96DD1AD4483500365A50 /* JSFetchHeaders.h in Headers */,
</span><span class="cx">                                 7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */,
</span><span class="cx">                                 6C4C96DF1AD4483500365A50 /* JSReadableStreamController.h in Headers */,
</span><span class="lines">@@ -29664,6 +29694,7 @@
</span><span class="cx">                                 C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */,
</span><span class="cx">                                 516D7D711BB5F0BD00AF7C77 /* IDBConnectionToClient.cpp in Sources */,
</span><span class="cx">                                 5198F7C01BC4856700E2CC5F /* IDBConnectionToServer.cpp in Sources */,
</span><ins>+                                41F54F8B1C50C50300338488 /* FetchBody.cpp in Sources */,
</ins><span class="cx">                                 5185FC7A1BB4C4E80012898F /* IDBCursor.cpp in Sources */,
</span><span class="cx">                                 51F41A691BA73B5B002E053B /* IDBCursorBackend.cpp in Sources */,
</span><span class="cx">                                 51F41A6B1BA73B5B002E053B /* IDBCursorBackendOperations.cpp in Sources */,
</span><span class="lines">@@ -30073,6 +30104,7 @@
</span><span class="cx">                                 A80E7E9E0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp in Sources */,
</span><span class="cx">                                 83E359A31BB1031D002CEB98 /* JSHTMLTimeElement.cpp in Sources */,
</span><span class="cx">                                 A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */,
</span><ins>+                                41F54F8E1C50C50C00338488 /* FetchRequest.cpp in Sources */,
</ins><span class="cx">                                 070756D314239A4E00414161 /* JSHTMLTrackElement.cpp in Sources */,
</span><span class="cx">                                 1A85B2100A1B258700D8C87C /* JSHTMLUListElement.cpp in Sources */,
</span><span class="cx">                                 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */,
</span><span class="lines">@@ -30195,7 +30227,9 @@
</span><span class="cx">                                 077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */,
</span><span class="cx">                                 B658FFA11522EF3A00DD5595 /* JSRadioNodeList.cpp in Sources */,
</span><span class="cx">                                 65DF320109D1CC60000BE325 /* JSRange.cpp in Sources */,
</span><ins>+                                7F4C96DC1AD4483500365A50 /* JSFetchBody.cpp in Sources */,
</ins><span class="cx">                                 7D4C96DC1AD4483500365A50 /* JSFetchHeaders.cpp in Sources */,
</span><ins>+                                7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */,
</ins><span class="cx">                                 7C4C96DC1AD4483500365A50 /* JSReadableStream.cpp in Sources */,
</span><span class="cx">                                 6C4C96DE1AD4483500365A50 /* JSReadableStreamController.cpp in Sources */,
</span><span class="cx">                                 4129DF851BB5B80700322A16 /* JSReadableStreamPrivateConstructors.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsDictionaryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/Dictionary.h (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/Dictionary.h        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/bindings/js/Dictionary.h        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -66,6 +66,8 @@
</span><span class="cx">     bool getOwnPropertyNames(Vector&lt;String&gt;&amp;) const;
</span><span class="cx">     bool getWithUndefinedOrNullCheck(const char* propertyName, String&amp; value) const;
</span><span class="cx"> 
</span><ins>+    JSC::ExecState* execState() const { return m_dictionary.execState(); }
+
</ins><span class="cx"> private:
</span><span class="cx">     template &lt;typename T&gt;
</span><span class="cx">     JSC::JSObject* asJSObject(T*) const;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -47,6 +47,10 @@
</span><span class="cx"> #include &quot;JSMediaKeyError.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(FETCH_API)
+#include &quot;JSFetchHeaders.h&quot;
+#endif
+
</ins><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> #include &quot;JSMediaStream.h&quot;
</span><span class="cx"> #include &quot;JSMediaStreamTrack.h&quot;
</span><span class="lines">@@ -227,6 +231,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(FETCH_API)
+void JSDictionary::convertValue(JSC::ExecState*, JSC::JSValue value, RefPtr&lt;FetchHeaders&gt;&amp; result)
+{
+    result = JSFetchHeaders::toWrapped(value);
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> void JSDictionary::convertValue(JSC::ExecState*, JSC::JSValue value, RefPtr&lt;MediaStream&gt;&amp; result)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionaryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (195953 => 195954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-02-01 06:34:07 UTC (rev 195953)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-02-01 11:05:39 UTC (rev 195954)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> class DOMWindow;
</span><span class="cx"> class EventTarget;
</span><span class="cx"> class Gamepad;
</span><ins>+class FetchHeaders;
</ins><span class="cx"> class MediaKeyError;
</span><span class="cx"> class MediaStream;
</span><span class="cx"> class MediaStreamTrack;
</span><span class="lines">@@ -126,6 +127,9 @@
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA)
</span><span class="cx">     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;MediaKeyError&gt;&amp; result);
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(FETCH_API)
+    static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;FetchHeaders&gt;&amp; result);
+#endif
</ins><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;MediaStream&gt;&amp; result);
</span><span class="cx">     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr&lt;MediaStreamTrack&gt;&amp; result);
</span><span class="lines">@@ -163,6 +167,12 @@
</span><span class="cx">     return tryGetPropertyAndResult(propertyName, &amp;finalResult, IdentitySetter&lt;Result&gt;::identitySetter) == PropertyFound;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template &lt;&gt;
+inline bool JSDictionary::get(const char* propertyName, JSC::JSValue&amp; finalResult) const
+{
+    return tryGetProperty(propertyName, finalResult) == PropertyFound;
+}
+
</ins><span class="cx"> template &lt;typename T, typename Result&gt;
</span><span class="cx"> JSDictionary::GetPropertyResult JSDictionary::tryGetPropertyAndResult(const char* propertyName, T* context, void (*setter)(T* context, const Result&amp;)) const
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>