summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/sync_context_proxy_impl.cc
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-25 05:52:32 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-25 05:52:32 +0000
commit973a446349b8b98f8ebb35da2ae204ee71047d0c (patch)
tree1893a2d9fef2d0023ec9a561d77911e7634f3cdb /sync/internal_api/sync_context_proxy_impl.cc
parent633a10a8162d96014ecb1ddcd01e1bb1e584d6c1 (diff)
downloadchromium_src-973a446349b8b98f8ebb35da2ae204ee71047d0c.zip
chromium_src-973a446349b8b98f8ebb35da2ae204ee71047d0c.tar.gz
chromium_src-973a446349b8b98f8ebb35da2ae204ee71047d0c.tar.bz2
sync: Mass rename of non-blocking sync classes
Renames many of the classes involved in non-blocking sync: - Renames SyncCore, SyncCoreProxy to SyncContext and SyncContextProxy. - Renames NonBlockingTypeProcessor and NonBlockingTypeProcessorInterface to ModelTypeSyncProxyImpl and ModelTypeSyncProxy, respectively. - Renames NonBlockingTypeProcessorCore and NonBlockingTypeProcessorCoreInterface to ModelTypeSyncWorkerImpl and ModelTypeSyncWorker, respectively. - Renames ModelThreadSyncEntity to ModelTypeEntity. - Renames SyncThreadSyncEntity to EntityTracker. Renames any Mock, Test, Wrapper, or Impl classes associated with the above, too. This is only the first part of the planned refactoring. The second part, which involves some changes to the inheritance hierarchy, will be implemented in a future CL. BUG=351005 Review URL: https://codereview.chromium.org/351523003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279618 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_context_proxy_impl.cc')
-rw-r--r--sync/internal_api/sync_context_proxy_impl.cc48
1 files changed, 48 insertions, 0 deletions
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 0000000..77f3d6a
--- /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