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

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: Addressed CR feedback 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
« no previous file with comments | « sync/sessions/model_type_registry.h ('k') | sync/sessions/model_type_registry_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9c1609a61c6cc45c1daef2f2764a4b221d08ae91 100644
--- a/sync/sessions/model_type_registry.cc
+++ b/sync/sessions/model_type_registry.cc
@@ -13,7 +13,7 @@
#include "sync/engine/model_type_processor.h"
#include "sync/engine/model_type_processor_impl.h"
#include "sync/engine/model_type_worker.h"
-#include "sync/internal_api/public/non_blocking_sync_common.h"
+#include "sync/internal_api/public/activation_context.h"
#include "sync/sessions/directory_type_debug_info_emitter.h"
#include "sync/util/cryptographer.h"
@@ -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());
« no previous file with comments | « sync/sessions/model_type_registry.h ('k') | sync/sessions/model_type_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698