| Index: third_party/WebKit/Source/core/streams/WritableStream.js
|
| diff --git a/third_party/WebKit/Source/core/streams/WritableStream.js b/third_party/WebKit/Source/core/streams/WritableStream.js
|
| index 38f7adc1fa5c52471f8e4ae6017e6fcd8e87bd9a..c74b31770c6d59b160b1932c8bd072a4e2c89948 100644
|
| --- a/third_party/WebKit/Source/core/streams/WritableStream.js
|
| +++ b/third_party/WebKit/Source/core/streams/WritableStream.js
|
| @@ -141,11 +141,8 @@
|
| setDefaultControllerFlag(controller, FLAG_INCLOSE, value);
|
| }
|
|
|
| - function rejectPromises(array, e) {
|
| - // array is an InternalPackedArray so forEach won't work.
|
| - for (let i = 0; i < array.length; ++i) {
|
| - v8.rejectPromise(array[i], e);
|
| - }
|
| + function rejectPromises(queue, e) {
|
| + queue.forEach(promise => v8.rejectPromise(promise, e));
|
| }
|
|
|
| // https://tc39.github.io/ecma262/#sec-ispropertykey
|
| @@ -178,7 +175,7 @@
|
| this[_pendingWriteRequest] = undefined;
|
| this[_pendingCloseRequest] = undefined;
|
| this[_pendingAbortRequest] = undefined;
|
| - this[_writeRequests] = new v8.InternalPackedArray();
|
| + this[_writeRequests] = new binding.SimpleQueue();
|
| const type = underlyingSink.type;
|
| if (type !== undefined) {
|
| throw new RangeError(streamErrors.invalidType);
|
| @@ -331,7 +328,7 @@
|
|
|
| const storedError = stream[_storedError];
|
| rejectPromises(stream[_writeRequests], storedError);
|
| - stream[_writeRequests] = new v8.InternalPackedArray();
|
| + stream[_writeRequests] = new binding.SimpleQueue();
|
|
|
| if (stream[_pendingCloseRequest] !== undefined) {
|
| TEMP_ASSERT(
|
| @@ -623,7 +620,7 @@
|
| }
|
| this[_controlledWritableStream] = stream;
|
| this[_underlyingSink] = underlyingSink;
|
| - this[_queue] = new v8.InternalPackedArray();
|
| + this[_queue] = new binding.SimpleQueue();
|
| this[_queueSize] = 0;
|
| this[_defaultControllerFlags] = 0;
|
| const normalizedStrategy =
|
| @@ -665,7 +662,7 @@
|
| }
|
|
|
| function WritableStreamDefaultControllerAbort(controller, reason) {
|
| - controller[_queue] = v8.InternalPackedArray();
|
| + controller[_queue] = new binding.SimpleQueue();
|
| controller[_queueSize] = 0;
|
| const sinkAbortPromise =
|
| PromiseInvokeOrNoop(controller[_underlyingSink], 'abort', [reason]);
|
| @@ -805,7 +802,7 @@
|
| stream[_pendingWriteRequest] = stream[_writeRequests].shift();
|
|
|
| const sinkWritePromise = PromiseInvokeOrNoop(controller[_underlyingSink],
|
| - 'write', [chunk, controller]);
|
| + 'write', [chunk, controller]);
|
| thenPromise(
|
| sinkWritePromise,
|
| () => {
|
| @@ -881,7 +878,7 @@
|
| TEMP_ASSERT(state === WRITABLE || state === CLOSING,
|
| 'stream.[[state]] is "writable" or "closing".');
|
| WritableStreamError(stream, e);
|
| - controller[_queue] = new v8.InternalPackedArray();
|
| + controller[_queue] = new binding.SimpleQueue();
|
| controller[_queueSize] = 0;
|
| }
|
|
|
| @@ -917,7 +914,7 @@
|
| function PeekQueueValue(queue) {
|
| TEMP_ASSERT(queue.length !== 0,
|
| 'queue is not empty.');
|
| - return queue[0].value;
|
| + return queue.peek().value;
|
| }
|
|
|
| // Miscellaneous Operations
|
|
|