| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sync/internal_api/sync_manager_impl.h" | 5 #include "sync/internal_api/sync_manager_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 if (marker.token().empty()) | 299 if (marker.token().empty()) |
| 300 result.Put(i.Get()); | 300 result.Put(i.Get()); |
| 301 | 301 |
| 302 } | 302 } |
| 303 return result; | 303 return result; |
| 304 } | 304 } |
| 305 | 305 |
| 306 void SyncManagerImpl::ConfigureSyncer( | 306 void SyncManagerImpl::ConfigureSyncer( |
| 307 ConfigureReason reason, | 307 ConfigureReason reason, |
| 308 const ModelTypeSet& types_to_config, | 308 ModelTypeSet types_to_config, |
| 309 const ModelSafeRoutingInfo& new_routing_info, | 309 const ModelSafeRoutingInfo& new_routing_info, |
| 310 const base::Closure& ready_task, | 310 const base::Closure& ready_task, |
| 311 const base::Closure& retry_task) { | 311 const base::Closure& retry_task) { |
| 312 DCHECK(thread_checker_.CalledOnValidThread()); | 312 DCHECK(thread_checker_.CalledOnValidThread()); |
| 313 DCHECK(!ready_task.is_null()); | 313 DCHECK(!ready_task.is_null()); |
| 314 DCHECK(!retry_task.is_null()); | 314 DCHECK(!retry_task.is_null()); |
| 315 | 315 |
| 316 // Cleanup any types that might have just been disabled. | 316 // Cleanup any types that might have just been disabled. |
| 317 ModelTypeSet previous_types = ModelTypeSet::All(); | 317 ModelTypeSet previous_types = ModelTypeSet::All(); |
| 318 if (!session_context_->routing_info().empty()) | 318 if (!session_context_->routing_info().empty()) |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 DCHECK(!credentials.sync_token.empty()); | 644 DCHECK(!credentials.sync_token.empty()); |
| 645 | 645 |
| 646 observing_ip_address_changes_ = true; | 646 observing_ip_address_changes_ = true; |
| 647 if (!connection_manager_->set_auth_token(credentials.sync_token)) | 647 if (!connection_manager_->set_auth_token(credentials.sync_token)) |
| 648 return; // Auth token is known to be invalid, so exit early. | 648 return; // Auth token is known to be invalid, so exit early. |
| 649 | 649 |
| 650 invalidator_->UpdateCredentials(credentials.email, credentials.sync_token); | 650 invalidator_->UpdateCredentials(credentials.email, credentials.sync_token); |
| 651 scheduler_->OnCredentialsUpdated(); | 651 scheduler_->OnCredentialsUpdated(); |
| 652 } | 652 } |
| 653 | 653 |
| 654 void SyncManagerImpl::UpdateEnabledTypes( | 654 void SyncManagerImpl::UpdateEnabledTypes(ModelTypeSet enabled_types) { |
| 655 const ModelTypeSet& enabled_types) { | |
| 656 DCHECK(thread_checker_.CalledOnValidThread()); | 655 DCHECK(thread_checker_.CalledOnValidThread()); |
| 657 DCHECK(initialized_); | 656 DCHECK(initialized_); |
| 658 invalidator_->UpdateRegisteredIds( | 657 invalidator_->UpdateRegisteredIds( |
| 659 this, | 658 this, |
| 660 ModelTypeSetToObjectIdSet(enabled_types)); | 659 ModelTypeSetToObjectIdSet(enabled_types)); |
| 661 } | 660 } |
| 662 | 661 |
| 663 void SyncManagerImpl::RegisterInvalidationHandler( | 662 void SyncManagerImpl::RegisterInvalidationHandler( |
| 664 InvalidationHandler* handler) { | 663 InvalidationHandler* handler) { |
| 665 DCHECK(thread_checker_.CalledOnValidThread()); | 664 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1356 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1358 return kDefaultNudgeDelayMilliseconds; | 1357 return kDefaultNudgeDelayMilliseconds; |
| 1359 } | 1358 } |
| 1360 | 1359 |
| 1361 // static. | 1360 // static. |
| 1362 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1361 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1363 return kPreferencesNudgeDelayMilliseconds; | 1362 return kPreferencesNudgeDelayMilliseconds; |
| 1364 } | 1363 } |
| 1365 | 1364 |
| 1366 } // namespace syncer | 1365 } // namespace syncer |
| OLD | NEW |