Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3847)

Unified Diff: chrome/common/net/network_change_notifier_proxy.h

Issue 2802015: Massively simplify the NetworkChangeNotifier infrastructure:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/net/network_change_notifier_proxy.h
===================================================================
--- chrome/common/net/network_change_notifier_proxy.h (revision 50775)
+++ chrome/common/net/network_change_notifier_proxy.h (working copy)
@@ -1,70 +0,0 @@
-// 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.
-
-#ifndef CHROME_COMMON_NET_NETWORK_CHANGE_NOTIFIER_PROXY_H_
-#define CHROME_COMMON_NET_NETWORK_CHANGE_NOTIFIER_PROXY_H_
-
-// NetworkChangeNotifierProxy is a class that lets observers listen to
-// a NetworkChangeNotifier that lives on another thread.
-
-#include "base/basictypes.h"
-#include "base/non_thread_safe.h"
-#include "base/observer_list.h"
-#include "base/ref_counted.h"
-#include "net/base/network_change_notifier.h"
-
-class MessageLoop;
-
-namespace chrome_common_net {
-
-class NetworkChangeNotifierThread;
-class NetworkChangeObserverProxy;
-
-class NetworkChangeNotifierProxy : public net::NetworkChangeNotifier,
- public NonThreadSafe {
- public:
- // |source_thread| must be guaranteed to outlive the current thread.
- // Does not take ownership of any arguments.
- explicit NetworkChangeNotifierProxy(
- NetworkChangeNotifierThread* source_thread);
-
- virtual ~NetworkChangeNotifierProxy();
-
- // net::NetworkChangeNotifier implementation.
- virtual void AddObserver(net::NetworkChangeNotifier::Observer* observer);
- virtual void RemoveObserver(net::NetworkChangeNotifier::Observer* observer);
-
- private:
- typedef ObserverList<net::NetworkChangeNotifier::Observer, true>
- NetworkObserverList;
-
- // Utility class that routes received notifications to a list of
- // observers.
- class ObserverRepeater : public net::NetworkChangeNotifier::Observer,
- public NonThreadSafe {
- public:
- // Does not take ownership of the given observer list.
- explicit ObserverRepeater(NetworkObserverList* observers);
-
- virtual ~ObserverRepeater();
-
- // net::NetworkChangeNotifier::Observer implementation.
- virtual void OnIPAddressChanged();
-
- private:
- NetworkObserverList* observers_;
-
- DISALLOW_COPY_AND_ASSIGN(ObserverRepeater);
- };
-
- scoped_refptr<NetworkChangeObserverProxy> observer_proxy_;
- NetworkObserverList observers_;
- ObserverRepeater observer_repeater_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierProxy);
-};
-
-} // namespace chrome_common_net
-
-#endif // CHROME_COMMON_NET_NETWORK_CHANGE_NOTIFIER_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698