Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Unified Diff: sync/internal_api/sync_manager_impl.cc

Issue 93433006: sync: Introduce ModelTypeRegistry and helpers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak in tests Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 12fd99170b3cccde66f91d23f3da8236a9635828..a10f8b4cc631e6dda780203acba5d2f532edb79d 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -423,11 +423,12 @@ void SyncManagerImpl::Init(
std::string sync_id = directory()->cache_guid();
+ DVLOG(1) << "Setting sync client ID: " << sync_id;
allstatus_.SetSyncId(sync_id);
+ DVLOG(1) << "Setting invalidator client ID: " << invalidator_client_id;
allstatus_.SetInvalidatorClientId(invalidator_client_id);
- DVLOG(1) << "Setting sync client ID: " << sync_id;
- DVLOG(1) << "Setting invalidator client ID: " << invalidator_client_id;
+ model_type_registry_.reset(new ModelTypeRegistry(workers, directory()));
// Build a SyncSessionContext and store the worker in it.
DVLOG(1) << "Sync is bringing up SyncSessionContext.";
@@ -437,11 +438,11 @@ void SyncManagerImpl::Init(
session_context_ = internal_components_factory->BuildContext(
connection_manager_.get(),
directory(),
- workers,
extensions_activity,
listeners,
&debug_info_event_listener_,
&traffic_recorder_,
+ model_type_registry_.get(),
invalidator_client_id).Pass();
session_context_->set_account_name(credentials.email);
scheduler_ = internal_components_factory->BuildScheduler(
@@ -526,7 +527,7 @@ void SyncManagerImpl::StartSyncingNormally(
// appropriately set and that it's only modified when switching to normal
// mode.
DCHECK(thread_checker_.CalledOnValidThread());
- session_context_->set_routing_info(routing_info);
+ session_context_->SetRoutingInfo(routing_info);
scheduler_->Start(SyncScheduler::NORMAL_MODE);
}
@@ -638,6 +639,7 @@ void SyncManagerImpl::ShutdownOnSyncThread() {
scheduler_.reset();
session_context_.reset();
+ model_type_registry_.reset();
if (sync_encryption_handler_) {
sync_encryption_handler_->RemoveObserver(&debug_info_event_listener_);
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698