diff options
Diffstat (limited to 'net/spdy')
-rw-r--r-- | net/spdy/spdy_http_stream_unittest.cc | 7 | ||||
-rw-r--r-- | net/spdy/spdy_network_transaction_unittest.cc | 7 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.cc | 15 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.h | 9 | ||||
-rw-r--r-- | net/spdy/spdy_session_unittest.cc | 7 |
5 files changed, 20 insertions, 25 deletions
diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc index c3b321a..d1d3546 100644 --- a/net/spdy/spdy_http_stream_unittest.cc +++ b/net/spdy/spdy_http_stream_unittest.cc @@ -55,7 +55,7 @@ class SessionDependencies { proxy_service(CreateNullProxyService()), ssl_config_service(new SSLConfigServiceDefaults), http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()), - spdy_session_pool(new SpdySessionPool(NULL)) {} + spdy_session_pool(new SpdySessionPool()) {} // Custom proxy service dependency. explicit SessionDependencies(ProxyService* proxy_service) @@ -63,7 +63,7 @@ class SessionDependencies { proxy_service(proxy_service), ssl_config_service(new SSLConfigServiceDefaults), http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()), - spdy_session_pool(new SpdySessionPool(NULL)) {} + spdy_session_pool(new SpdySessionPool()) {} scoped_refptr<MockHostResolverBase> host_resolver; scoped_refptr<ProxyService> proxy_service; @@ -74,8 +74,7 @@ class SessionDependencies { }; HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { - return new HttpNetworkSession(NULL, - session_deps->host_resolver, + return new HttpNetworkSession(session_deps->host_resolver, session_deps->proxy_service, &session_deps->socket_factory, session_deps->ssl_config_service, diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index c6e1cb0..e912b78 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -55,7 +55,7 @@ class SessionDependencies { proxy_service(ProxyService::CreateNull()), ssl_config_service(new SSLConfigServiceDefaults), http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()), - spdy_session_pool(new SpdySessionPool(NULL)) { + spdy_session_pool(new SpdySessionPool()) { // Note: The CancelledTransaction test does cleanup by running all tasks // in the message loop (RunAllPending). Unfortunately, that doesn't clean // up tasks on the host resolver thread; and TCPConnectJob is currently @@ -71,7 +71,7 @@ class SessionDependencies { proxy_service(proxy_service), ssl_config_service(new SSLConfigServiceDefaults), http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault()), - spdy_session_pool(new SpdySessionPool(NULL)) {} + spdy_session_pool(new SpdySessionPool()) {} scoped_refptr<MockHostResolverBase> host_resolver; scoped_refptr<ProxyService> proxy_service; @@ -82,8 +82,7 @@ class SessionDependencies { }; HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { - return new HttpNetworkSession(NULL, - session_deps->host_resolver, + return new HttpNetworkSession(session_deps->host_resolver, session_deps->proxy_service, &session_deps->socket_factory, session_deps->ssl_config_service, diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index c7e2e79..3374a2e 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,17 +14,14 @@ static const size_t kMaxSessionsPerDomain = 1; int SpdySessionPool::g_max_sessions_per_domain = kMaxSessionsPerDomain; -SpdySessionPool::SpdySessionPool(NetworkChangeNotifier* notifier) - : network_change_notifier_(notifier) { - if (network_change_notifier_) - network_change_notifier_->AddObserver(this); +SpdySessionPool::SpdySessionPool() { + NetworkChangeNotifier::AddObserver(this); } SpdySessionPool::~SpdySessionPool() { CloseAllSessions(); - if (network_change_notifier_) - network_change_notifier_->RemoveObserver(this); + NetworkChangeNotifier::RemoveObserver(this); } scoped_refptr<SpdySession> SpdySessionPool::Get( @@ -85,6 +82,10 @@ void SpdySessionPool::Remove(const scoped_refptr<SpdySession>& session) { RemoveSessionList(session->host_port_pair()); } +void SpdySessionPool::OnIPAddressChanged() { + ClearSessions(); +} + SpdySessionPool::SpdySessionList* SpdySessionPool::AddSessionList(const HostPortPair& host_port_pair) { DCHECK(sessions_.find(host_port_pair) == sessions_.end()); diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h index 08d01e0..3ea97f3 100644 --- a/net/spdy/spdy_session_pool.h +++ b/net/spdy/spdy_session_pool.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,7 +21,6 @@ namespace net { class BoundNetLog; class ClientSocketHandle; class HttpNetworkSession; -class NetworkChangeNotifier; class SpdySession; // This is a very simple pool for open SpdySessions. @@ -30,7 +29,7 @@ class SpdySessionPool : public base::RefCounted<SpdySessionPool>, public NetworkChangeNotifier::Observer { public: - explicit SpdySessionPool(NetworkChangeNotifier* notifier); + SpdySessionPool(); // Either returns an existing SpdySession or creates a new SpdySession for // use. @@ -72,7 +71,7 @@ class SpdySessionPool // We flush all idle sessions and release references to the active ones so // they won't get re-used. The active ones will either complete successfully // or error out due to the IP address change. - virtual void OnIPAddressChanged() { ClearSessions(); } + virtual void OnIPAddressChanged(); private: friend class base::RefCounted<SpdySessionPool>; @@ -100,8 +99,6 @@ class SpdySessionPool // This is our weak session pool - one session per domain. SpdySessionsMap sessions_; - NetworkChangeNotifier* const network_change_notifier_; - static int g_max_sessions_per_domain; DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index 67dcb94..20b73d9 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,7 +41,7 @@ class SessionDependencies { : host_resolver(new MockHostResolver), proxy_service(ProxyService::CreateNull()), ssl_config_service(new SSLConfigServiceDefaults), - spdy_session_pool(new SpdySessionPool(NULL)) { + spdy_session_pool(new SpdySessionPool()) { } scoped_refptr<MockHostResolverBase> host_resolver; @@ -52,8 +52,7 @@ class SessionDependencies { }; HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { - return new HttpNetworkSession(NULL, - session_deps->host_resolver, + return new HttpNetworkSession(session_deps->host_resolver, session_deps->proxy_service, &session_deps->socket_factory, session_deps->ssl_config_service, |