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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "components/sync_driver/change_processor.h" | 13 #include "components/sync_driver/change_processor.h" |
14 #include "components/sync_driver/data_type_controller.h" | 14 #include "components/sync_driver/data_type_controller.h" |
15 #include "components/sync_driver/data_type_error_handler.h" | 15 #include "components/sync_driver/data_type_error_handler.h" |
| 16 #include "sync/api/attachments/attachment_store.h" |
16 #include "sync/api/sync_change_processor.h" | 17 #include "sync/api/sync_change_processor.h" |
17 #include "sync/api/sync_merge_result.h" | 18 #include "sync/api/sync_merge_result.h" |
18 #include "sync/internal_api/public/attachments/attachment_service.h" | 19 #include "sync/internal_api/public/attachments/attachment_service.h" |
19 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" | 20 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" |
20 | 21 |
21 namespace syncer { | 22 namespace syncer { |
22 class SyncData; | 23 class SyncData; |
23 class SyncableService; | 24 class SyncableService; |
24 class WriteNode; | 25 class WriteNode; |
25 class WriteTransaction; | 26 class WriteTransaction; |
(...skipping 16 matching lines...) Expand all Loading... |
42 public syncer::SyncChangeProcessor, | 43 public syncer::SyncChangeProcessor, |
43 public syncer::AttachmentService::Delegate, | 44 public syncer::AttachmentService::Delegate, |
44 public base::NonThreadSafe { | 45 public base::NonThreadSafe { |
45 public: | 46 public: |
46 // Create a change processor and connect it to the syncer. | 47 // Create a change processor and connect it to the syncer. |
47 GenericChangeProcessor( | 48 GenericChangeProcessor( |
48 DataTypeErrorHandler* error_handler, | 49 DataTypeErrorHandler* error_handler, |
49 const base::WeakPtr<syncer::SyncableService>& local_service, | 50 const base::WeakPtr<syncer::SyncableService>& local_service, |
50 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, | 51 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, |
51 syncer::UserShare* user_share, | 52 syncer::UserShare* user_share, |
52 SyncApiComponentFactory* sync_factory); | 53 SyncApiComponentFactory* sync_factory, |
| 54 const scoped_refptr<syncer::AttachmentStore>& attachment_store); |
53 virtual ~GenericChangeProcessor(); | 55 virtual ~GenericChangeProcessor(); |
54 | 56 |
55 // ChangeProcessor interface. | 57 // ChangeProcessor interface. |
56 // Build and store a list of all changes into |syncer_changes_|. | 58 // Build and store a list of all changes into |syncer_changes_|. |
57 virtual void ApplyChangesFromSyncModel( | 59 virtual void ApplyChangesFromSyncModel( |
58 const syncer::BaseTransaction* trans, | 60 const syncer::BaseTransaction* trans, |
59 int64 version, | 61 int64 version, |
60 const syncer::ImmutableChangeRecordList& changes) OVERRIDE; | 62 const syncer::ImmutableChangeRecordList& changes) OVERRIDE; |
61 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto | 63 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto |
62 // |local_service_| by way of its ProcessSyncChanges method. | 64 // |local_service_| by way of its ProcessSyncChanges method. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 base::WeakPtrFactory<syncer::AttachmentService> | 156 base::WeakPtrFactory<syncer::AttachmentService> |
155 attachment_service_weak_ptr_factory_; | 157 attachment_service_weak_ptr_factory_; |
156 syncer::AttachmentServiceProxy attachment_service_proxy_; | 158 syncer::AttachmentServiceProxy attachment_service_proxy_; |
157 | 159 |
158 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); | 160 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); |
159 }; | 161 }; |
160 | 162 |
161 } // namespace sync_driver | 163 } // namespace sync_driver |
162 | 164 |
163 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 165 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
OLD | NEW |