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

Side by Side Diff: third_party/WebKit/Source/core/streams/ReadableStream.js

Issue 2796633002: Add "mark promise as handled" change to pipeThrough() (Closed)
Patch Set: Use v8.isPromise instead of instanceof Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/streams/piping/pipe-through.sharedworker-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, binding, v8) { 5 (function(global, binding, v8) {
6 'use strict'; 6 'use strict';
7 7
8 const _reader = v8.createPrivateSymbol('[[reader]]'); 8 const _reader = v8.createPrivateSymbol('[[reader]]');
9 const _storedError = v8.createPrivateSymbol('[[storedError]]'); 9 const _storedError = v8.createPrivateSymbol('[[storedError]]');
10 const _controller = v8.createPrivateSymbol('[[controller]]'); 10 const _controller = v8.createPrivateSymbol('[[controller]]');
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 171
172 if (mode === undefined) { 172 if (mode === undefined) {
173 return AcquireReadableStreamDefaultReader(this); 173 return AcquireReadableStreamDefaultReader(this);
174 } 174 }
175 175
176 throw new RangeError(errGetReaderBadMode); 176 throw new RangeError(errGetReaderBadMode);
177 } 177 }
178 178
179 pipeThrough({writable, readable}, options) { 179 pipeThrough({writable, readable}, options) {
180 this.pipeTo(writable, options); 180 const promise = this.pipeTo(writable, options);
181 if (v8.isPromise(promise)) {
182 v8.markPromiseAsHandled(promise);
183 }
181 return readable; 184 return readable;
182 } 185 }
183 186
184 pipeTo(dest, {preventClose, preventAbort, preventCancel} = {}) { 187 pipeTo(dest, {preventClose, preventAbort, preventCancel} = {}) {
185 if (!IsReadableStream(this)) { 188 if (!IsReadableStream(this)) {
186 return Promise_reject(new TypeError(streamErrors.illegalInvocation)); 189 return Promise_reject(new TypeError(streamErrors.illegalInvocation));
187 } 190 }
188 191
189 if (!binding.IsWritableStream(dest)) { 192 if (!binding.IsWritableStream(dest)) {
190 // TODO(ricea): Think about having a better error message. 193 // TODO(ricea): Think about having a better error message.
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC ontrollerGetDesiredSize; 1114 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC ontrollerGetDesiredSize;
1112 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll erEnqueue; 1115 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll erEnqueue;
1113 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController Error; 1116 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController Error;
1114 1117
1115 binding.createReadableStreamWithExternalController = 1118 binding.createReadableStreamWithExternalController =
1116 (underlyingSource, strategy) => { 1119 (underlyingSource, strategy) => {
1117 return new ReadableStream( 1120 return new ReadableStream(
1118 underlyingSource, strategy, createWithExternalControllerSentinel); 1121 underlyingSource, strategy, createWithExternalControllerSentinel);
1119 }; 1122 };
1120 }); 1123 });
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/streams/piping/pipe-through.sharedworker-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698