diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 00:24:51 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 00:24:51 +0000 |
commit | d13c32787737f1822202802f062c41c38b90e5f5 (patch) | |
tree | f616a6dcf08fee7cc6f5c023e53be4fa501e9ef2 /net/base/network_change_notifier.h | |
parent | 9becad4ad1adcd4e4339b45f8b90d299fd968a08 (diff) | |
download | chromium_src-d13c32787737f1822202802f062c41c38b90e5f5.zip chromium_src-d13c32787737f1822202802f062c41c38b90e5f5.tar.gz chromium_src-d13c32787737f1822202802f062c41c38b90e5f5.tar.bz2 |
Pass the NetworkChangeNotifier to HostResolver.
This requires the following refactors:
(1) NetworkChangeNotifier moves out of HttpNetworkSession into IOThread.
(2) HostResolver gets initialized with NetworkChangeNotifier.
(3) NetworkChangeNotifier needs to get passed into HttpCache and HttpNetworkSession (required updating a lot of files).
(4) NetworkChangeNotifier is no longer reference counted. It is owned by IOThread.
(5) IOThread gains a new struct: Globals. It can only be used on the io thread.
(6) ChromeURLRequestContextFactory uses IOThread::Globals to initialize ChromeURLRequest objects with the host resolver and network change notifier.
BUG=26159
Review URL: http://codereview.chromium.org/552117
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/network_change_notifier.h')
-rw-r--r-- | net/base/network_change_notifier.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h index d66830a..67d57ff 100644 --- a/net/base/network_change_notifier.h +++ b/net/base/network_change_notifier.h @@ -6,13 +6,13 @@ #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ #include "base/basictypes.h" -#include "base/ref_counted.h" +#include "base/non_thread_safe.h" namespace net { // NetworkChangeNotifier monitors the system for network changes, and notifies // observers on those events. -class NetworkChangeNotifier : public base::RefCounted<NetworkChangeNotifier> { +class NetworkChangeNotifier : public NonThreadSafe { public: class Observer { public: @@ -30,6 +30,7 @@ class NetworkChangeNotifier : public base::RefCounted<NetworkChangeNotifier> { }; NetworkChangeNotifier() {} + virtual ~NetworkChangeNotifier() {} // These functions add and remove observers to/from the NetworkChangeNotifier. // Each call to AddObserver() must be matched with a corresponding call to @@ -40,12 +41,7 @@ class NetworkChangeNotifier : public base::RefCounted<NetworkChangeNotifier> { virtual void RemoveObserver(Observer* observer) = 0; // This will create the platform specific default NetworkChangeNotifier. - static scoped_refptr<NetworkChangeNotifier> - CreateDefaultNetworkChangeNotifier(); - - protected: - friend class base::RefCounted<NetworkChangeNotifier>; - virtual ~NetworkChangeNotifier() {} + static NetworkChangeNotifier* CreateDefaultNetworkChangeNotifier(); private: DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |