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

Unified Diff: chrome/browser/chromeos/web_socket_proxy_controller.cc

Issue 7969009: Removed chromeos::NetworkStateNotifier and redirected all related code to use (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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/browser/chromeos/web_socket_proxy_controller.cc
===================================================================
--- chrome/browser/chromeos/web_socket_proxy_controller.cc (revision 101752)
+++ chrome/browser/chromeos/web_socket_proxy_controller.cc (working copy)
@@ -26,6 +26,7 @@
#include "content/common/notification_service.h"
#include "content/common/url_constants.h"
#include "googleurl/src/gurl.h"
+#include "net/base/network_change_notifier.h"
namespace {
@@ -102,20 +103,21 @@
virtual void Run() OVERRIDE;
};
-class ProxyLifetime : public NotificationObserver {
+class ProxyLifetime : public net::NetworkChangeNotifier::OnlineStateObserver {
public:
ProxyLifetime() : delay_ms_(1000), shutdown_requested_(false) {
BrowserThread::PostTask(
BrowserThread::WEB_SOCKET_PROXY, FROM_HERE, new ProxyTask());
- registrar_.Add(this, chrome::NOTIFICATION_NETWORK_STATE_CHANGED,
- NotificationService::AllSources());
+ net::NetworkChangeNotifier::AddOnlineStateObserver(this);
}
+ virtual ~ProxyLifetime() {
+ net::NetworkChangeNotifier::RemoveOnlineStateObserver(this);
+ }
+
private:
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- DCHECK_EQ(type, chrome::NOTIFICATION_NETWORK_STATE_CHANGED);
+ // net::NetworkChangeNotifier::OnlineStateObserver overrides.
+ virtual void OnOnlineStateChanged(bool online) OVERRIDE {
DCHECK(chromeos::WebSocketProxyController::IsInitiated());
base::AutoLock alk(lock_);
if (server_)

Powered by Google App Engine
This is Rietveld 408576698