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

Unified Diff: net/quic/quic_http_stream.cc

Issue 1688003005: QUIC - instrumentation for testing null QuicSpdyStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments for PatchSet 2 Created 4 years, 10 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
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index db671f22e925e3313ae37f648a0e7e762eac4f1b..c30ed5982326d2d3882a0011b326caa868dc8aae 100644
--- a/net/quic/quic_http_stream.cc
+++ b/net/quic/quic_http_stream.cc
@@ -556,7 +556,21 @@ int QuicHttpStream::ProcessResponseHeaders(const SpdyHeaderBlock& headers) {
}
int QuicHttpStream::ReadAvailableData(IOBuffer* buf, int buf_len) {
+ // TODO(rtenneti): Temporary until crbug.com/585591 is solved.
+ CHECK(!read_is_progress_);
+ read_is_progress_ = true;
+ stream_->set_read_is_progress(read_is_progress_);
+ stream_->CrashIfInvalid();
eroman 2016/02/12 21:12:43 nit: move this up one line so it precedes other ac
ramant (doing other things) 2016/02/13 00:14:19 Good point. Thanks much. Done.
+
int rv = stream_->Read(buf, buf_len);
+ // TODO(rtenneti): Temporary until crbug.com/585591 is solved.
+ CHECK(read_is_progress_);
+ read_is_progress_ = false;
+ stream_->set_read_is_progress(read_is_progress_);
+ // CrashIfInvalid() may not be necessary. See if |stream_| became a nullptr
+ // due to memory corruptions.
+ stream_->CrashIfInvalid();
+
if (stream_->IsDoneReading()) {
stream_->SetDelegate(nullptr);
stream_->OnFinRead();
@@ -566,6 +580,11 @@ int QuicHttpStream::ReadAvailableData(IOBuffer* buf, int buf_len) {
}
void QuicHttpStream::ResetStream() {
+ // TODO(rtenneti): Temporary until crbug.com/585591 is solved.
+ if (read_is_progress_) {
+ // |stream_| is going away when Read is called. Should never happen??
+ CHECK(false);
+ }
if (!stream_)
return;
closed_stream_received_bytes_ = stream_->stream_bytes_read();

Powered by Google App Engine
This is Rietveld 408576698