Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
Implementation of ReadableStream pipeTo and pipeThrough
Browse files Browse the repository at this point in the history
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
web-platform-tests/wpt@f36afea
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
whatwg/streams#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}
  • Loading branch information
ricea authored and Commit bot committed Jan 26, 2017
1 parent 3c4d508 commit 9ba4a64
Show file tree
Hide file tree
Showing 46 changed files with 510 additions and 669 deletions.
6 changes: 4 additions & 2 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ default_args = {
"//third_party/WebKit/Source/core/streams/CountQueuingStrategy.js",
"//third_party/WebKit/Source/core/streams/ReadableStream.js",
]
v8_experimental_extra_library_files =
[ "//third_party/WebKit/Source/core/streams/WritableStream.js" ]
v8_experimental_extra_library_files = [
"//third_party/WebKit/Source/core/streams/ReadableStreamExperimentalPipeTo.js",
"//third_party/WebKit/Source/core/streams/WritableStream.js",
]
v8_enable_inspector = true
v8_enable_gdbjit = false
v8_imminent_deprecation_warnings = false
Expand Down
22 changes: 11 additions & 11 deletions third_party/WebKit/LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1881,18 +1881,18 @@ crbug.com/626703 external/csswg-test/vendor-imports/mozilla/mozilla-central-reft
crbug.com/626703 external/csswg-test/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/logical-physical-mapping-001.html [ Failure ]
crbug.com/626703 external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-list-owner-menu.html [ Failure ]
crbug.com/626703 external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-list-owner-skip-no-boxes.html [ Failure ]
crbug.com/626703 external/wpt/streams/count-queuing-strategy.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/bad-strategies.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/bad-underlying-sources.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/brand-checks.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/cancel.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/count-queuing-strategy-integration.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/garbage-collection.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/count-queuing-strategy.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/bad-strategies.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/bad-underlying-sources.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/brand-checks.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/cancel.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/count-queuing-strategy-integration.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/garbage-collection.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/general.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/pipe-through.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/readable-stream-reader.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/tee.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/templated.https.html [ Timeout Failure ]
crbug.com/626703 external/wpt/streams/readable-streams/pipe-through.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/readable-stream-reader.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/tee.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/streams/readable-streams/templated.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/html/webappapis/idle-callbacks/callback-timeout.html [ Timeout ]
crbug.com/626703 external/wpt/html/webappapis/idle-callbacks/callback-multiple-calls.html [ Timeout ]
crbug.com/626703 external/wpt/html/webappapis/idle-callbacks/callback-exception.html [ Timeout ]
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9ba4a64

Please sign in to comment.