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

Unified Diff: chrome/browser/intranet_redirect_detector.cc

Issue 11620007: Switch from OnIPAddressChanged and OnConnectionTypeChange to OnNetworkChanged Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/intranet_redirect_detector.cc
diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc
index a2ae736a0113126e4a51f708843262e6c6d28f59..4c6911faa2b77c67a14e1189ffb76c9498df96bd 100644
--- a/chrome/browser/intranet_redirect_detector.cc
+++ b/chrome/browser/intranet_redirect_detector.cc
@@ -39,11 +39,11 @@ IntranetRedirectDetector::IntranetRedirectDetector()
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(kStartFetchDelaySeconds));
- net::NetworkChangeNotifier::AddIPAddressObserver(this);
+ net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
}
IntranetRedirectDetector::~IntranetRedirectDetector() {
- net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
+ net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
STLDeleteElements(&fetchers_);
}
@@ -143,7 +143,11 @@ void IntranetRedirectDetector::OnURLFetchComplete(
redirect_origin_.spec() : std::string());
}
-void IntranetRedirectDetector::OnIPAddressChanged() {
+void IntranetRedirectDetector::OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) {
+ // Wait until network is up.
+ if (type == net::NetworkChangeNotifier::CONNECTION_NONE)
+ return;
// If a request is already scheduled, do not scheduled yet another one.
if (in_sleep_)
return;

Powered by Google App Engine
This is Rietveld 408576698