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/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
18 #include "components/sync/api/attachments/attachment_store.h" | 18 #include "components/sync/api/attachments/attachment_store.h" |
| 19 #include "components/sync/api/data_type_error_handler.h" |
19 #include "components/sync/api/sync_change_processor.h" | 20 #include "components/sync/api/sync_change_processor.h" |
20 #include "components/sync/api/sync_merge_result.h" | 21 #include "components/sync/api/sync_merge_result.h" |
21 #include "components/sync/core/attachments/attachment_service.h" | 22 #include "components/sync/core/attachments/attachment_service.h" |
22 #include "components/sync/core/attachments/attachment_service_proxy.h" | 23 #include "components/sync/core/attachments/attachment_service_proxy.h" |
23 #include "components/sync/driver/change_processor.h" | 24 #include "components/sync/driver/change_processor.h" |
24 | 25 |
25 namespace syncer { | 26 namespace syncer { |
26 class DataTypeErrorHandler; | |
27 class SyncData; | 27 class SyncData; |
28 class SyncableService; | 28 class SyncableService; |
29 class WriteNode; | 29 class WriteNode; |
30 class WriteTransaction; | 30 class WriteTransaction; |
31 | 31 |
32 typedef std::vector<syncer::SyncData> SyncDataList; | 32 typedef std::vector<syncer::SyncData> SyncDataList; |
33 } // namespace syncer | 33 } // namespace syncer |
34 | 34 |
35 namespace sync_driver { | 35 namespace sync_driver { |
36 | 36 |
(...skipping 11 matching lines...) Expand all Loading... |
48 class GenericChangeProcessor : public ChangeProcessor, | 48 class GenericChangeProcessor : public ChangeProcessor, |
49 public syncer::SyncChangeProcessor, | 49 public syncer::SyncChangeProcessor, |
50 public syncer::AttachmentService::Delegate, | 50 public syncer::AttachmentService::Delegate, |
51 public base::NonThreadSafe { | 51 public base::NonThreadSafe { |
52 public: | 52 public: |
53 // Create a change processor for |type| and connect it to the syncer. | 53 // Create a change processor for |type| and connect it to the syncer. |
54 // |attachment_store| can be NULL which means that datatype will not use sync | 54 // |attachment_store| can be NULL which means that datatype will not use sync |
55 // attachments. | 55 // attachments. |
56 GenericChangeProcessor( | 56 GenericChangeProcessor( |
57 syncer::ModelType type, | 57 syncer::ModelType type, |
58 syncer::DataTypeErrorHandler* error_handler, | 58 std::unique_ptr<syncer::DataTypeErrorHandler> error_handler, |
59 const base::WeakPtr<syncer::SyncableService>& local_service, | 59 const base::WeakPtr<syncer::SyncableService>& local_service, |
60 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, | 60 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, |
61 syncer::UserShare* user_share, | 61 syncer::UserShare* user_share, |
62 SyncClient* sync_client, | 62 SyncClient* sync_client, |
63 std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store); | 63 std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store); |
64 ~GenericChangeProcessor() override; | 64 ~GenericChangeProcessor() override; |
65 | 65 |
66 // ChangeProcessor interface. | 66 // ChangeProcessor interface. |
67 // Build and store a list of all changes into |syncer_changes_|. | 67 // Build and store a list of all changes into |syncer_changes_|. |
68 void ApplyChangesFromSyncModel( | 68 void ApplyChangesFromSyncModel( |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 attachment_service_weak_ptr_factory_; | 173 attachment_service_weak_ptr_factory_; |
174 syncer::AttachmentServiceProxy attachment_service_proxy_; | 174 syncer::AttachmentServiceProxy attachment_service_proxy_; |
175 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; | 175 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; |
176 | 176 |
177 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); | 177 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); |
178 }; | 178 }; |
179 | 179 |
180 } // namespace sync_driver | 180 } // namespace sync_driver |
181 | 181 |
182 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 182 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
OLD | NEW |