Commit 5b9647c9 authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Enter V8 context before calling Incoming|OutgoingStream::Reset

As specified in the method comments.

Bug: 1112734
Change-Id: I0e16566014936d396f7f47d27fb0f17cfe2124d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351929Reviewed-by: default avatarAdam Rice <ricea@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797550}
parent 89f5b9b6
...@@ -41,11 +41,13 @@ void BidirectionalStream::OnIncomingStreamClosed(bool fin_received) { ...@@ -41,11 +41,13 @@ void BidirectionalStream::OnIncomingStreamClosed(bool fin_received) {
incoming_stream_->OnIncomingStreamClosed(fin_received); incoming_stream_->OnIncomingStreamClosed(fin_received);
// TODO(ricea): Review this behaviour when adding detail to the specification. // TODO(ricea): Review this behaviour when adding detail to the specification.
if (!sent_fin_) { if (!sent_fin_) {
ScriptState::Scope scope(outgoing_stream_->GetScriptState());
outgoing_stream_->Reset(); outgoing_stream_->Reset();
} }
} }
void BidirectionalStream::Reset() { void BidirectionalStream::Reset() {
ScriptState::Scope scope(outgoing_stream_->GetScriptState());
outgoing_stream_->Reset(); outgoing_stream_->Reset();
incoming_stream_->Reset(); incoming_stream_->Reset();
} }
...@@ -79,6 +81,7 @@ void BidirectionalStream::Trace(Visitor* visitor) const { ...@@ -79,6 +81,7 @@ void BidirectionalStream::Trace(Visitor* visitor) const {
void BidirectionalStream::OnIncomingStreamAbort() { void BidirectionalStream::OnIncomingStreamAbort() {
quic_transport_->ForgetStream(stream_id_); quic_transport_->ForgetStream(stream_id_);
ScriptState::Scope scope(outgoing_stream_->GetScriptState());
outgoing_stream_->Reset(); outgoing_stream_->Reset();
} }
......
...@@ -68,6 +68,8 @@ class MODULES_EXPORT OutgoingStream final ...@@ -68,6 +68,8 @@ class MODULES_EXPORT OutgoingStream final
ScriptPromise WritingAborted() const { return writing_aborted_; } ScriptPromise WritingAborted() const { return writing_aborted_; }
ScriptState* GetScriptState() { return script_state_; }
void AbortWriting(StreamAbortInfo*); void AbortWriting(StreamAbortInfo*);
// Called from QuicTransport via a WebTransportStream. Expects a JavaScript // Called from QuicTransport via a WebTransportStream. Expects a JavaScript
......
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