Title: [186113] trunk
- Revision
- 186113
- Author
- calva...@igalia.com
- Date
- 2015-06-30 02:53:40 -0700 (Tue, 30 Jun 2015)
Log Message
[Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
https://bugs.webkit.org/show_bug.cgi?id=146408
Reviewed by Darin Adler.
Source/WebCore:
Current tests cover the case already.
* Modules/streams/ReadableStream.cpp:
(WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
resolution.
LayoutTests:
* streams/reference-implementation/readable-stream-expected.txt: Updated expectation to PASS
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (186112 => 186113)
--- trunk/LayoutTests/ChangeLog 2015-06-30 09:27:49 UTC (rev 186112)
+++ trunk/LayoutTests/ChangeLog 2015-06-30 09:53:40 UTC (rev 186113)
@@ -1,5 +1,14 @@
2015-06-30 Youenn Fablet <youenn.fab...@crf.canon.fr> and Xabier Rodriguez Calvar <calva...@igalia.com>
+ [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
+ https://bugs.webkit.org/show_bug.cgi?id=146408
+
+ Reviewed by Darin Adler.
+
+ * streams/reference-implementation/readable-stream-expected.txt: Updated expectation to PASS
+
+2015-06-30 Youenn Fablet <youenn.fab...@crf.canon.fr> and Xabier Rodriguez Calvar <calva...@igalia.com>
+
[Streams API] Synced bad strategy test with reference implementation
https://bugs.webkit.org/show_bug.cgi?id=146411
Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt (186112 => 186113)
--- trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt 2015-06-30 09:27:49 UTC (rev 186112)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt 2015-06-30 09:53:40 UTC (rev 186113)
@@ -13,7 +13,7 @@
PASS ReadableStream should be able to enqueue different objects.
PASS ReadableStream: if pull rejects, it should error the stream
PASS ReadableStream: should only call pull once upon starting the stream
-FAIL ReadableStream: should call pull when trying to read from a started, empty stream assert_equals: pull should be called again in reaction to calling read expected 2 but got 3
+PASS ReadableStream: should call pull when trying to read from a started, empty stream
PASS ReadableStream: should only call pull once on a non-empty stream read from before start fulfills
PASS ReadableStream: should only call pull once on a non-empty stream read from after start fulfills
PASS ReadableStream: should not call pull() in reaction to read()ing the last chunk, if draining
Modified: trunk/Source/WebCore/ChangeLog (186112 => 186113)
--- trunk/Source/WebCore/ChangeLog 2015-06-30 09:27:49 UTC (rev 186112)
+++ trunk/Source/WebCore/ChangeLog 2015-06-30 09:53:40 UTC (rev 186113)
@@ -1,5 +1,18 @@
2015-06-30 Youenn Fablet <youenn.fab...@crf.canon.fr> and Xabier Rodriguez Calvar <calva...@igalia.com>
+ [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
+ https://bugs.webkit.org/show_bug.cgi?id=146408
+
+ Reviewed by Darin Adler.
+
+ Current tests cover the case already.
+
+ * Modules/streams/ReadableStream.cpp:
+ (WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
+ resolution.
+
+2015-06-30 Youenn Fablet <youenn.fab...@crf.canon.fr> and Xabier Rodriguez Calvar <calva...@igalia.com>
+
[Streams API] Synced bad strategy test with reference implementation
https://bugs.webkit.org/show_bug.cgi?id=146411
Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.cpp (186112 => 186113)
--- trunk/Source/WebCore/Modules/streams/ReadableStream.cpp 2015-06-30 09:27:49 UTC (rev 186112)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.cpp 2015-06-30 09:53:40 UTC (rev 186113)
@@ -34,6 +34,7 @@
#include "ExceptionCode.h"
#include "ReadableStreamReader.h"
+#include "ScriptExecutionContext.h"
#include <runtime/JSCJSValueInlines.h>
#include <wtf/RefCountedLeakCounter.h>
@@ -132,8 +133,12 @@
}
m_isPulling = true;
- if (doPull())
- finishPulling();
+ if (doPull()) {
+ RefPtr<ReadableStream> protectedStream(this);
+ scriptExecutionContext()->postTask([protectedStream](ScriptExecutionContext&) {
+ protectedStream->finishPulling();
+ });
+ }
}
void ReadableStream::finishPulling()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes