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

Unified Diff: third_party/WebKit/Source/core/streams/WritableStream.js

Issue 2625873008: Fix crash in WritableStreamFinishClose (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/streams/writable-streams/close.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5780fa88199cb853fdd13747ecc6750acf741d83..e987cedd7f85b4496a9d3cff686013165fcf546d 100644
--- a/third_party/WebKit/Source/core/streams/WritableStream.js
+++ b/third_party/WebKit/Source/core/streams/WritableStream.js
@@ -306,13 +306,16 @@
TEMP_ASSERT(state === CLOSING || state === ERRORED,
'state is "closing" or "errored"');
+ const writer = stream[_writer];
if (state === CLOSING) {
- v8.resolvePromise(stream[_writer][_closedPromise], undefined);
+ if (writer !== undefined) {
+ v8.resolvePromise(writer[_closedPromise], undefined);
+ }
stream[_state] = CLOSED;
- } else {
+ } else if (writer !== undefined) {
TEMP_ASSERT(state === ERRORED, 'state is "errored"');
- v8.rejectPromise(stream[_writer][_closedPromise], stream[_storedError]);
- v8.markPromiseAsHandled(stream[_writer][_closedPromise]);
+ v8.rejectPromise(writer[_closedPromise], stream[_storedError]);
+ v8.markPromiseAsHandled(writer[_closedPromise]);
}
if (stream[_pendingAbortRequest] !== undefined) {
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/streams/writable-streams/close.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698