diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 03:09:41 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 03:09:41 +0000 |
commit | 84aebedeaa91c3fadf523260c12afa136420c7d3 (patch) | |
tree | c5ca8ca0e7bd3f5dba957556cbb062851b4d7853 /net/base/network_change_notifier_win.h | |
parent | efeaf7e7f80c74b91aa87edbbb0ace868f3574a7 (diff) | |
download | chromium_src-84aebedeaa91c3fadf523260c12afa136420c7d3.zip chromium_src-84aebedeaa91c3fadf523260c12afa136420c7d3.tar.gz chromium_src-84aebedeaa91c3fadf523260c12afa136420c7d3.tar.bz2 |
Reland 39942 - Switch NetworkChangeNotifier implementations to use ObserverList.
Fixed build problem with database_tracker.(cc|h).
BUG=36590
Review URL: http://codereview.chromium.org/660039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/network_change_notifier_win.h')
-rw-r--r-- | net/base/network_change_notifier_win.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/net/base/network_change_notifier_win.h b/net/base/network_change_notifier_win.h index b11ec0d..0f1f8d4 100644 --- a/net/base/network_change_notifier_win.h +++ b/net/base/network_change_notifier_win.h @@ -7,7 +7,8 @@ #include "base/basictypes.h" #include "base/object_watcher.h" -#include "net/base/network_change_notifier_helper.h" +#include "base/observer_list.h" +#include "net/base/network_change_notifier.h" namespace net { @@ -16,16 +17,19 @@ class NetworkChangeNotifierWin : public NetworkChangeNotifier { NetworkChangeNotifierWin(); // Called by NetworkChangeNotifierWin::Impl. - void OnIPAddressChanged() { helper_.OnIPAddressChanged(); } + void OnIPAddressChanged() { + FOR_EACH_OBSERVER(Observer, observers_, OnIPAddressChanged()); + } + // NetworkChangeNotifier methods: virtual void AddObserver(Observer* observer) { - helper_.AddObserver(observer); + observers_.AddObserver(observer); } virtual void RemoveObserver(Observer* observer) { - helper_.RemoveObserver(observer); + observers_.RemoveObserver(observer); } private: @@ -33,7 +37,9 @@ class NetworkChangeNotifierWin : public NetworkChangeNotifier { virtual ~NetworkChangeNotifierWin(); - internal::NetworkChangeNotifierHelper helper_; + // TODO(willchan): Fix the URLRequestContextGetter leaks and flip the false to + // true so we assert that all observers have been removed. + ObserverList<Observer, false> observers_; scoped_ptr<Impl> impl_; DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin); |