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

Unified Diff: components/sync/core/model_type_processor_proxy.cc

Issue 2384153004: [Sync] Merge NBDTC and subclasses into ModelTypeController. (Closed)
Patch Set: Fix bad rebase. Created 4 years, 2 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: components/sync/core/model_type_processor_proxy.cc
diff --git a/components/sync/core/model_type_processor_proxy.cc b/components/sync/core/model_type_processor_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..99cf7961841f3ae4c58f4955c3a13cf14f55c8b8
--- /dev/null
+++ b/components/sync/core/model_type_processor_proxy.cc
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync/core/model_type_processor_proxy.h"
+
+#include <utility>
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "components/sync/engine/commit_queue.h"
+
+namespace syncer {
+
+ModelTypeProcessorProxy::ModelTypeProcessorProxy(
+ const base::WeakPtr<ModelTypeProcessor>& processor,
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner)
+ : processor_(processor), task_runner_(task_runner) {}
+
+ModelTypeProcessorProxy::~ModelTypeProcessorProxy() {}
+
+void ModelTypeProcessorProxy::ConnectSync(std::unique_ptr<CommitQueue> worker) {
+ task_runner_->PostTask(
+ FROM_HERE, base::Bind(&ModelTypeProcessor::ConnectSync, processor_,
+ base::Passed(std::move(worker))));
+}
+
+void ModelTypeProcessorProxy::DisconnectSync() {
+ task_runner_->PostTask(
+ FROM_HERE, base::Bind(&ModelTypeProcessor::DisconnectSync, processor_));
+}
+
+void ModelTypeProcessorProxy::OnCommitCompleted(
+ const sync_pb::ModelTypeState& type_state,
+ const CommitResponseDataList& response_list) {
+ task_runner_->PostTask(
+ FROM_HERE, base::Bind(&ModelTypeProcessor::OnCommitCompleted, processor_,
+ type_state, response_list));
+}
+
+void ModelTypeProcessorProxy::OnUpdateReceived(
+ const sync_pb::ModelTypeState& type_state,
+ const UpdateResponseDataList& updates) {
+ task_runner_->PostTask(
+ FROM_HERE, base::Bind(&ModelTypeProcessor::OnUpdateReceived, processor_,
+ type_state, updates));
+}
+
+} // namespace syncer
« no previous file with comments | « components/sync/core/model_type_processor_proxy.h ('k') | components/sync/core/shared_model_type_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698