<!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>[185641] 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/185641">185641</a></dd>
<dt>Author</dt> <dd>calvaris@igalia.com</dd>
<dt>Date</dt> <dd>2015-06-16 23:00:27 -0700 (Tue, 16 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Streams API] Implement ReadableStream locked property
https://bugs.webkit.org/show_bug.cgi?id=146023

Reviewed by Darin Adler.

Source/WebCore:

Covered by rebased tests.

* Modules/streams/ReadableStream.h:
(WebCore::ReadableStream::locked): Renamed isLocked by locked.
* Modules/streams/ReadableStream.idl: Adding locked.
* bindings/js/JSReadableStreamCustom.cpp:
(WebCore::JSReadableStream::getReader): Using isLocked.
* bindings/js/JSReadableStreamReaderCustom.cpp:
(WebCore::constructJSReadableStreamReader): Using isLocked.

LayoutTests:

Rebasing tests.

* streams/reference-implementation/readable-stream-expected.txt:
* streams/reference-implementation/readable-stream-templated-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstreamsreferenceimplementationreadablestreamexpectedtxt">trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstreamsreferenceimplementationreadablestreamtemplatedexpectedtxt">trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamh">trunk/Source/WebCore/Modules/streams/ReadableStream.h</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamidl">trunk/Source/WebCore/Modules/streams/ReadableStream.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSReadableStreamCustomcpp">trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSReadableStreamReaderCustomcpp">trunk/Source/WebCore/bindings/js/JSReadableStreamReaderCustom.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/LayoutTests/ChangeLog        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-06-16  Youenn Fablet &lt;youenn.fablet@crf.canon.fr&gt; and Xabier Rodriguez Calvar  &lt;calvaris@igalia.com&gt;
+
+        [Streams API] Implement ReadableStream locked property
+        https://bugs.webkit.org/show_bug.cgi?id=146023
+
+        Reviewed by Darin Adler.
+
+        Rebasing tests.
+
+        * streams/reference-implementation/readable-stream-expected.txt:
+        * streams/reference-implementation/readable-stream-templated-expected.txt:
+
</ins><span class="cx"> 2015-06-10  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         FTL should eliminate array bounds checks in loops
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsreferenceimplementationreadablestreamexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> 
</span><span class="cx"> PASS ReadableStream can be constructed with no errors 
</span><span class="cx"> PASS ReadableStream can't be constructed with garbage 
</span><del>-FAIL ReadableStream instances should have the correct list of properties assert_array_equals: should have all the correct methods lengths differ, expected 7 got 5
</del><ins>+FAIL ReadableStream instances should have the correct list of properties assert_array_equals: should have all the correct methods lengths differ, expected 7 got 6
</ins><span class="cx"> PASS ReadableStream constructor should throw for non-function start arguments 
</span><span class="cx"> PASS ReadableStream constructor can get initial garbage as cancel argument 
</span><span class="cx"> PASS ReadableStream constructor can get initial garbage as pull argument 
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsreferenceimplementationreadablestreamtemplatedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -1,9 +1,9 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Running templatedRSEmpty with ReadableStream (empty) 
</span><del>-FAIL instances have the correct methods and properties assert_equals: has a boolean locked getter expected &quot;boolean&quot; but got &quot;undefined&quot;
</del><ins>+FAIL instances have the correct methods and properties assert_equals: has a tee method expected &quot;function&quot; but got &quot;undefined&quot;
</ins><span class="cx"> PASS Running templatedRSEmptyReader with ReadableStream (empty) reader 
</span><span class="cx"> PASS instances have the correct methods and properties 
</span><del>-FAIL locked should be true assert_true: locked getter should return true expected true got undefined
</del><ins>+PASS locked should be true 
</ins><span class="cx"> PASS read() should never settle 
</span><span class="cx"> PASS two read()s should both never settle 
</span><span class="cx"> PASS read() should return distinct promises each time 
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> FAIL canceling via the stream should fail cancel is not implemented
</span><span class="cx"> PASS Running templatedRSClosed with ReadableStream (closed via call in start) 
</span><span class="cx"> FAIL cancel() should return a distinct fulfilled promise each time cancel is not implemented
</span><del>-FAIL locked should be false assert_false: locked getter should return false expected false got undefined
</del><ins>+PASS locked should be false 
</ins><span class="cx"> PASS getReader() should be OK 
</span><span class="cx"> PASS should be able to acquire multiple readers, since they are all auto-released 
</span><span class="cx"> PASS Running templatedRSClosedReader with ReadableStream (closed via call in start) reader 
</span><span class="lines">@@ -34,14 +34,14 @@
</span><span class="cx"> FAIL cancel() should return a distinct fulfilled promise each time cancel is not implemented
</span><span class="cx"> PASS Running templatedRSErrored with ReadableStream (errored via call in start) 
</span><span class="cx"> PASS getReader() should return a reader that acts errored 
</span><del>-FAIL locked should be false assert_false: locked getter should return false expected false got undefined
</del><ins>+PASS locked should be false 
</ins><span class="cx"> PASS Running templatedRSErroredSyncOnly with ReadableStream (errored via call in start) 
</span><span class="cx"> FAIL cancel() should return a distinct rejected promise each time cancel is not implemented
</span><span class="cx"> FAIL reader cancel() should return a distinct rejected promise each time cancel is not implemented
</span><span class="cx"> PASS should be able to acquire multiple readers, since they are all auto-released 
</span><span class="cx"> PASS Running templatedRSErrored with ReadableStream (errored via returning a rejected promise in start) 
</span><span class="cx"> PASS getReader() should return a reader that acts errored 
</span><del>-FAIL locked should be false assert_false: locked getter should return false expected false got undefined
</del><ins>+PASS locked should be false 
</ins><span class="cx"> PASS Running templatedRSErroredReader with ReadableStream (errored via returning a rejected promise in start) reader 
</span><span class="cx"> PASS closed should reject with the error 
</span><span class="cx"> PASS read() should reject with the error 
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> PASS Running templatedRSTwoChunksClosedReader with ReadableStream (two chunks enqueued, then closed) reader 
</span><span class="cx"> PASS third read(), without waiting, should give { value: undefined, done: true } 
</span><span class="cx"> PASS third read, with waiting, should give { value: undefined, done: true } 
</span><del>-FAIL draining the stream via read() should cause the reader closed promise to fulfill and locked to be false assert_false: stream should no longer be locked expected false got undefined
</del><ins>+PASS draining the stream via read() should cause the reader closed promise to fulfill and locked to be false 
</ins><span class="cx"> FAIL releasing the lock after the stream is closed should do nothing releaseLock is not implemented
</span><span class="cx"> FAIL releasing the lock should cause read() to act as if the stream is closed releaseLock is not implemented
</span><span class="cx"> FAIL reader's closed property always returns the same promise releaseLock is not implemented
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/ChangeLog        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-06-16  Youenn Fablet &lt;youenn.fablet@crf.canon.fr&gt; and Xabier Rodriguez Calvar  &lt;calvaris@igalia.com&gt;
+
+        [Streams API] Implement ReadableStream locked property
+        https://bugs.webkit.org/show_bug.cgi?id=146023
+
+        Reviewed by Darin Adler.
+
+        Covered by rebased tests.
+
+        * Modules/streams/ReadableStream.h:
+        (WebCore::ReadableStream::locked): Renamed isLocked by locked.
+        * Modules/streams/ReadableStream.idl: Adding locked.
+        * bindings/js/JSReadableStreamCustom.cpp:
+        (WebCore::JSReadableStream::getReader): Using isLocked.
+        * bindings/js/JSReadableStreamReaderCustom.cpp:
+        (WebCore::constructJSReadableStreamReader): Using isLocked.
+
</ins><span class="cx"> 2015-06-16  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r184899): [Cocoa] font-variant: small-caps is not honored with web fonts
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.h (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStream.h        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.h        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -64,8 +64,9 @@
</span><span class="cx"> 
</span><span class="cx">     ReadableStreamReader&amp; getReader();
</span><span class="cx">     const ReadableStreamReader* reader() const { return m_reader.get(); }
</span><del>-    bool isLocked() const { return !!m_reader; }
</del><span class="cx"> 
</span><ins>+    bool locked() const { return !!m_reader; }
+
</ins><span class="cx">     bool isErrored() const { return m_state == State::Errored; }
</span><span class="cx">     bool isReadable() const { return m_state == State::Readable; }
</span><span class="cx">     bool isCloseRequested() const { return m_closeRequested; }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.idl (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStream.idl        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.idl        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -37,4 +37,6 @@
</span><span class="cx">     [Custom, RaisesException] ReadableStreamReader getReader();
</span><span class="cx">     [Custom, RaisesException] Promise pipeTo(any streams, any options);
</span><span class="cx">     [Custom, RaisesException] Object pipeThrough(any dest, any options);
</span><ins>+
+    readonly attribute boolean locked;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSReadableStream::getReader(ExecState* exec)
</span><span class="cx"> {
</span><del>-    if (impl().isLocked())
</del><ins>+    if (impl().locked())
</ins><span class="cx">         return exec-&gt;vm().throwException(exec, createTypeError(exec, ASCIILiteral(&quot;ReadableStream is locked&quot;)));
</span><span class="cx">     return toJS(exec, globalObject(), impl().getReader());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamReaderCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamReaderCustom.cpp (185640 => 185641)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamReaderCustom.cpp        2015-06-17 05:31:30 UTC (rev 185640)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamReaderCustom.cpp        2015-06-17 06:00:27 UTC (rev 185641)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">     if (!stream)
</span><span class="cx">         return throwVMError(exec, createTypeError(exec, ASCIILiteral(&quot;ReadableStreamReader constructor parameter is not a ReadableStream&quot;)));
</span><span class="cx"> 
</span><del>-    if (stream-&gt;impl().isLocked())
</del><ins>+    if (stream-&gt;impl().locked())
</ins><span class="cx">         return throwVMError(exec, createTypeError(exec, ASCIILiteral(&quot;ReadableStreamReader constructor parameter is a locked ReadableStream&quot;)));
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(toJS(exec, stream-&gt;globalObject(), stream-&gt;impl().getReader()));
</span></span></pre>
</div>
</div>

</body>
</html>