| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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_impl/model_type_connector_proxy.h" | |
| 6 | |
| 7 #include "base/bind.h" | |
| 8 #include "base/location.h" | |
| 9 #include "base/single_thread_task_runner.h" | |
| 10 #include "components/sync/core/activation_context.h" | |
| 11 | |
| 12 namespace syncer { | |
| 13 | |
| 14 ModelTypeConnectorProxy::ModelTypeConnectorProxy( | |
| 15 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | |
| 16 const base::WeakPtr<ModelTypeConnector>& model_type_connector) | |
| 17 : task_runner_(task_runner), model_type_connector_(model_type_connector) {} | |
| 18 | |
| 19 ModelTypeConnectorProxy::~ModelTypeConnectorProxy() {} | |
| 20 | |
| 21 void ModelTypeConnectorProxy::ConnectType( | |
| 22 ModelType type, | |
| 23 std::unique_ptr<ActivationContext> activation_context) { | |
| 24 task_runner_->PostTask( | |
| 25 FROM_HERE, | |
| 26 base::Bind(&ModelTypeConnector::ConnectType, model_type_connector_, type, | |
| 27 base::Passed(&activation_context))); | |
| 28 } | |
| 29 | |
| 30 void ModelTypeConnectorProxy::DisconnectType(ModelType type) { | |
| 31 task_runner_->PostTask(FROM_HERE, | |
| 32 base::Bind(&ModelTypeConnector::DisconnectType, | |
| 33 model_type_connector_, type)); | |
| 34 } | |
| 35 | |
| 36 } // namespace syncer | |
| OLD | NEW |