Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Issue 2561443004: Implementation of ReadableStream pipeTo and pipeThrough (Closed)

Created:
4 years ago by Adam Rice
Modified:
3 years, 11 months ago
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implementation of ReadableStream pipeTo and pipeThrough Implement the pipeTo() and pipeThrough() methods on the ReadableStream class. They are only enabled when V8 experimental extras are, eg. when the --enable-experimental-web-platform-features flag is used. The methods are not visible when running without flags. To achieve this, the methods are defined in ReadableStream.js but not added to the global object. ReadableStreamExperimentalPipeTo.js is executed at renderer startup time when the experimental flag is set and simply adds the two methods to the global ReadableStream object. This initial implementation is intentionally unoptimised. While it does use internal APIs it won't perform any better than a polyfill using the public APIs would. Additional optimisation work is expected after shipping. Also remove the failing expectations for many external/wpt/streams tests that use piping. serviceworker still have failing expectations due to using HTTP. When https://github.com/w3c/web-platform-tests/commit/f36afea64a7478360f7c30b976c87acc2564e7ea is rolled from upstream the failures will go away. The upstream version of the streams/piping/multiple-propagation.js test 'Piping from an errored readable stream to a closed writable stream' doesn't pass in Chromium . This is a known incompatibility with the reference implementation which will be resolved by https://github.com/whatwg/streams/pull/634. This CL adds a modified version of the test in http/tests/streams/piping which verifies the behaviour of this implementation. I have filed http://crbug.com/684543 to track it. BUG=668951 Review-Url: https://codereview.chromium.org/2561443004 Cr-Commit-Position: refs/heads/master@{#446358} Committed: https://chromium.googlesource.com/chromium/src/+/9ba4a643d92a0ec3890aa1c9b7f2be349ad2c928

Patch Set 1 #

Patch Set 2 : Make it work #

Patch Set 3 : Update global interface listing expectations #

Patch Set 4 : Allow read and write to proceed in parallel #

Patch Set 5 : Stop waiting for writes to terminate at shutdown #

Total comments: 8

Patch Set 6 : Changes from domenic review #

Total comments: 17

Patch Set 7 : Apply changes from tyoshino review #

Total comments: 4

Patch Set 8 : Fix assert descriptions and add explanation of initial check ordering #

Patch Set 9 : Rebase, fix text expectations, remove duplicate tests #

Patch Set 10 : Rebase and move includes to .gn #

Unified diffs Side-by-side diffs Delta from patch set Stats (+510 lines, -669 lines) Patch
M .gn View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -11 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/close-propagation-backward.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -19 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/close-propagation-backward.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -19 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/close-propagation-backward.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -19 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/close-propagation-forward.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -29 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/close-propagation-forward.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -29 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/close-propagation-forward.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -29 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -38 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -38 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -38 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-forward.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -32 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-forward.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -32 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-forward.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -32 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/flow-control.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -7 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/flow-control.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -7 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/flow-control.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -7 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/general.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -15 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/general.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -15 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/general.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -15 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -5 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/pipe-through.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -8 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/pipe-through.https-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -8 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/piping/pipe-through.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/general.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/general.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/pipe-through.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -8 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/pipe-through.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -8 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/templated.dedicatedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -89 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/templated.sharedworker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -89 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/streams/piping/multiple-propagation.js View 1 1 chunk +139 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/streams/piping/multiple-propagation.https.html View 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/general.js View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-compositor-worker-expected.txt View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/streams/README.md View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/streams/ReadableStream.js View 1 2 3 4 5 6 7 8 9 4 chunks +210 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/streams/ReadableStreamExperimentalPipeTo.js View 1 1 chunk +25 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/streams/WritableStream.js View 1 2 3 4 5 6 7 4 chunks +71 lines, -0 lines 0 comments Download

Messages

Total messages: 55 (37 generated)
Adam Rice
3 years, 11 months ago (2017-01-12 15:05:06 UTC) #10
domenic
The undefined error case probably needs to be fixed. I am also impressed you got ...
3 years, 11 months ago (2017-01-18 23:51:17 UTC) #18
Adam Rice
https://codereview.chromium.org/2561443004/diff/80001/third_party/WebKit/Source/core/streams/ReadableStream.js File third_party/WebKit/Source/core/streams/ReadableStream.js (right): https://codereview.chromium.org/2561443004/diff/80001/third_party/WebKit/Source/core/streams/ReadableStream.js#newcode234 third_party/WebKit/Source/core/streams/ReadableStream.js:234: function initialStateOk() { On 2017/01/18 23:51:17, domenic wrote: > ...
3 years, 11 months ago (2017-01-19 14:02:47 UTC) #19
domenic
lgtm
3 years, 11 months ago (2017-01-19 18:37:37 UTC) #20
Adam Rice
3 years, 11 months ago (2017-01-20 04:19:39 UTC) #22
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/2561443004/diff/100001/third_party/WebKit/Source/core/streams/ReadableStream.js File third_party/WebKit/Source/core/streams/ReadableStream.js (right): https://codereview.chromium.org/2561443004/diff/100001/third_party/WebKit/Source/core/streams/ReadableStream.js#newcode234 third_party/WebKit/Source/core/streams/ReadableStream.js:234: function initialStateOk() { This function name sounds like checking ...
3 years, 11 months ago (2017-01-23 10:42:58 UTC) #23
Adam Rice
The presubmit suddenly decided it wanted me to format my Javascript. Sorry for the diff ...
3 years, 11 months ago (2017-01-23 13:24:31 UTC) #24
tyoshino (SeeGerritForStatus)
> The presubmit suddenly decided it wanted me to format my Javascript. Sorry for the ...
3 years, 11 months ago (2017-01-24 09:52:33 UTC) #25
Adam Rice
https://codereview.chromium.org/2561443004/diff/120001/third_party/WebKit/Source/core/streams/WritableStream.js File third_party/WebKit/Source/core/streams/WritableStream.js (right): https://codereview.chromium.org/2561443004/diff/120001/third_party/WebKit/Source/core/streams/WritableStream.js#newcode605 third_party/WebKit/Source/core/streams/WritableStream.js:605: 'writer is a WritableStreamDefaultWriter'); On 2017/01/24 09:52:33, tyoshino wrote: ...
3 years, 11 months ago (2017-01-24 10:12:09 UTC) #26
Adam Rice
+brettw for v8.gni
3 years, 11 months ago (2017-01-24 10:15:43 UTC) #28
Adam Rice
brettw, PTAL.
3 years, 11 months ago (2017-01-26 04:16:56 UTC) #40
brettw
.gn LGTM
3 years, 11 months ago (2017-01-26 04:31:19 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2561443004/220001
3 years, 11 months ago (2017-01-26 04:35:58 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/220726)
3 years, 11 months ago (2017-01-26 06:42:24 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2561443004/220001
3 years, 11 months ago (2017-01-26 13:21:36 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/220965)
3 years, 11 months ago (2017-01-26 14:46:22 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2561443004/220001
3 years, 11 months ago (2017-01-26 16:27:19 UTC) #52
commit-bot: I haz the power
3 years, 11 months ago (2017-01-26 17:12:41 UTC) #55
Message was sent while issue was closed.
Committed patchset #10 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/9ba4a643d92a0ec3890aa1c9b7f2...

Powered by Google App Engine
This is Rietveld 408576698