| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/sync/core/model_type_processor_proxy.h" | |
| 6 | |
| 7 #include <utility> | |
| 8 | |
| 9 #include "base/bind.h" | |
| 10 #include "base/location.h" | |
| 11 #include "components/sync/engine/commit_queue.h" | |
| 12 | |
| 13 namespace syncer { | |
| 14 | |
| 15 ModelTypeProcessorProxy::ModelTypeProcessorProxy( | |
| 16 const base::WeakPtr<ModelTypeProcessor>& processor, | |
| 17 const scoped_refptr<base::SequencedTaskRunner>& task_runner) | |
| 18 : processor_(processor), task_runner_(task_runner) {} | |
| 19 | |
| 20 ModelTypeProcessorProxy::~ModelTypeProcessorProxy() {} | |
| 21 | |
| 22 void ModelTypeProcessorProxy::ConnectSync(std::unique_ptr<CommitQueue> worker) { | |
| 23 task_runner_->PostTask( | |
| 24 FROM_HERE, base::Bind(&ModelTypeProcessor::ConnectSync, processor_, | |
| 25 base::Passed(std::move(worker)))); | |
| 26 } | |
| 27 | |
| 28 void ModelTypeProcessorProxy::DisconnectSync() { | |
| 29 task_runner_->PostTask( | |
| 30 FROM_HERE, base::Bind(&ModelTypeProcessor::DisconnectSync, processor_)); | |
| 31 } | |
| 32 | |
| 33 void ModelTypeProcessorProxy::OnCommitCompleted( | |
| 34 const sync_pb::ModelTypeState& type_state, | |
| 35 const CommitResponseDataList& response_list) { | |
| 36 task_runner_->PostTask( | |
| 37 FROM_HERE, base::Bind(&ModelTypeProcessor::OnCommitCompleted, processor_, | |
| 38 type_state, response_list)); | |
| 39 } | |
| 40 | |
| 41 void ModelTypeProcessorProxy::OnUpdateReceived( | |
| 42 const sync_pb::ModelTypeState& type_state, | |
| 43 const UpdateResponseDataList& updates) { | |
| 44 task_runner_->PostTask( | |
| 45 FROM_HERE, base::Bind(&ModelTypeProcessor::OnUpdateReceived, processor_, | |
| 46 type_state, updates)); | |
| 47 } | |
| 48 | |
| 49 } // namespace syncer | |
| OLD | NEW |