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

Unified Diff: net/spdy/spdy_http_stream.cc

Issue 2298823002: Resetting the HttpRequestInfo pointers in HttpNetworkTransaction and streams (Closed)
Patch Set: Rebased till refs/heads/master@{#425377} Created 4 years, 2 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 | « net/spdy/spdy_http_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_http_stream.cc
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
index 5f0da2f16fda883f4312036ed5bc4c2afb7e7828..5dd1439c75f1e822ee6e5ecea95dcff0f99b36ad 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -120,6 +120,14 @@ int SpdyHttpStream::ReadResponseHeaders(const CompletionCallback& callback) {
int SpdyHttpStream::ReadResponseBody(
IOBuffer* buf, int buf_len, const CompletionCallback& callback) {
+ // Invalidate HttpRequestInfo pointer. This is to allow the stream to be
+ // shared across multiple transactions which might require this
+ // stream to outlive the request_'s owner.
+ // Only allowed when Reading of response body starts. It is safe to reset it
+ // at this point since request_->upload_data_stream is also not needed
+ // anymore.
+ request_info_ = nullptr;
+
if (stream_.get())
CHECK(!stream_->IsIdle());
@@ -367,7 +375,7 @@ void SpdyHttpStream::OnTrailers(const SpdyHeaderBlock& trailers) {}
void SpdyHttpStream::OnClose(int status) {
// Cancel any pending reads from the upload data stream.
- if (request_info_->upload_data_stream)
+ if (request_info_ && request_info_->upload_data_stream)
request_info_->upload_data_stream->Reset();
if (stream_.get()) {
« no previous file with comments | « net/spdy/spdy_http_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698