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

Unified Diff: net/spdy/spdy_session.h

Issue 18546008: [SPDY] Use WeakPtr<SpdySession> everywhere but SpdySessionPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test, other minor formatting/comment changes Created 7 years, 5 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_proxy_client_socket_unittest.cc ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.h
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 5f6f4e0e6d08882f03e2bb9a6d6600ffe3b99b79..dd2e0dafadd971a22f8b26cf2574015a2ffcc5db 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -133,7 +133,7 @@ class NET_EXPORT_PRIVATE SpdyStreamRequest {
// ReleaseStream() being called first. Otherwise, in case of an
// immediate error, this may be called again.
int StartRequest(SpdyStreamType type,
- const scoped_refptr<SpdySession>& session,
+ const base::WeakPtr<SpdySession>& session,
const GURL& url,
RequestPriority priority,
const BoundNetLog& net_log,
@@ -170,7 +170,7 @@ class NET_EXPORT_PRIVATE SpdyStreamRequest {
void Reset();
SpdyStreamType type_;
- scoped_refptr<SpdySession> session_;
+ base::WeakPtr<SpdySession> session_;
base::WeakPtr<SpdyStream> stream_;
GURL url_;
RequestPriority priority_;
@@ -344,6 +344,9 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>,
// Whether the stream is closed, i.e. it has stopped processing data
// and is about to be destroyed.
+ //
+ // TODO(akalin): This is only used in tests. Remove this function
+ // and have tests test the WeakPtr instead.
bool IsClosed() const { return availability_state_ == STATE_CLOSED; }
// Closes this session. This will close all active streams and mark
@@ -463,6 +466,9 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>,
return buffered_spdy_framer_->GetDataFrameMaximumPayload();
}
+ // Must be used only by |pool_|.
+ base::WeakPtr<SpdySession> GetWeakPtr();
+
// LayeredPool implementation:
virtual bool CloseOneIdleConnection() OVERRIDE;
« no previous file with comments | « net/spdy/spdy_proxy_client_socket_unittest.cc ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698