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

Unified Diff: sync/sessions/model_type_registry.cc

Issue 1368683003: USS SyncContextProxy / data type activation refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: sync/sessions/model_type_registry.cc
diff --git a/sync/sessions/model_type_registry.cc b/sync/sessions/model_type_registry.cc
index f0375f7b2092858dd20f0b0449c155b43f6b345c..3d47b6db698ff4175fe7fc41373efbcef21796c0 100644
--- a/sync/sessions/model_type_registry.cc
+++ b/sync/sessions/model_type_registry.cc
@@ -188,30 +188,30 @@ void ModelTypeRegistry::SetEnabledDirectoryTypes(
void ModelTypeRegistry::ConnectSyncTypeToWorker(
ModelType type,
- const syncer_v2::DataTypeState& data_type_state,
- const syncer_v2::UpdateResponseDataList& saved_pending_updates,
- const scoped_refptr<base::SequencedTaskRunner>& type_task_runner,
- const base::WeakPtr<syncer_v2::ModelTypeProcessor>& type_processor) {
+ scoped_ptr<syncer_v2::ActivationContext> activation_context) {
DVLOG(1) << "Enabling an off-thread sync type: " << ModelTypeToString(type);
// Initialize Worker -> Processor communication channel.
scoped_ptr<syncer_v2::ModelTypeProcessor> processor_proxy(
- new ModelTypeProcessorProxy(type_processor, type_task_runner));
+ new ModelTypeProcessorProxy(activation_context->type_processor,
+ activation_context->type_task_runner));
scoped_ptr<Cryptographer> cryptographer_copy;
if (encrypted_types_.Has(type))
cryptographer_copy.reset(new Cryptographer(*cryptographer_));
scoped_ptr<syncer_v2::ModelTypeWorker> worker(new syncer_v2::ModelTypeWorker(
- type, data_type_state, saved_pending_updates, cryptographer_copy.Pass(),
+ type, activation_context->data_type_state,
+ activation_context->saved_pending_updates, cryptographer_copy.Pass(),
nudge_handler_, processor_proxy.Pass()));
// Initialize Processor -> Worker communication channel.
scoped_ptr<syncer_v2::CommitQueue> commit_queue_proxy(new CommitQueueProxy(
worker->AsWeakPtr(), scoped_refptr<base::SequencedTaskRunner>(
base::ThreadTaskRunnerHandle::Get())));
- type_task_runner->PostTask(
+ activation_context->type_task_runner->PostTask(
FROM_HERE, base::Bind(&syncer_v2::ModelTypeProcessor::OnConnect,
- type_processor, base::Passed(&commit_queue_proxy)));
+ activation_context->type_processor,
+ base::Passed(&commit_queue_proxy)));
DCHECK(update_handler_map_.find(type) == update_handler_map_.end());
DCHECK(commit_contributor_map_.find(type) == commit_contributor_map_.end());

Powered by Google App Engine
This is Rietveld 408576698