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

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

Issue 2837753002: [marge-m59] Add "mark promise as handled" change to pipeThrough() (Closed)
Patch Set: Created 3 years, 7 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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC ontrollerGetDesiredSize; 1120 binding.ReadableStreamDefaultControllerGetDesiredSize = ReadableStreamDefaultC ontrollerGetDesiredSize;
1118 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll erEnqueue; 1121 binding.ReadableStreamDefaultControllerEnqueue = ReadableStreamDefaultControll erEnqueue;
1119 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController Error; 1122 binding.ReadableStreamDefaultControllerError = ReadableStreamDefaultController Error;
1120 1123
1121 binding.createReadableStreamWithExternalController = 1124 binding.createReadableStreamWithExternalController =
1122 (underlyingSource, strategy) => { 1125 (underlyingSource, strategy) => {
1123 return new ReadableStream( 1126 return new ReadableStream(
1124 underlyingSource, strategy, createWithExternalControllerSentinel); 1127 underlyingSource, strategy, createWithExternalControllerSentinel);
1125 }; 1128 };
1126 }); 1129 });
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