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

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

Issue 280983002: Implement sync in the NonBlockingTypeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gyp error and some tests Created 6 years, 7 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
« no previous file with comments | « sync/internal_api/sync_core.h ('k') | sync/internal_api/sync_core_proxy_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/internal_api/sync_core.h" 5 #include "sync/internal_api/sync_core.h"
6 6
7 #include "sync/engine/non_blocking_type_processor_core.h" 7 #include "sync/engine/non_blocking_type_processor_core.h"
8 #include "sync/sessions/model_type_registry.h" 8 #include "sync/sessions/model_type_registry.h"
9 9
10 namespace syncer { 10 namespace syncer {
11 11
12 SyncCore::SyncCore(ModelTypeRegistry* model_type_registry) 12 SyncCore::SyncCore(ModelTypeRegistry* model_type_registry)
13 : model_type_registry_(model_type_registry), weak_ptr_factory_(this) {} 13 : model_type_registry_(model_type_registry), weak_ptr_factory_(this) {}
14 14
15 SyncCore::~SyncCore() {} 15 SyncCore::~SyncCore() {}
16 16
17 void SyncCore::ConnectSyncTypeToCore( 17 void SyncCore::ConnectSyncTypeToCore(
18 ModelType type, 18 ModelType type,
19 const DataTypeState& data_type_state,
19 scoped_refptr<base::SequencedTaskRunner> task_runner, 20 scoped_refptr<base::SequencedTaskRunner> task_runner,
20 base::WeakPtr<NonBlockingTypeProcessor> processor) { 21 base::WeakPtr<NonBlockingTypeProcessor> processor) {
21
22 // Initialize the processor's sync-thread sibling and the 22 // Initialize the processor's sync-thread sibling and the
23 // processor <-> processor_core (ie. model thread <-> sync thread) 23 // processor <-> processor_core (ie. model thread <-> sync thread)
24 // communication channel. 24 // communication channel.
25 model_type_registry_->InitializeNonBlockingType(type, task_runner, processor); 25 model_type_registry_->InitializeNonBlockingType(
26 type, data_type_state, task_runner, processor);
26 } 27 }
27 28
28 void SyncCore::Disconnect(ModelType type) { 29 void SyncCore::Disconnect(ModelType type) {
29 model_type_registry_->RemoveNonBlockingType(type); 30 model_type_registry_->RemoveNonBlockingType(type);
30 } 31 }
31 32
32 base::WeakPtr<SyncCore> SyncCore::AsWeakPtr() { 33 base::WeakPtr<SyncCore> SyncCore::AsWeakPtr() {
33 return weak_ptr_factory_.GetWeakPtr(); 34 return weak_ptr_factory_.GetWeakPtr();
34 } 35 }
35 36
36 } // namespace syncer 37 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_core.h ('k') | sync/internal_api/sync_core_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698