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

Unified Diff: net/quic/chromium/quic_http_stream.cc

Issue 2267283003: CHECK that QuicHttpStream::callback_ is null in any methods which may (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/quic_http_stream.cc
diff --git a/net/quic/chromium/quic_http_stream.cc b/net/quic/chromium/quic_http_stream.cc
index cccf3b5be0ad34bab8fc2d4b524abf83244e7f64..df0a0d6834c977c500694a517df81d2dd15d6a66 100644
--- a/net/quic/chromium/quic_http_stream.cc
+++ b/net/quic/chromium/quic_http_stream.cc
@@ -135,6 +135,7 @@ int QuicHttpStream::InitializeStream(const HttpRequestInfo* request_info,
RequestPriority priority,
const BoundNetLog& stream_net_log,
const CompletionCallback& callback) {
+ CHECK(callback_.is_null());
DCHECK(!stream_);
if (!session_)
return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED
@@ -253,6 +254,7 @@ int QuicHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
const CompletionCallback& callback) {
CHECK(!request_body_stream_);
CHECK(!response_info_);
+ CHECK(callback_.is_null());
CHECK(!callback.is_null());
CHECK(response);
@@ -316,6 +318,7 @@ UploadProgress QuicHttpStream::GetUploadProgress() const {
}
int QuicHttpStream::ReadResponseHeaders(const CompletionCallback& callback) {
+ CHECK(callback_.is_null());
CHECK(!callback.is_null());
if (stream_ == nullptr)
@@ -334,6 +337,11 @@ int QuicHttpStream::ReadResponseHeaders(const CompletionCallback& callback) {
int QuicHttpStream::ReadResponseBody(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) {
+ CHECK(callback_.is_null());
+ CHECK(!callback.is_null());
+ CHECK(!user_buffer_.get());
+ CHECK_EQ(0, user_buffer_len_);
+
if (!stream_) {
// If the stream is already closed, there is no body to read.
return response_status_;
@@ -343,10 +351,6 @@ int QuicHttpStream::ReadResponseBody(IOBuffer* buf,
if (rv != ERR_IO_PENDING)
return rv;
- CHECK(callback_.is_null());
- CHECK(!user_buffer_.get());
- CHECK_EQ(0, user_buffer_len_);
-
callback_ = callback;
user_buffer_ = buf;
user_buffer_len_ = buf_len;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698