<!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>[205110] 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/205110">205110</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-08-28 23:49:42 -0700 (Sun, 28 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Fetch API] Ensure response cloning works when data is loading
https://bugs.webkit.org/show_bug.cgi?id=161137

Patch by Youenn Fablet &lt;youenn@apple.com&gt; on 2016-08-28
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/response/response-clone-expected.txt:
* web-platform-tests/fetch/api/response/response-clone.html: New tests highly inspired from Chromium similar tests.

Source/WebCore:

Test: http/tests/fetch/clone-after-load-is-finished.html and updated wpt test

FetchBody is only able to clone data when requested by Response in case the data is already there.
If data is loaded from FetchLoader, each received chunk should be given to each cloned response.
The simplest approach is to create a ReadableStream body for the cloned Response and use it for the teeing.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed): Postpone stream closing if there is still data to enqueue in the FetchBody.
* Modules/fetch/FetchResponse.h:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/FetchResponse.js:
(clone): If response is being loaded, create a ReadableStream body so that loaded data cloning is handled by ReadableStream tee.
* Modules/streams/ReadableStreamInternals.js: Restrict firstReadCallback to the case of a readable ReadableStream.
If stream is errored or closed, FetchResponse will already have disposed of its source.
(readFromReadableStreamDefaultReader):
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

