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

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

Issue 1902963003: [Streams] UnderlyingSourceBase should be kept alive only when locked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-stream-operations
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/streams/ReadableStreamOperationsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/streams/ReadableStream.js
diff --git a/third_party/WebKit/Source/core/streams/ReadableStream.js b/third_party/WebKit/Source/core/streams/ReadableStream.js
index 414c92343120fd65d3d7f87f4c38c6ffede89c77..46eef5435553303d0e47641cef816609637f1980 100644
--- a/third_party/WebKit/Source/core/streams/ReadableStream.js
+++ b/third_party/WebKit/Source/core/streams/ReadableStream.js
@@ -276,6 +276,15 @@
throw new TypeError(errReaderConstructorStreamAlreadyLocked);
}
+ // TODO(yhirano): Remove this when we don't need hasPendingActivity in
+ // blink::UnderlyingSourceBase.
+ if (stream[readableStreamController] === null) {
+ // The stream is created with an external controller (i.e. made in
+ // Blink).
+ const underlyingSource = stream[readableStreamUnderlyingSource];
+ callFunction(underlyingSource.notifyLockAcquired, underlyingSource);
+ }
+
this[readableStreamReaderOwnerReadableStream] = stream;
stream[readableStreamReader] = this;
@@ -342,6 +351,15 @@
throw new TypeError(errReleaseReaderWithPendingRead);
}
+ // TODO(yhirano): Remove this when we don't need hasPendingActivity in
+ // blink::UnderlyingSourceBase.
+ if (stream[readableStreamController] === null) {
+ // The stream is created with an external controller (i.e. made in
+ // Blink).
+ const underlyingSource = stream[readableStreamUnderlyingSource];
+ callFunction(underlyingSource.notifyLockReleased, underlyingSource);
+ }
+
if (stream[readableStreamState] === STATE_READABLE) {
v8.rejectPromise(this[readableStreamReaderClosedPromise],
new TypeError(errReleasedReaderClosedPromise));
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/streams/ReadableStreamOperationsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698