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

Unified Diff: sync/engine/model_type_processor_impl.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/engine/model_type_processor_impl.cc
diff --git a/sync/engine/model_type_processor_impl.cc b/sync/engine/model_type_processor_impl.cc
index 55aa73b25cb3a8bd49074ecc497e140afc83a071..3883207eab323fbd2da6634207112d7c9f7e75f7 100644
--- a/sync/engine/model_type_processor_impl.cc
+++ b/sync/engine/model_type_processor_impl.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/thread_task_runner_handle.h"
#include "sync/engine/commit_queue.h"
#include "sync/engine/model_type_entity.h"
#include "sync/internal_api/public/sync_context_proxy.h"
@@ -52,13 +53,15 @@ void ModelTypeProcessorImpl::Enable(
data_type_state_.progress_marker.set_data_type_id(
GetSpecificsFieldNumberFromModelType(type_));
- UpdateResponseDataList saved_pending_updates = GetPendingUpdates();
+ ActivationContext* activation_context = new ActivationContext;
pavely 2015/09/25 18:22:38 Please change this to scoped_ptr<ActivationContext
stanisc 2015/09/26 00:16:01 Done.
+ activation_context->data_type_state = data_type_state_;
+ activation_context->saved_pending_updates = GetPendingUpdates();
+ activation_context->type_task_runner = base::ThreadTaskRunnerHandle::Get();
+ activation_context->type_processor = weak_ptr_factory_for_sync_.GetWeakPtr();
+
sync_context_proxy_ = sync_context_proxy.Pass();
- sync_context_proxy_->ConnectTypeToSync(
- GetModelType(),
- data_type_state_,
- saved_pending_updates,
- weak_ptr_factory_for_sync_.GetWeakPtr());
+ sync_context_proxy_->ConnectTypeToSync(GetModelType(),
+ make_scoped_ptr(activation_context));
}
void ModelTypeProcessorImpl::Disable() {

Powered by Google App Engine
This is Rietveld 408576698