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

Unified Diff: net/spdy/spdy_session_pool.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_session.cc ('k') | net/spdy/spdy_session_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_pool.h
diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h
index a7562344f03c8e5f7155038cc4a29cd491a962b5..d2301a0a745a237951914747ee82948f5d01792e 100644
--- a/net/spdy/spdy_session_pool.h
+++ b/net/spdy/spdy_session_pool.h
@@ -84,23 +84,23 @@ class NET_EXPORT SpdySessionPool
scoped_ptr<ClientSocketHandle> connection,
const BoundNetLog& net_log,
int certificate_error_code,
- scoped_refptr<SpdySession>* available_session,
+ base::WeakPtr<SpdySession>* available_session,
bool is_secure);
// Find an available session for the given key, or NULL if there isn't one.
- scoped_refptr<SpdySession> FindAvailableSession(const SpdySessionKey& key,
+ base::WeakPtr<SpdySession> FindAvailableSession(const SpdySessionKey& key,
const BoundNetLog& net_log);
// Remove all mappings and aliases for the given session, which must
// still be available. Except for in tests, this must be called by
// the given session itself.
void MakeSessionUnavailable(
- const scoped_refptr<SpdySession>& available_session);
+ const base::WeakPtr<SpdySession>& available_session);
// Removes an unavailable session from the pool. Except for in
// tests, this must be called by the given session itself.
void RemoveUnavailableSession(
- const scoped_refptr<SpdySession>& unavailable_session);
+ const base::WeakPtr<SpdySession>& unavailable_session);
// Close only the currently existing SpdySessions with |error|.
// Let any new ones created while this method is running continue to
@@ -144,12 +144,12 @@ class NET_EXPORT SpdySessionPool
friend class SpdySessionPoolPeer; // For testing.
typedef std::set<scoped_refptr<SpdySession> > SessionSet;
- typedef std::map<SpdySessionKey, scoped_refptr<SpdySession> >
+ typedef std::map<SpdySessionKey, base::WeakPtr<SpdySession> >
AvailableSessionMap;
typedef std::map<IPEndPoint, SpdySessionKey> AliasMap;
// Returns true iff |session| is in |available_sessions_|.
- bool IsSessionAvailable(const scoped_refptr<SpdySession>& session) const;
+ bool IsSessionAvailable(const base::WeakPtr<SpdySession>& session) const;
// Returns a normalized version of the given key suitable for lookup
// into |available_sessions_|.
@@ -158,7 +158,7 @@ class NET_EXPORT SpdySessionPool
// Map the given key to the given session. There must not already be
// a mapping for |key|.
void MapKeyToAvailableSession(const SpdySessionKey& key,
- const scoped_refptr<SpdySession>& session);
+ const base::WeakPtr<SpdySession>& session);
// Returns an iterator into |available_sessions_| for the given key,
// which may be equal to |available_sessions_.end()|.
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/spdy/spdy_session_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698