diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 22:41:47 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 22:41:47 +0000 |
commit | 6531594abea873c883782041fea5d126507497e1 (patch) | |
tree | 017227faab41fb16f84a2485ec9b03d3f783d132 /net/base/network_change_notifier_linux.h | |
parent | 60a782e6a5a80fbba8fe690f05502147ae998d8c (diff) | |
download | chromium_src-6531594abea873c883782041fea5d126507497e1.zip chromium_src-6531594abea873c883782041fea5d126507497e1.tar.gz chromium_src-6531594abea873c883782041fea5d126507497e1.tar.bz2 |
Switch NetworkChangeNotifier implementations to use ObserverList.
Fix up observer list so we can use FOR_EACH_OBSERVER when check_empty is set.
Clean up the ObserverList API a bit, replacing GetElementAt() with HasObserver() and Clear().
BUG=36590
Review URL: http://codereview.chromium.org/652205
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/network_change_notifier_linux.h')
-rw-r--r-- | net/base/network_change_notifier_linux.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/base/network_change_notifier_linux.h b/net/base/network_change_notifier_linux.h index 323ea55..91d73e8 100644 --- a/net/base/network_change_notifier_linux.h +++ b/net/base/network_change_notifier_linux.h @@ -7,7 +7,8 @@ #include "base/basictypes.h" #include "base/message_loop.h" -#include "net/base/network_change_notifier_helper.h" +#include "base/observer_list.h" +#include "net/base/network_change_notifier.h" namespace net { @@ -19,11 +20,11 @@ class NetworkChangeNotifierLinux // NetworkChangeNotifier methods: virtual void AddObserver(Observer* observer) { - helper_.AddObserver(observer); + observers_.AddObserver(observer); } virtual void RemoveObserver(Observer* observer) { - helper_.RemoveObserver(observer); + observers_.RemoveObserver(observer); } // MessageLoopForIO::Watcher methods: @@ -46,7 +47,7 @@ class NetworkChangeNotifierLinux // Handles the netlink message and notifies the observers. void HandleNotifications(const char* buf, size_t len); - internal::NetworkChangeNotifierHelper helper_; + ObserverList<Observer, true> observers_; int netlink_fd_; // This is the netlink socket descriptor. MessageLoopForIO* const loop_; |