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

Unified Diff: components/google/core/browser/google_url_tracker.cc

Issue 512843002: Listen to OnNetworkChanged instead of OnIPAddressChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests Created 6 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
« no previous file with comments | « components/google/core/browser/google_url_tracker.h ('k') | net/base/network_change_notifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/google/core/browser/google_url_tracker.cc
diff --git a/components/google/core/browser/google_url_tracker.cc b/components/google/core/browser/google_url_tracker.cc
index 0864f6a73dabbb00eda6c5d0adc39e35ef8dae73..0c27a436064dc0050bae50bcae53e36dd2b9f6d0 100644
--- a/components/google/core/browser/google_url_tracker.cc
+++ b/components/google/core/browser/google_url_tracker.cc
@@ -39,7 +39,7 @@ GoogleURLTracker::GoogleURLTracker(scoped_ptr<GoogleURLTrackerClient> client,
need_to_prompt_(false),
search_committed_(false),
weak_ptr_factory_(this) {
- net::NetworkChangeNotifier::AddIPAddressObserver(this);
+ net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
client_->set_google_url_tracker(this);
// Because this function can be called during startup, when kicking off a URL
@@ -179,7 +179,11 @@ void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) {
}
}
-void GoogleURLTracker::OnIPAddressChanged() {
+void GoogleURLTracker::OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) {
+ // Ignore destructive signals.
+ if (type == net::NetworkChangeNotifier::CONNECTION_NONE)
+ return;
already_fetched_ = false;
StartFetchIfDesirable();
}
@@ -188,7 +192,7 @@ void GoogleURLTracker::Shutdown() {
client_.reset();
fetcher_.reset();
weak_ptr_factory_.InvalidateWeakPtrs();
- net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
+ net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
}
void GoogleURLTracker::DeleteMapEntryForManager(
« no previous file with comments | « components/google/core/browser/google_url_tracker.h ('k') | net/base/network_change_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698