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

Unified Diff: sync/internal_api/sync_context_proxy_impl.cc

Issue 351523003: sync: Mass rename of non-blocking sync classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const ref some smart pointers Created 6 years, 6 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/internal_api/sync_context_proxy_impl.h ('k') | sync/internal_api/sync_context_proxy_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_context_proxy_impl.cc
diff --git a/sync/internal_api/sync_context_proxy_impl.cc b/sync/internal_api/sync_context_proxy_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..77f3d6ae6021ed450392756c155ab64a356907cc
--- /dev/null
+++ b/sync/internal_api/sync_context_proxy_impl.cc
@@ -0,0 +1,48 @@
+// Copyright 2014 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 "sync/internal_api/sync_context_proxy_impl.h"
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/message_loop/message_loop_proxy.h"
+#include "sync/engine/non_blocking_sync_common.h"
+#include "sync/internal_api/sync_context.h"
+
+namespace syncer {
+
+SyncContextProxyImpl::SyncContextProxyImpl(
+ const scoped_refptr<base::SequencedTaskRunner>& sync_task_runner,
+ const base::WeakPtr<SyncContext>& sync_context)
+ : sync_task_runner_(sync_task_runner), sync_context_(sync_context) {
+}
+
+SyncContextProxyImpl::~SyncContextProxyImpl() {
+}
+
+void SyncContextProxyImpl::ConnectTypeToSync(
+ ModelType type,
+ const DataTypeState& data_type_state,
+ const base::WeakPtr<ModelTypeSyncProxyImpl>& type_sync_proxy) {
+ VLOG(1) << "ConnectTypeToSync: " << ModelTypeToString(type);
+ sync_task_runner_->PostTask(FROM_HERE,
+ base::Bind(&SyncContext::ConnectSyncTypeToWorker,
+ sync_context_,
+ type,
+ data_type_state,
+ base::MessageLoopProxy::current(),
+ type_sync_proxy));
+}
+
+void SyncContextProxyImpl::Disconnect(ModelType type) {
+ sync_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&SyncContext::Disconnect, sync_context_, type));
+}
+
+scoped_ptr<SyncContextProxy> SyncContextProxyImpl::Clone() const {
+ return scoped_ptr<SyncContextProxy>(
+ new SyncContextProxyImpl(sync_task_runner_, sync_context_));
+}
+
+} // namespace syncer
« no previous file with comments | « sync/internal_api/sync_context_proxy_impl.h ('k') | sync/internal_api/sync_context_proxy_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698