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_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/sequence_checker.h" | 17 #include "base/sequence_checker.h" |
18 #include "components/sync/model/attachments/attachment_service.h" | 18 #include "components/sync/model/attachments/attachment_service.h" |
19 #include "components/sync/model/attachments/attachment_service_proxy.h" | 19 #include "components/sync/model/attachments/attachment_service_proxy.h" |
20 #include "components/sync/model/attachments/attachment_store.h" | 20 #include "components/sync/model/attachments/attachment_store.h" |
21 #include "components/sync/model/change_processor.h" | 21 #include "components/sync/model/change_processor.h" |
22 #include "components/sync/model/data_type_error_handler.h" | 22 #include "components/sync/model/data_type_error_handler.h" |
23 #include "components/sync/model/sync_change_processor.h" | 23 #include "components/sync/model/sync_change_processor.h" |
24 #include "components/sync/model/sync_merge_result.h" | 24 #include "components/sync/model/sync_merge_result.h" |
25 | 25 |
26 namespace syncer { | 26 namespace syncer { |
27 | 27 |
28 class SyncClient; | 28 class SyncApiComponentFactory; |
29 class SyncData; | 29 class SyncData; |
30 class SyncableService; | 30 class SyncableService; |
31 class WriteNode; | 31 class WriteNode; |
32 class WriteTransaction; | 32 class WriteTransaction; |
33 | 33 |
34 namespace syncable { | 34 namespace syncable { |
35 class Entry; | 35 class Entry; |
36 } // namespace syncable | 36 } // namespace syncable |
37 | 37 |
38 using SyncDataList = std::vector<SyncData>; | 38 using SyncDataList = std::vector<SyncData>; |
(...skipping 12 matching lines...) Expand all Loading... |
51 public: | 51 public: |
52 // Create a change processor for |type| and connect it to the syncer. | 52 // Create a change processor for |type| and connect it to the syncer. |
53 // |attachment_store| can be null which means that datatype will not use sync | 53 // |attachment_store| can be null which means that datatype will not use sync |
54 // attachments. | 54 // attachments. |
55 GenericChangeProcessor( | 55 GenericChangeProcessor( |
56 ModelType type, | 56 ModelType type, |
57 std::unique_ptr<DataTypeErrorHandler> error_handler, | 57 std::unique_ptr<DataTypeErrorHandler> error_handler, |
58 const base::WeakPtr<SyncableService>& local_service, | 58 const base::WeakPtr<SyncableService>& local_service, |
59 const base::WeakPtr<SyncMergeResult>& merge_result, | 59 const base::WeakPtr<SyncMergeResult>& merge_result, |
60 UserShare* user_share, | 60 UserShare* user_share, |
61 SyncClient* sync_client, | 61 SyncApiComponentFactory* driver_factory, |
62 std::unique_ptr<AttachmentStoreForSync> attachment_store); | 62 std::unique_ptr<AttachmentStoreForSync> attachment_store); |
63 ~GenericChangeProcessor() override; | 63 ~GenericChangeProcessor() override; |
64 | 64 |
65 // ChangeProcessor interface. | 65 // ChangeProcessor interface. |
66 // Build and store a list of all changes into |syncer_changes_|. | 66 // Build and store a list of all changes into |syncer_changes_|. |
67 void ApplyChangesFromSyncModel( | 67 void ApplyChangesFromSyncModel( |
68 const BaseTransaction* trans, | 68 const BaseTransaction* trans, |
69 int64_t version, | 69 int64_t version, |
70 const ImmutableChangeRecordList& changes) override; | 70 const ImmutableChangeRecordList& changes) override; |
71 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto | 71 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 attachment_service_weak_ptr_factory_; | 186 attachment_service_weak_ptr_factory_; |
187 AttachmentServiceProxy attachment_service_proxy_; | 187 AttachmentServiceProxy attachment_service_proxy_; |
188 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; | 188 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; |
189 | 189 |
190 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); | 190 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); |
191 }; | 191 }; |
192 | 192 |
193 } // namespace syncer | 193 } // namespace syncer |
194 | 194 |
195 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 195 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
OLD | NEW |