Skip to content

Commit

Permalink
Add more CHECKs in QuicChromiumClientStream
Browse files Browse the repository at this point in the history
To investigate a crash.

Bug: 1335423
Change-Id: I6ff013fa16a9a7a47637142f4b732b62b9d6d7b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3755025
Reviewed-by: Nidhi Jaju <nidhijaju@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1023044}
  • Loading branch information
bashi authored and Chromium LUCI CQ committed Jul 12, 2022
1 parent d1c5b10 commit e20c9b1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/quic/quic_chromium_client_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ void QuicChromiumClientStream::Handle::OnDataAvailable() {
if (!read_body_callback_)
return; // Wait for ReadBody to be called.

// TODO(https://crbug.com/1335423): Change to DCHECK() or remove after bug is
// fixed.
CHECK(read_body_buffer_);
CHECK_GT(read_body_buffer_len_, 0);

int rv = stream_->Read(read_body_buffer_, read_body_buffer_len_);
if (rv == ERR_IO_PENDING)
return; // Spurrious, likely because of trailers?
Expand Down Expand Up @@ -203,6 +208,11 @@ int QuicChromiumClientStream::Handle::ReadBody(
if (rv != ERR_IO_PENDING)
return rv;

// TODO(https://crbug.com/1335423): Change to DCHECK() or remove after bug is
// fixed.
CHECK(buffer);
CHECK_GT(buffer_len, 0);

SetCallback(std::move(callback), &read_body_callback_);
read_body_buffer_ = buffer;
read_body_buffer_len_ = buffer_len;
Expand Down

0 comments on commit e20c9b1

Please sign in to comment.