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 COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ |
6 #define COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 #include <unordered_set> | 11 #include <unordered_set> |
12 | 12 |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
15 #include "components/sync/base/model_type.h" | 15 #include "components/sync/base/model_type.h" |
16 #include "components/sync/engine/cycle/status_counters.h" | 16 #include "components/sync/engine/cycle/status_counters.h" |
17 #include "components/sync/engine/model_type_processor.h" | 17 #include "components/sync/engine/model_type_processor.h" |
18 #include "components/sync/engine/non_blocking_sync_common.h" | 18 #include "components/sync/engine/non_blocking_sync_common.h" |
19 #include "components/sync/model/data_batch.h" | 19 #include "components/sync/model/data_batch.h" |
20 #include "components/sync/model/data_type_error_handler.h" | 20 #include "components/sync/model/data_type_error_handler.h" |
21 #include "components/sync/model/metadata_batch.h" | 21 #include "components/sync/model/metadata_batch.h" |
22 #include "components/sync/model/metadata_change_list.h" | 22 #include "components/sync/model/metadata_change_list.h" |
23 #include "components/sync/model/model_type_change_processor.h" | 23 #include "components/sync/model/model_type_change_processor.h" |
24 #include "components/sync/model/model_type_sync_bridge.h" | 24 #include "components/sync/model/model_type_sync_bridge.h" |
25 #include "components/sync/model/sync_error.h" | 25 #include "components/sync/model/sync_error.h" |
26 #include "components/sync/protocol/model_type_state.pb.h" | 26 #include "components/sync/protocol/model_type_state.pb.h" |
27 #include "components/sync/protocol/sync.pb.h" | 27 #include "components/sync/protocol/sync.pb.h" |
28 | 28 |
29 namespace syncer { | 29 namespace syncer { |
30 struct ActivationContext; | |
31 class CommitQueue; | 30 class CommitQueue; |
32 class ProcessorEntityTracker; | 31 class ProcessorEntityTracker; |
33 | 32 |
34 // A sync component embedded on the synced type's thread that helps to handle | 33 // A sync component embedded on the synced type's thread that helps to handle |
35 // communication between sync and model type threads. | 34 // communication between sync and model type threads. |
36 class SharedModelTypeProcessor : public ModelTypeProcessor, | 35 class SharedModelTypeProcessor : public ModelTypeProcessor, |
37 public ModelTypeChangeProcessor, | 36 public ModelTypeChangeProcessor, |
38 base::NonThreadSafe { | 37 base::NonThreadSafe { |
39 public: | 38 public: |
40 SharedModelTypeProcessor(ModelType type, ModelTypeSyncBridge* bridge); | 39 SharedModelTypeProcessor(ModelType type, ModelTypeSyncBridge* bridge); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // OnSyncStarting has been called. This pointer is not owned. | 180 // OnSyncStarting has been called. This pointer is not owned. |
182 std::unique_ptr<DataTypeErrorHandler> error_handler_; | 181 std::unique_ptr<DataTypeErrorHandler> error_handler_; |
183 | 182 |
184 // WeakPtrFactory for this processor which will be sent to sync thread. | 183 // WeakPtrFactory for this processor which will be sent to sync thread. |
185 base::WeakPtrFactory<SharedModelTypeProcessor> weak_ptr_factory_; | 184 base::WeakPtrFactory<SharedModelTypeProcessor> weak_ptr_factory_; |
186 }; | 185 }; |
187 | 186 |
188 } // namespace syncer | 187 } // namespace syncer |
189 | 188 |
190 #endif // COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ | 189 #endif // COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ |
OLD | NEW |