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

Unified Diff: sync/internal_api/sync_manager_impl.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: sync/internal_api/sync_manager_impl.cc
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 874444ba1b552a8ddff4779b8f9cb8734e4c1799..64c1f1992c42be234a41e8e4935807fb67a52188 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -454,8 +454,7 @@ void SyncManagerImpl::Init(
initialized_ = true;
- net::NetworkChangeNotifier::AddIPAddressObserver(this);
- net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
observing_network_connectivity_changes_ = true;
UpdateCredentials(credentials);
@@ -691,8 +690,7 @@ void SyncManagerImpl::ShutdownOnSyncThread() {
connection_manager_->RemoveListener(this);
connection_manager_.reset();
- net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
- net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
+ net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
observing_network_connectivity_changes_ = false;
if (initialized_ && directory()) {
@@ -711,22 +709,15 @@ void SyncManagerImpl::ShutdownOnSyncThread() {
weak_handle_this_.Reset();
}
-void SyncManagerImpl::OnIPAddressChanged() {
- if (!observing_network_connectivity_changes_) {
- DVLOG(1) << "IP address change dropped.";
+void SyncManagerImpl::OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) {
+ if (type == net::NetworkChangeNotifier::CONNECTION_NONE)
return;
szym 2013/01/20 06:52:08 It's not immediately apparent to me that scheduler
- }
- DVLOG(1) << "IP address change detected.";
- OnNetworkConnectivityChangedImpl();
-}
-
-void SyncManagerImpl::OnConnectionTypeChanged(
- net::NetworkChangeNotifier::ConnectionType) {
if (!observing_network_connectivity_changes_) {
- DVLOG(1) << "Connection type change dropped.";
+ DVLOG(1) << "Network change dropped.";
return;
}
- DVLOG(1) << "Connection type change detected.";
+ DVLOG(1) << "Network change detected.";
OnNetworkConnectivityChangedImpl();
}
« net/url_request/url_request_throttler_manager.h ('K') | « sync/internal_api/sync_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698