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

Side by Side Diff: sync/internal_api/sync_context.cc

Issue 351523003: sync: Mass rename of non-blocking sync classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some comments 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 "sync/internal_api/sync_context.h"
6
7 #include "sync/engine/model_type_sync_worker_impl.h"
8 #include "sync/sessions/model_type_registry.h"
9
10 namespace syncer {
11
12 SyncContext::SyncContext(ModelTypeRegistry* model_type_registry)
13 : model_type_registry_(model_type_registry), weak_ptr_factory_(this) {
14 }
15
16 SyncContext::~SyncContext() {
17 }
18
19 void SyncContext::ConnectSyncTypeToWorker(
20 ModelType type,
21 const DataTypeState& data_type_state,
22 scoped_refptr<base::SequencedTaskRunner> task_runner,
23 base::WeakPtr<ModelTypeSyncProxyImpl> type_sync_proxy) {
24 // Initialize the type sync proxy's sync-thread sibling and the
25 // ModelTypeSyncProxy <-> ModelTypeSyncWorker
26 // (ie. model thread <-> sync thread) communication channel.
27 model_type_registry_->InitializeNonBlockingType(
28 type, data_type_state, task_runner, type_sync_proxy);
29 }
30
31 void SyncContext::Disconnect(ModelType type) {
32 model_type_registry_->RemoveNonBlockingType(type);
33 }
34
35 base::WeakPtr<SyncContext> SyncContext::AsWeakPtr() {
36 return weak_ptr_factory_.GetWeakPtr();
37 }
38
39 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698