Chromium Code Reviews| 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(); |
| } |