From 66761b95332549f825999e482c17c94675275f49 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Fri, 25 Jun 2010 21:30:38 +0000 Subject: Massively simplify the NetworkChangeNotifier infrastructure: * Use a process-wide object (singleton pattern) * Create/destroy this object on the main thread, make it outlive all consumers * Make observer-related functions threadsafe As a result, the notifier can now be used by any thread (eliminating things like NetworkChangeObserverProxy and NetworkChangeNotifierProxy, and expanding its usefulness); its creation and inner workings are much simplified (eliminating implementation-specific classes); and it is simpler to access (eliminating things like NetworkChangeNotifierThread and a LOT of passing pointers around). BUG=none TEST=Unittests; network changes still trigger notifications Review URL: http://codereview.chromium.org/2802015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50895 0039d316-1c4b-4281-b951-d872f2087c98 --- net/spdy/spdy_session_pool.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'net/spdy/spdy_session_pool.h') 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, 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; @@ -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); -- cgit v1.1