| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/sync_driver/glue/sync_backend_host_impl.h" | 5 #include "components/sync_driver/glue/sync_backend_host_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 if (cl->HasSwitch(switches::kSyncEnableGetUpdateAvoidance)) { | 110 if (cl->HasSwitch(switches::kSyncEnableGetUpdateAvoidance)) { |
| 111 factory_switches.pre_commit_updates_policy = | 111 factory_switches.pre_commit_updates_policy = |
| 112 InternalComponentsFactory::FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE; | 112 InternalComponentsFactory::FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE; |
| 113 } | 113 } |
| 114 syncer::PassphraseTransitionClearDataOption clear_data_option = | 114 syncer::PassphraseTransitionClearDataOption clear_data_option = |
| 115 syncer::PASSPHRASE_TRANSITION_DO_NOT_CLEAR_DATA; | 115 syncer::PASSPHRASE_TRANSITION_DO_NOT_CLEAR_DATA; |
| 116 if (cl->HasSwitch(switches::kSyncEnableClearDataOnPassphraseEncryption)) | 116 if (cl->HasSwitch(switches::kSyncEnableClearDataOnPassphraseEncryption)) |
| 117 clear_data_option = syncer::PASSPHRASE_TRANSITION_CLEAR_DATA; | 117 clear_data_option = syncer::PASSPHRASE_TRANSITION_CLEAR_DATA; |
| 118 | 118 |
| 119 std::map<syncer::ModelType, int64> invalidation_versions; | 119 std::map<syncer::ModelType, int64_t> invalidation_versions; |
| 120 sync_prefs_->GetInvalidationVersions(&invalidation_versions); | 120 sync_prefs_->GetInvalidationVersions(&invalidation_versions); |
| 121 | 121 |
| 122 scoped_ptr<DoInitializeOptions> init_opts(new DoInitializeOptions( | 122 scoped_ptr<DoInitializeOptions> init_opts(new DoInitializeOptions( |
| 123 registrar_->sync_thread()->message_loop(), registrar_.get(), routing_info, | 123 registrar_->sync_thread()->message_loop(), registrar_.get(), routing_info, |
| 124 workers, sync_client_->GetExtensionsActivity(), event_handler, | 124 workers, sync_client_->GetExtensionsActivity(), event_handler, |
| 125 sync_service_url, sync_user_agent, | 125 sync_service_url, sync_user_agent, |
| 126 http_post_provider_factory_getter.Run( | 126 http_post_provider_factory_getter.Run( |
| 127 core_->GetRequestContextCancelationSignal()), | 127 core_->GetRequestContextCancelationSignal()), |
| 128 credentials, invalidator_ ? invalidator_->GetInvalidatorClientId() : "", | 128 credentials, invalidator_ ? invalidator_->GetInvalidatorClientId() : "", |
| 129 sync_manager_factory.Pass(), delete_sync_data_folder, | 129 sync_manager_factory.Pass(), delete_sync_data_folder, |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 | 821 |
| 822 void SyncBackendHostImpl::HandleDirectoryStatusCountersUpdatedOnFrontendLoop( | 822 void SyncBackendHostImpl::HandleDirectoryStatusCountersUpdatedOnFrontendLoop( |
| 823 syncer::ModelType type, | 823 syncer::ModelType type, |
| 824 const syncer::StatusCounters& counters) { | 824 const syncer::StatusCounters& counters) { |
| 825 if (!frontend_) | 825 if (!frontend_) |
| 826 return; | 826 return; |
| 827 frontend_->OnDirectoryTypeStatusCounterUpdated(type, counters); | 827 frontend_->OnDirectoryTypeStatusCounterUpdated(type, counters); |
| 828 } | 828 } |
| 829 | 829 |
| 830 void SyncBackendHostImpl::UpdateInvalidationVersions( | 830 void SyncBackendHostImpl::UpdateInvalidationVersions( |
| 831 const std::map<syncer::ModelType, int64>& invalidation_versions) { | 831 const std::map<syncer::ModelType, int64_t>& invalidation_versions) { |
| 832 sync_prefs_->UpdateInvalidationVersions(invalidation_versions); | 832 sync_prefs_->UpdateInvalidationVersions(invalidation_versions); |
| 833 } | 833 } |
| 834 | 834 |
| 835 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { | 835 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { |
| 836 return registrar_->sync_thread()->message_loop(); | 836 return registrar_->sync_thread()->message_loop(); |
| 837 } | 837 } |
| 838 | 838 |
| 839 void SyncBackendHostImpl::RefreshTypesForTest(syncer::ModelTypeSet types) { | 839 void SyncBackendHostImpl::RefreshTypesForTest(syncer::ModelTypeSet types) { |
| 840 DCHECK(ui_thread_->BelongsToCurrentThread()); | 840 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 841 | 841 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 856 const syncer::SyncManager::ClearServerDataCallback& frontend_callback) { | 856 const syncer::SyncManager::ClearServerDataCallback& frontend_callback) { |
| 857 DCHECK(ui_thread_->BelongsToCurrentThread()); | 857 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 858 frontend_callback.Run(); | 858 frontend_callback.Run(); |
| 859 } | 859 } |
| 860 | 860 |
| 861 } // namespace browser_sync | 861 } // namespace browser_sync |
| 862 | 862 |
| 863 #undef SDVLOG | 863 #undef SDVLOG |
| 864 | 864 |
| 865 #undef SLOG | 865 #undef SLOG |
| OLD | NEW |