From 795cbf848605eefc41317a572797518afbf7409f Mon Sep 17 00:00:00 2001 From: "akalin@chromium.org" Date: Mon, 22 Jul 2013 09:37:27 +0000 Subject: [SPDY] Use WeakPtr everywhere but SpdySessionPool Make SpdyHttpStream cache it's SPDY stream's LoadTimingInfo on close. Also, make SpdyHttpStream query SpdySession::IsReused() when it's constructed and cache the value, as that's closer to the intent of its use. Avoid uses of SpdySession::IsClosed() in non-test code and add TODO to remove uses from test code. This is more correct since testing the WeakPtr is a stronger condition than testing openness and SpdySession functions already do the right thing if the SpdySession is already closed. Tweak some tests that implicitly depended on having refs to SpdySession. BUG=255701 R=rch@chromium.org Review URL: https://codereview.chromium.org/18546008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212858 0039d316-1c4b-4281-b951-d872f2087c98 --- net/spdy/spdy_stream.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'net/spdy/spdy_stream.h') diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h index 185d3e4..1db1217 100644 --- a/net/spdy/spdy_stream.h +++ b/net/spdy/spdy_stream.h @@ -157,7 +157,7 @@ class NET_EXPORT_PRIVATE SpdyStream { // SpdyStream constructor SpdyStream(SpdyStreamType type, - SpdySession* session, + const base::WeakPtr& session, const GURL& url, RequestPriority priority, int32 initial_send_window_size, @@ -334,7 +334,7 @@ class NET_EXPORT_PRIVATE SpdyStream { // it. void Close(); - // Must be used only by the SpdySession. + // Must be used only by |session_|. base::WeakPtr GetWeakPtr(); // Interface for the delegate to use. @@ -490,7 +490,7 @@ class NET_EXPORT_PRIVATE SpdyStream { ScopedBandwidthMetrics metrics_; - scoped_refptr session_; + const base::WeakPtr session_; // The transaction should own the delegate. SpdyStream::Delegate* delegate_; -- cgit v1.1