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

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: 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/BUILD.gn ('k') | sync/engine/model_type_processor_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..94e5c6311afc5489eee8ffcf492d44fa63ed3b0f 100644
--- a/sync/engine/model_type_processor_impl.cc
+++ b/sync/engine/model_type_processor_impl.cc
@@ -6,8 +6,10 @@
#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/activation_context.h"
#include "sync/internal_api/public/sync_context_proxy.h"
#include "sync/syncable/syncable_util.h"
@@ -52,13 +54,16 @@ void ModelTypeProcessorImpl::Enable(
data_type_state_.progress_marker.set_data_type_id(
GetSpecificsFieldNumberFromModelType(type_));
- UpdateResponseDataList saved_pending_updates = GetPendingUpdates();
+ scoped_ptr<ActivationContext> activation_context =
+ make_scoped_ptr(new ActivationContext);
+ 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(),
+ activation_context.Pass());
}
void ModelTypeProcessorImpl::Disable() {
« no previous file with comments | « sync/BUILD.gn ('k') | sync/engine/model_type_processor_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698