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.
5 #include "sync/internal_api/sync_core_proxy_impl.h"
8 #include "base/location.h"
9 #include "base/message_loop/message_loop_proxy.h"
10 #include "sync/internal_api/sync_core.h"
14 SyncCoreProxyImpl::SyncCoreProxyImpl(
15 scoped_refptr<base::SequencedTaskRunner> sync_task_runner,
16 base::WeakPtr<SyncCore> sync_core)
17 : sync_task_runner_(sync_task_runner),
18 sync_core_(sync_core) {}
20 SyncCoreProxyImpl::~SyncCoreProxyImpl() {}
22 void SyncCoreProxyImpl::ConnectTypeToCore(
24 base::WeakPtr<NonBlockingTypeProcessor> type_processor) {
25 VLOG(1) << "ConnectTypeToCore: " << ModelTypeToString(type);
26 sync_task_runner_->PostTask(
28 base::Bind(&SyncCore::ConnectSyncTypeToCore,
31 base::MessageLoopProxy::current(),
35 scoped_ptr<SyncCoreProxy> SyncCoreProxyImpl::Clone() const {
36 return scoped_ptr<SyncCoreProxy>(
37 new SyncCoreProxyImpl(sync_task_runner_, sync_core_));