OLD | NEW |
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 #ifndef SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ | 5 #ifndef SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
6 #define SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ | 6 #define SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "sync/base/sync_export.h" | 14 #include "sync/base/sync_export.h" |
15 #include "sync/engine/nudge_handler.h" | 15 #include "sync/engine/nudge_handler.h" |
16 #include "sync/internal_api/public/base/model_type.h" | 16 #include "sync/internal_api/public/base/model_type.h" |
17 #include "sync/internal_api/public/engine/model_safe_worker.h" | 17 #include "sync/internal_api/public/engine/model_safe_worker.h" |
18 #include "sync/internal_api/public/non_blocking_sync_common.h" | 18 #include "sync/internal_api/public/non_blocking_sync_common.h" |
19 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" | 19 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" |
20 #include "sync/internal_api/public/sync_context.h" | 20 #include "sync/internal_api/public/sync_context.h" |
21 #include "sync/internal_api/public/sync_encryption_handler.h" | 21 #include "sync/internal_api/public/sync_encryption_handler.h" |
22 | 22 |
23 namespace syncer_v2 { | 23 namespace syncer_v2 { |
24 struct DataTypeState; | 24 struct DataTypeState; |
25 class ModelTypeProcessorImpl; | 25 class ModelTypeProcessor; |
26 class ModelTypeWorker; | 26 class ModelTypeWorker; |
27 } | 27 } |
28 | 28 |
29 namespace syncer { | 29 namespace syncer { |
30 | 30 |
31 namespace syncable { | 31 namespace syncable { |
32 class Directory; | 32 class Directory; |
33 } // namespace syncable | 33 } // namespace syncable |
34 | 34 |
35 class CommitContributor; | 35 class CommitContributor; |
(...skipping 23 matching lines...) Expand all Loading... |
59 | 59 |
60 // Enables an off-thread type for syncing. Connects the given proxy | 60 // Enables an off-thread type for syncing. Connects the given proxy |
61 // and its task_runner to the newly created worker. | 61 // and its task_runner to the newly created worker. |
62 // | 62 // |
63 // Expects that the proxy's ModelType is not currently enabled. | 63 // Expects that the proxy's ModelType is not currently enabled. |
64 void ConnectSyncTypeToWorker( | 64 void ConnectSyncTypeToWorker( |
65 syncer::ModelType type, | 65 syncer::ModelType type, |
66 const syncer_v2::DataTypeState& data_type_state, | 66 const syncer_v2::DataTypeState& data_type_state, |
67 const syncer_v2::UpdateResponseDataList& saved_pending_updates, | 67 const syncer_v2::UpdateResponseDataList& saved_pending_updates, |
68 const scoped_refptr<base::SequencedTaskRunner>& type_task_runner, | 68 const scoped_refptr<base::SequencedTaskRunner>& type_task_runner, |
69 const base::WeakPtr<syncer_v2::ModelTypeProcessorImpl>& proxy) override; | 69 const base::WeakPtr<syncer_v2::ModelTypeProcessor>& type_processor) |
| 70 override; |
70 | 71 |
71 // Disables the syncing of an off-thread type. | 72 // Disables the syncing of an off-thread type. |
72 // | 73 // |
73 // Expects that the type is currently enabled. | 74 // Expects that the type is currently enabled. |
74 // Deletes the worker associated with the type. | 75 // Deletes the worker associated with the type. |
75 void DisconnectSyncWorker(syncer::ModelType type) override; | 76 void DisconnectSyncWorker(syncer::ModelType type) override; |
76 | 77 |
77 // Implementation of SyncEncryptionHandler::Observer. | 78 // Implementation of SyncEncryptionHandler::Observer. |
78 void OnPassphraseRequired( | 79 void OnPassphraseRequired( |
79 PassphraseRequiredReason reason, | 80 PassphraseRequiredReason reason, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 base::ObserverList<TypeDebugInfoObserver> type_debug_info_observers_; | 160 base::ObserverList<TypeDebugInfoObserver> type_debug_info_observers_; |
160 | 161 |
161 base::WeakPtrFactory<ModelTypeRegistry> weak_ptr_factory_; | 162 base::WeakPtrFactory<ModelTypeRegistry> weak_ptr_factory_; |
162 | 163 |
163 DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry); | 164 DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry); |
164 }; | 165 }; |
165 | 166 |
166 } // namespace syncer | 167 } // namespace syncer |
167 | 168 |
168 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ | 169 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
OLD | NEW |