Chromium Code Reviews
Description[Streams] UnderlyingSourceBase should be kept alive only when locked
In a situation that UnderlyingSourceBase lives in Blink and the associated
stream is exposed to the script, we're relying on ActiveScriptWrappable
mechanism to keep the underlying source alive even when it is unreachable from
the script, because it is very difficult to handle the following script with
other means.
let stream = ...;
let reader = stream.getReader();
let promise = reader.read();
reader = null;
stream = null;
// Now the script doesn't have a reference to the underlying source but we
// need to keep it alive until the promise resolves or rejects.
On the other hand, current UnderlyingSourceBase::hasPendingActivity returns
true when the associated controller is active and it's too leaky. For example,
fetch('/big-resource-with-cache-control-no-store');
leaks because no one read the body and the controller will stay active.
This CL introduces notifyLockAcquired and notifyLockReleased to
UnderlyingSourceBase to notify the locking status and make
UnderlyingSourceBase::hasPendingActivity use the information.
BUG=596832
Committed: https://crrev.com/68e61c0671cfb913078d5d48200292339e7b52cd
Cr-Commit-Position: refs/heads/master@{#389038}
Patch Set 1 #Patch Set 2 : #
Total comments: 2
Patch Set 3 : #
Depends on Patchset: Dependent Patchsets: Messages
Total messages: 19 (11 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||