Commit e22807ef authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

Hold reference to stream in CloseAndLockAndDisturb

Some crashes in CloseAndLockAndDisturb may be caused by early collection
of the stream referenced by BodyStreamBuffer. Keep an extra reference to
the stream on the stack as a speculative workaround.

BUG=882599

Change-Id: I798a175cbac6414a7a70cfcb1e924624232a0a19
Reviewed-on: https://chromium-review.googlesource.com/1218123Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590255}
parent a1153d79
......@@ -373,6 +373,14 @@ bool BodyStreamBuffer::IsStreamDisturbedForDCheck() {
}
void BodyStreamBuffer::CloseAndLockAndDisturb(ExceptionState& exception_state) {
// Speculative fix for https://crbug.com/882599. Stop the stream from being
// garbage collected while this function is executing.
// TODO(ricea): Remove this when a better solution is found or if it doesn't
// work.
v8::Local<v8::Value> stream_handle =
stream_.NewLocal(script_state_->GetIsolate());
CHECK(!stream_handle.IsEmpty());
base::Optional<bool> is_readable = IsStreamReadable(exception_state);
if (exception_state.HadException())
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment