| 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/sync/engine_impl/sync_manager_impl.h" | 5 #include "components/sync/engine_impl/sync_manager_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "components/sync/engine/configure_reason.h" | 27 #include "components/sync/engine/configure_reason.h" |
| 28 #include "components/sync/engine/engine_components_factory.h" | 28 #include "components/sync/engine/engine_components_factory.h" |
| 29 #include "components/sync/engine/engine_util.h" | 29 #include "components/sync/engine/engine_util.h" |
| 30 #include "components/sync/engine/net/http_post_provider_factory.h" | 30 #include "components/sync/engine/net/http_post_provider_factory.h" |
| 31 #include "components/sync/engine/polling_constants.h" | 31 #include "components/sync/engine/polling_constants.h" |
| 32 #include "components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h" | 32 #include "components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h" |
| 33 #include "components/sync/engine_impl/model_type_connector_proxy.h" | 33 #include "components/sync/engine_impl/model_type_connector_proxy.h" |
| 34 #include "components/sync/engine_impl/net/sync_server_connection_manager.h" | 34 #include "components/sync/engine_impl/net/sync_server_connection_manager.h" |
| 35 #include "components/sync/engine_impl/sync_scheduler.h" | 35 #include "components/sync/engine_impl/sync_scheduler.h" |
| 36 #include "components/sync/engine_impl/syncer_types.h" | 36 #include "components/sync/engine_impl/syncer_types.h" |
| 37 #include "components/sync/engine_impl/uss_migrator.h" |
| 37 #include "components/sync/protocol/proto_value_conversions.h" | 38 #include "components/sync/protocol/proto_value_conversions.h" |
| 38 #include "components/sync/protocol/sync.pb.h" | 39 #include "components/sync/protocol/sync.pb.h" |
| 39 #include "components/sync/syncable/base_node.h" | 40 #include "components/sync/syncable/base_node.h" |
| 40 #include "components/sync/syncable/directory.h" | 41 #include "components/sync/syncable/directory.h" |
| 41 #include "components/sync/syncable/entry.h" | 42 #include "components/sync/syncable/entry.h" |
| 42 #include "components/sync/syncable/in_memory_directory_backing_store.h" | 43 #include "components/sync/syncable/in_memory_directory_backing_store.h" |
| 43 #include "components/sync/syncable/on_disk_directory_backing_store.h" | 44 #include "components/sync/syncable/on_disk_directory_backing_store.h" |
| 44 #include "components/sync/syncable/read_node.h" | 45 #include "components/sync/syncable/read_node.h" |
| 45 #include "components/sync/syncable/read_transaction.h" | 46 #include "components/sync/syncable/read_transaction.h" |
| 46 #include "components/sync/syncable/write_node.h" | 47 #include "components/sync/syncable/write_node.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 connection_manager_->set_client_id(directory()->cache_guid()); | 290 connection_manager_->set_client_id(directory()->cache_guid()); |
| 290 connection_manager_->AddListener(this); | 291 connection_manager_->AddListener(this); |
| 291 | 292 |
| 292 std::string sync_id = directory()->cache_guid(); | 293 std::string sync_id = directory()->cache_guid(); |
| 293 | 294 |
| 294 DVLOG(1) << "Setting sync client ID: " << sync_id; | 295 DVLOG(1) << "Setting sync client ID: " << sync_id; |
| 295 allstatus_.SetSyncId(sync_id); | 296 allstatus_.SetSyncId(sync_id); |
| 296 DVLOG(1) << "Setting invalidator client ID: " << args->invalidator_client_id; | 297 DVLOG(1) << "Setting invalidator client ID: " << args->invalidator_client_id; |
| 297 allstatus_.SetInvalidatorClientId(args->invalidator_client_id); | 298 allstatus_.SetInvalidatorClientId(args->invalidator_client_id); |
| 298 | 299 |
| 299 model_type_registry_ = | 300 // TODO(crbug.com/658002): Pass in the real USS migrator function once initial |
| 300 base::MakeUnique<ModelTypeRegistry>(args->workers, directory(), this); | 301 // GetUpdates issues are addressed. |
| 302 model_type_registry_ = base::MakeUnique<ModelTypeRegistry>( |
| 303 args->workers, &share_, this, UssMigrator()); |
| 301 sync_encryption_handler_->AddObserver(model_type_registry_.get()); | 304 sync_encryption_handler_->AddObserver(model_type_registry_.get()); |
| 302 | 305 |
| 303 // Build a SyncCycleContext and store the worker in it. | 306 // Build a SyncCycleContext and store the worker in it. |
| 304 DVLOG(1) << "Sync is bringing up SyncCycleContext."; | 307 DVLOG(1) << "Sync is bringing up SyncCycleContext."; |
| 305 std::vector<SyncEngineEventListener*> listeners; | 308 std::vector<SyncEngineEventListener*> listeners; |
| 306 listeners.push_back(&allstatus_); | 309 listeners.push_back(&allstatus_); |
| 307 listeners.push_back(this); | 310 listeners.push_back(this); |
| 308 cycle_context_ = args->engine_components_factory->BuildContext( | 311 cycle_context_ = args->engine_components_factory->BuildContext( |
| 309 connection_manager_.get(), directory(), args->extensions_activity, | 312 connection_manager_.get(), directory(), args->extensions_activity, |
| 310 listeners, &debug_info_event_listener_, model_type_registry_.get(), | 313 listeners, &debug_info_event_listener_, model_type_registry_.get(), |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 } | 998 } |
| 996 | 999 |
| 997 void SyncManagerImpl::OnCookieJarChanged(bool account_mismatch, | 1000 void SyncManagerImpl::OnCookieJarChanged(bool account_mismatch, |
| 998 bool empty_jar) { | 1001 bool empty_jar) { |
| 999 DCHECK(thread_checker_.CalledOnValidThread()); | 1002 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1000 cycle_context_->set_cookie_jar_mismatch(account_mismatch); | 1003 cycle_context_->set_cookie_jar_mismatch(account_mismatch); |
| 1001 cycle_context_->set_cookie_jar_empty(empty_jar); | 1004 cycle_context_->set_cookie_jar_empty(empty_jar); |
| 1002 } | 1005 } |
| 1003 | 1006 |
| 1004 } // namespace syncer | 1007 } // namespace syncer |
| OLD | NEW |