* http/tests/fetch/clone-response-body-expected.txt: Added.
* http/tests/fetch/clone-response-body.html: Added.</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="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresponseresponsecloneexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresponseresponseclonehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchResponsecpp">trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchResponseh">trunk/Source/WebCore/Modules/fetch/FetchResponse.h</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchResponseidl">trunk/Source/WebCore/Modules/fetch/FetchResponse.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchResponsejs">trunk/Source/WebCore/Modules/fetch/FetchResponse.js</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamInternalsjs">trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWebCoreBuiltinNamesh">trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsfetchcloneresponsebodyexpectedtxt">trunk/LayoutTests/http/tests/fetch/clone-response-body-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsfetchcloneresponsebodyhtml">trunk/LayoutTests/http/tests/fetch/clone-response-body.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/LayoutTests/ChangeLog        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-08-28  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        [Fetch API] Ensure response cloning works when data is loading
+        https://bugs.webkit.org/show_bug.cgi?id=161137
+
+        Reviewed by Darin Adler.
+
+        * http/tests/fetch/clone-response-body-expected.txt: Added.
+        * http/tests/fetch/clone-response-body.html: Added.
+
</ins><span class="cx"> 2016-08-28  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, update iOS simulator WK1 flaky tests.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsfetchcloneresponsebodyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/fetch/clone-response-body-expected.txt (0 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/fetch/clone-response-body-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/fetch/clone-response-body-expected.txt        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Ensure that cloning works when load is finished 
+PASS Ensure that cloning works when load is ongoing 
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsfetchcloneresponsebodyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/fetch/clone-response-body.html (0 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/fetch/clone-response-body.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/fetch/clone-response-body.html        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;title&gt;Response clone after load is finished&lt;/title&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;
+promise_test(function(t) {
+    var clone;
+    return fetch('/resources/testharnessreport.js').then(function(res) {
+        var resolveFunction;
+        var promise = new Promise((resolve) =&gt; {
+            resolveFunction = resolve;
+        });
+        setTimeout(() =&gt; {
+            // Load should be finished by now
+            clone = res.clone();
+            var string;
+            return res.text().then((value) =&gt; {
+                 string = value;
+                 return clone.text();
+            }).then((value) =&gt; {
+                assert_equals(value, string);
+                resolveFunction();
+            });
+        }, 1000);
+        return promise;
+    });
+}, 'Ensure that cloning works when load is finished');
+
+promise_test(function(t) {
+    var clone;
+    return fetch('/download-json-with-delay.php?iteration=2&amp;delay=1').then(function(res) {
+        // All data should not be enqueued yet.
+        clone = res.clone();
+        var string;
+        return res.text().then((value) =&gt; {
+            string = value;
+            return clone.text();
+        }).then((value) =&gt; {
+            assert_equals(value, string);
+        });
+    });
+}, 'Ensure that cloning works when load is ongoing');
+
+    &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-08-28  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        [Fetch API] Ensure response cloning works when data is loading
+        https://bugs.webkit.org/show_bug.cgi?id=161137
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/fetch/api/response/response-clone-expected.txt:
+        * web-platform-tests/fetch/api/response/response-clone.html: New tests highly inspired from Chromium similar tests.
+
</ins><span class="cx"> 2016-08-27  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Fetch API] Opaque responses should not have any body
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresponseresponsecloneexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone-expected.txt        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -4,4 +4,6 @@
</span><span class="cx"> PASS Check orginal response's body after cloning 
</span><span class="cx"> PASS Check cloned response's body 
</span><span class="cx"> PASS Cannot clone a disturbed response 
</span><ins>+PASS Cloned responses should provide the same data 
+PASS Cancelling stream should not affect cloned one 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiresponseresponseclonehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.html        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -61,6 +61,38 @@
</span><span class="cx">               &quot;Expect TypeError exception&quot;);
</span><span class="cx">         });
</span><span class="cx">       }, &quot;Cannot clone a disturbed response&quot;);
</span><ins>+
+    promise_test(function(t) {
+        var clone;
+        var result;
+        var response;
+        return fetch('../resources/trickle.py?count=2&amp;delay=100').then(function(res) {
+            clone = res.clone();
+            response = res;
+            return clone.arrayBuffer();
+        }).then(function(r) {
+            assert_equals(r.byteLength, 26);
+            result = r;
+            return response.arrayBuffer();
+        }).then(function(r) {
+            assert_array_equals(r, result, &quot;cloned responses should provide the same data&quot;);
+        });
+     }, 'Cloned responses should provide the same data');
+
+    promise_test(function(t) {
+        var clone;
+        return fetch('../resources/trickle.py?count=2&amp;delay=100').then(function(res) {
+            clone = res.clone();
+            res.body.cancel();
+            assert_true(res.bodyUsed);
+            assert_false(clone.bodyUsed);
+            return clone.arrayBuffer();
+        }).then(function(r) {
+            assert_equals(r.byteLength, 26);
+            assert_true(clone.bodyUsed);
+        });
+    }, 'Cancelling stream should not affect cloned one');
+
</ins><span class="cx">     &lt;/script&gt;
</span><span class="cx">   &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/Source/WebCore/ChangeLog        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-08-28  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        [Fetch API] Ensure response cloning works when data is loading
+        https://bugs.webkit.org/show_bug.cgi?id=161137
+
+        Reviewed by Darin Adler.
+
+        Test: http/tests/fetch/clone-after-load-is-finished.html and updated wpt test
+
+        FetchBody is only able to clone data when requested by Response in case the data is already there.
+        If data is loaded from FetchLoader, each received chunk should be given to each cloned response.
+        The simplest approach is to create a ReadableStream body for the cloned Response and use it for the teeing.
+
+        * Modules/fetch/FetchResponse.cpp:
+        (WebCore::FetchResponse::BodyLoader::didSucceed): Postpone stream closing if there is still data to enqueue in the FetchBody.
+        * Modules/fetch/FetchResponse.h:
+        * Modules/fetch/FetchResponse.idl:
+        * Modules/fetch/FetchResponse.js:
+        (clone): If response is being loaded, create a ReadableStream body so that loaded data cloning is handled by ReadableStream tee.
+        * Modules/streams/ReadableStreamInternals.js: Restrict firstReadCallback to the case of a readable ReadableStream.
+        If stream is errored or closed, FetchResponse will already have disposed of its source.
+        (readFromReadableStreamDefaultReader):
+        * bindings/js/WebCoreBuiltinNames.h:
+
</ins><span class="cx"> 2016-08-28  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         document.title setter can't throw.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchResponsecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -127,13 +127,16 @@
</span><span class="cx"> void FetchResponse::BodyLoader::didSucceed()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_response.hasPendingActivity());
</span><ins>+    m_response.m_body.loadingSucceeded();
+
</ins><span class="cx"> #if ENABLE(STREAMS_API)
</span><del>-    if (m_response.m_readableStreamSource) {
</del><ins>+    if (m_response.m_readableStreamSource &amp;&amp; m_response.m_body.type() != FetchBody::Type::Loaded) {
+        // We only close the stream if FetchBody already enqueued data.
+        // Otherwise, FetchBody will close the stream when enqueuing data.
</ins><span class="cx">         m_response.m_readableStreamSource-&gt;close();
</span><span class="cx">         m_response.m_readableStreamSource = nullptr;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-    m_response.m_body.loadingSucceeded();
</del><span class="cx"> 
</span><span class="cx">     if (m_loader-&gt;isStarted())
</span><span class="cx">         m_response.m_bodyLoader = Nullopt;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchResponseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.h (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchResponse.h        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.h        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx">     void consumeBodyAsStream();
</span><span class="cx">     void cancel();
</span><span class="cx"> #endif
</span><ins>+    bool isLoading() const { return body().type() == FetchBody::Type::Loading; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     FetchResponse(ScriptExecutionContext&amp;, FetchBody&amp;&amp;, Ref&lt;FetchHeaders&gt;&amp;&amp;, ResourceResponse&amp;&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchResponseidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.idl (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchResponse.idl        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.idl        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx">     [Conditional=STREAMS_API, PrivateIdentifier] Promise finishConsumingStream();
</span><span class="cx"> 
</span><span class="cx">     [PrivateIdentifier] Promise consume(unsigned short type);
</span><ins>+    [PrivateIdentifier] boolean isLoading();
</ins><span class="cx">     [PrivateIdentifier, RaisesException] void setStatus(unsigned short status, DOMString statusText);
</span><span class="cx">     [CallWith=ScriptState, PrivateIdentifier] void initializeWith(any body);
</span><span class="cx">     [PrivateIdentifier, NewObject] ReadableStreamSource createReadableStreamSource();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchResponsejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.js (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchResponse.js        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.js        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -87,6 +87,14 @@
</span><span class="cx">         throw new @TypeError(&quot;Cannot clone a disturbed Response&quot;);
</span><span class="cx"> 
</span><span class="cx">     var cloned = @Response.prototype.@cloneForJS.@call(this);
</span><ins>+
+    // Let's create @body if response body is loading to provide data to both clones.
+    if (@Response.prototype.@isLoading.@call(this) &amp;&amp; !this.@body) {
+        var source = @Response.prototype.@createReadableStreamSource.@call(this);
+        @assert(!!source);
+        this.@body = new @ReadableStream(source);
+    }
+
</ins><span class="cx">     if (this.@body) {
</span><span class="cx">         var teedReadableStreams = @teeReadableStream(this.@body, false);
</span><span class="cx">         this.@body = teedReadableStreams[0];
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamInternalsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">     @assert(!!stream);
</span><span class="cx"> 
</span><span class="cx">     // Native sources may want to start enqueueing at the time of the first read request.
</span><del>-    if (!stream.@disturbed &amp;&amp; stream.@underlyingSource.@firstReadCallback)
</del><ins>+    if (!stream.@disturbed &amp;&amp; stream.@state === @streamReadable &amp;&amp; stream.@underlyingSource.@firstReadCallback)
</ins><span class="cx">         stream.@underlyingSource.@firstReadCallback();
</span><span class="cx"> 
</span><span class="cx">     stream.@disturbed = true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWebCoreBuiltinNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (205109 => 205110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h        2016-08-29 05:57:16 UTC (rev 205109)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h        2016-08-29 06:49:42 UTC (rev 205110)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     macro(getTracks) \
</span><span class="cx">     macro(initializeWith) \
</span><span class="cx">     macro(isDisturbed) \
</span><ins>+    macro(isLoading) \
</ins><span class="cx">     macro(localStreams) \
</span><span class="cx">     macro(makeThisTypeError) \
</span><span class="cx">     macro(makeGetterTypeError) \
</span></span></pre>
</div>
</div>

</body>
</html>