| 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 "components/browser_sync/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "components/strings/grit/components_strings.h" | 39 #include "components/strings/grit/components_strings.h" |
| 40 #include "components/sync/base/bind_to_task_runner.h" | 40 #include "components/sync/base/bind_to_task_runner.h" |
| 41 #include "components/sync/base/cryptographer.h" | 41 #include "components/sync/base/cryptographer.h" |
| 42 #include "components/sync/base/passphrase_type.h" | 42 #include "components/sync/base/passphrase_type.h" |
| 43 #include "components/sync/base/pref_names.h" | 43 #include "components/sync/base/pref_names.h" |
| 44 #include "components/sync/base/report_unrecoverable_error.h" | 44 #include "components/sync/base/report_unrecoverable_error.h" |
| 45 #include "components/sync/base/stop_source.h" | 45 #include "components/sync/base/stop_source.h" |
| 46 #include "components/sync/base/sync_db_util.h" | 46 #include "components/sync/base/sync_db_util.h" |
| 47 #include "components/sync/base/system_encryptor.h" | 47 #include "components/sync/base/system_encryptor.h" |
| 48 #include "components/sync/core/configure_reason.h" | 48 #include "components/sync/core/configure_reason.h" |
| 49 #include "components/sync/core/shared_model_type_processor.h" | |
| 50 #include "components/sync/core/sync_encryption_handler.h" | 49 #include "components/sync/core/sync_encryption_handler.h" |
| 51 #include "components/sync/device_info/device_info.h" | 50 #include "components/sync/device_info/device_info.h" |
| 52 #include "components/sync/device_info/device_info_service.h" | 51 #include "components/sync/device_info/device_info_service.h" |
| 53 #include "components/sync/device_info/device_info_sync_service.h" | 52 #include "components/sync/device_info/device_info_sync_service.h" |
| 54 #include "components/sync/device_info/device_info_tracker.h" | 53 #include "components/sync/device_info/device_info_tracker.h" |
| 55 #include "components/sync/driver/backend_migrator.h" | 54 #include "components/sync/driver/backend_migrator.h" |
| 56 #include "components/sync/driver/change_processor.h" | 55 #include "components/sync/driver/change_processor.h" |
| 57 #include "components/sync/driver/directory_data_type_controller.h" | 56 #include "components/sync/driver/directory_data_type_controller.h" |
| 58 #include "components/sync/driver/glue/sync_backend_host_impl.h" | 57 #include "components/sync/driver/glue/sync_backend_host_impl.h" |
| 59 #include "components/sync/driver/signin_manager_wrapper.h" | 58 #include "components/sync/driver/signin_manager_wrapper.h" |
| 60 #include "components/sync/driver/sync_api_component_factory.h" | 59 #include "components/sync/driver/sync_api_component_factory.h" |
| 61 #include "components/sync/driver/sync_driver_switches.h" | 60 #include "components/sync/driver/sync_driver_switches.h" |
| 62 #include "components/sync/driver/sync_error_controller.h" | 61 #include "components/sync/driver/sync_error_controller.h" |
| 63 #include "components/sync/driver/sync_type_preference_provider.h" | 62 #include "components/sync/driver/sync_type_preference_provider.h" |
| 64 #include "components/sync/driver/sync_util.h" | 63 #include "components/sync/driver/sync_util.h" |
| 65 #include "components/sync/driver/user_selectable_sync_type.h" | 64 #include "components/sync/driver/user_selectable_sync_type.h" |
| 66 #include "components/sync/engine/cycle/model_neutral_state.h" | 65 #include "components/sync/engine/cycle/model_neutral_state.h" |
| 67 #include "components/sync/engine/cycle/type_debug_info_observer.h" | 66 #include "components/sync/engine/cycle/type_debug_info_observer.h" |
| 68 #include "components/sync/engine/net/http_bridge_network_resources.h" | 67 #include "components/sync/engine/net/http_bridge_network_resources.h" |
| 69 #include "components/sync/engine/net/network_resources.h" | 68 #include "components/sync/engine/net/network_resources.h" |
| 70 #include "components/sync/engine/sync_string_conversions.h" | 69 #include "components/sync/engine/sync_string_conversions.h" |
| 71 #include "components/sync/js/js_event_details.h" | 70 #include "components/sync/js/js_event_details.h" |
| 71 #include "components/sync/model/model_type_change_processor.h" |
| 72 #include "components/sync/model/model_type_store.h" | 72 #include "components/sync/model/model_type_store.h" |
| 73 #include "components/sync/model/sync_error.h" | 73 #include "components/sync/model/sync_error.h" |
| 74 #include "components/sync/protocol/sync.pb.h" | 74 #include "components/sync/protocol/sync.pb.h" |
| 75 #include "components/sync/syncable/directory.h" | 75 #include "components/sync/syncable/directory.h" |
| 76 #include "components/sync/syncable/syncable_read_transaction.h" | 76 #include "components/sync/syncable/syncable_read_transaction.h" |
| 77 #include "components/sync_sessions/favicon_cache.h" | 77 #include "components/sync_sessions/favicon_cache.h" |
| 78 #include "components/sync_sessions/session_data_type_controller.h" | 78 #include "components/sync_sessions/session_data_type_controller.h" |
| 79 #include "components/sync_sessions/sessions_sync_manager.h" | 79 #include "components/sync_sessions/sessions_sync_manager.h" |
| 80 #include "components/sync_sessions/sync_sessions_client.h" | 80 #include "components/sync_sessions/sync_sessions_client.h" |
| 81 #include "components/syncable_prefs/pref_service_syncable.h" | 81 #include "components/syncable_prefs/pref_service_syncable.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 96 using syncer::DataTypeManager; | 96 using syncer::DataTypeManager; |
| 97 using syncer::DataTypeStatusTable; | 97 using syncer::DataTypeStatusTable; |
| 98 using syncer::DeviceInfoService; | 98 using syncer::DeviceInfoService; |
| 99 using syncer::DeviceInfoSyncService; | 99 using syncer::DeviceInfoSyncService; |
| 100 using syncer::JsBackend; | 100 using syncer::JsBackend; |
| 101 using syncer::JsController; | 101 using syncer::JsController; |
| 102 using syncer::JsEventDetails; | 102 using syncer::JsEventDetails; |
| 103 using syncer::JsEventHandler; | 103 using syncer::JsEventHandler; |
| 104 using syncer::ModelSafeRoutingInfo; | 104 using syncer::ModelSafeRoutingInfo; |
| 105 using syncer::ModelType; | 105 using syncer::ModelType; |
| 106 using syncer::ModelTypeChangeProcessor; |
| 106 using syncer::ModelTypeSet; | 107 using syncer::ModelTypeSet; |
| 107 using syncer::ModelTypeStore; | 108 using syncer::ModelTypeStore; |
| 108 using syncer::ProtocolEventObserver; | 109 using syncer::ProtocolEventObserver; |
| 109 using syncer::SharedModelTypeProcessor; | |
| 110 using syncer::SyncBackendHost; | 110 using syncer::SyncBackendHost; |
| 111 using syncer::SyncCredentials; | 111 using syncer::SyncCredentials; |
| 112 using syncer::SyncProtocolError; | 112 using syncer::SyncProtocolError; |
| 113 using syncer::WeakHandle; | 113 using syncer::WeakHandle; |
| 114 | 114 |
| 115 namespace browser_sync { | 115 namespace browser_sync { |
| 116 | 116 |
| 117 typedef GoogleServiceAuthError AuthError; | 117 typedef GoogleServiceAuthError AuthError; |
| 118 | 118 |
| 119 const char kSyncUnrecoverableErrorHistogram[] = "Sync.UnrecoverableErrors"; | 119 const char kSyncUnrecoverableErrorHistogram[] = "Sync.UnrecoverableErrors"; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 291 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 292 // TODO(skym): Stop creating leveldb files when signed out. | 292 // TODO(skym): Stop creating leveldb files when signed out. |
| 293 // TODO(skym): Verify using AsUTF8Unsafe is okay here. Should work as long | 293 // TODO(skym): Verify using AsUTF8Unsafe is okay here. Should work as long |
| 294 // as the Local State file is guaranteed to be UTF-8. | 294 // as the Local State file is guaranteed to be UTF-8. |
| 295 device_info_service_.reset(new DeviceInfoService( | 295 device_info_service_.reset(new DeviceInfoService( |
| 296 local_device_.get(), | 296 local_device_.get(), |
| 297 base::Bind(&ModelTypeStore::CreateStore, syncer::DEVICE_INFO, | 297 base::Bind(&ModelTypeStore::CreateStore, syncer::DEVICE_INFO, |
| 298 directory_path_.Append(base::FilePath(kLevelDBFolderName)) | 298 directory_path_.Append(base::FilePath(kLevelDBFolderName)) |
| 299 .AsUTF8Unsafe(), | 299 .AsUTF8Unsafe(), |
| 300 blocking_task_runner), | 300 blocking_task_runner), |
| 301 base::Bind(&SharedModelTypeProcessor::CreateAsChangeProcessor))); | 301 base::Bind(&ModelTypeChangeProcessor::Create))); |
| 302 } else { | 302 } else { |
| 303 device_info_sync_service_.reset( | 303 device_info_sync_service_.reset( |
| 304 new DeviceInfoSyncService(local_device_.get())); | 304 new DeviceInfoSyncService(local_device_.get())); |
| 305 } | 305 } |
| 306 | 306 |
| 307 syncer::SyncApiComponentFactory::RegisterDataTypesMethod | 307 syncer::SyncApiComponentFactory::RegisterDataTypesMethod |
| 308 register_platform_types_callback = | 308 register_platform_types_callback = |
| 309 sync_client_->GetRegisterPlatformTypesCallback(); | 309 sync_client_->GetRegisterPlatformTypesCallback(); |
| 310 sync_client_->GetSyncApiComponentFactory()->RegisterDataTypes( | 310 sync_client_->GetSyncApiComponentFactory()->RegisterDataTypes( |
| 311 this, register_platform_types_callback); | 311 this, register_platform_types_callback); |
| (...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 | 2498 |
| 2499 DCHECK(startup_controller_->IsSetupInProgress()); | 2499 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2500 startup_controller_->SetSetupInProgress(false); | 2500 startup_controller_->SetSetupInProgress(false); |
| 2501 | 2501 |
| 2502 if (IsBackendInitialized()) | 2502 if (IsBackendInitialized()) |
| 2503 ReconfigureDatatypeManager(); | 2503 ReconfigureDatatypeManager(); |
| 2504 NotifyObservers(); | 2504 NotifyObservers(); |
| 2505 } | 2505 } |
| 2506 | 2506 |
| 2507 } // namespace browser_sync | 2507 } // namespace browser_sync |
| OLD | NEW |