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

Unified Diff: net/spdy/spdy_http_stream.h

Issue 2642133002: Change WeakPtr<SpdyStream> to raw pointer in SpdyHttpStream. (Closed)
Patch Set: Nits. Created 3 years, 11 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 | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_http_stream.h
diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h
index 0796e1a6905f6f57ec2a4456795ced6492da7185..6e1c59750a8b24584a22d612dc426aa82450c5df 100644
--- a/net/spdy/spdy_http_stream.h
+++ b/net/spdy/spdy_http_stream.h
@@ -36,7 +36,7 @@ class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate,
SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, bool direct);
~SpdyHttpStream() override;
- SpdyStream* stream() { return stream_.get(); }
+ SpdyStream* stream() { return stream_; }
// Cancels any callbacks from being invoked and deletes the stream.
void Cancel();
@@ -128,8 +128,15 @@ class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate,
const base::WeakPtr<SpdySession> spdy_session_;
bool is_reused_;
SpdyStreamRequest stream_request_;
- base::WeakPtr<SpdyStream> stream_;
+ // |stream_| is owned by SpdySession.
+ // Before InitializeStream() is called, stream_ == nullptr.
+ // After InitializeStream() is called but before OnClose() is called,
+ // |*stream_| is guaranteed to be valid.
+ // After OnClose() is called, stream_ == nullptr.
+ SpdyStream* stream_;
+
+ // False before OnClose() is called, true after.
bool stream_closed_;
// Set only when |stream_closed_| is true.
« no previous file with comments | « no previous file | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698