summaryrefslogtreecommitdiffstats
path: root/net/base/network_change_notifier_win.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 22:53:51 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 22:53:51 +0000
commit6f0479fa6d498b8ba48c8b7cbcd507534fda610e (patch)
treeccd432f1d28d3535ec23c9d6330afbaede7420b6 /net/base/network_change_notifier_win.h
parent9a0d91236e8557d37498f002254a6a5427ebf842 (diff)
downloadchromium_src-6f0479fa6d498b8ba48c8b7cbcd507534fda610e.zip
chromium_src-6f0479fa6d498b8ba48c8b7cbcd507534fda610e.tar.gz
chromium_src-6f0479fa6d498b8ba48c8b7cbcd507534fda610e.tar.bz2
Revert 39942 - 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 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/661029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39945 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/network_change_notifier_win.h')
-rw-r--r--net/base/network_change_notifier_win.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/net/base/network_change_notifier_win.h b/net/base/network_change_notifier_win.h
index 0f1f8d4..b11ec0d 100644
--- a/net/base/network_change_notifier_win.h
+++ b/net/base/network_change_notifier_win.h
@@ -7,8 +7,7 @@
#include "base/basictypes.h"
#include "base/object_watcher.h"
-#include "base/observer_list.h"
-#include "net/base/network_change_notifier.h"
+#include "net/base/network_change_notifier_helper.h"
namespace net {
@@ -17,19 +16,16 @@ class NetworkChangeNotifierWin : public NetworkChangeNotifier {
NetworkChangeNotifierWin();
// Called by NetworkChangeNotifierWin::Impl.
- void OnIPAddressChanged() {
- FOR_EACH_OBSERVER(Observer, observers_, OnIPAddressChanged());
- }
-
+ void OnIPAddressChanged() { helper_.OnIPAddressChanged(); }
// NetworkChangeNotifier methods:
virtual void AddObserver(Observer* observer) {
- observers_.AddObserver(observer);
+ helper_.AddObserver(observer);
}
virtual void RemoveObserver(Observer* observer) {
- observers_.RemoveObserver(observer);
+ helper_.RemoveObserver(observer);
}
private:
@@ -37,9 +33,7 @@ class NetworkChangeNotifierWin : public NetworkChangeNotifier {
virtual ~NetworkChangeNotifierWin();
- // 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_;
+ internal::NetworkChangeNotifierHelper helper_;
scoped_ptr<Impl> impl_;
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin);