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_service.h" | 16 #include "sync/api/attachments/attachment_service.h" |
17 #include "sync/api/attachments/attachment_service_proxy.h" | 17 #include "sync/api/attachments/attachment_service_proxy.h" |
18 #include "sync/api/sync_change_processor.h" | 18 #include "sync/api/sync_change_processor.h" |
19 #include "sync/api/sync_merge_result.h" | 19 #include "sync/api/sync_merge_result.h" |
20 | 20 |
21 namespace syncer { | 21 namespace syncer { |
22 class SyncData; | 22 class SyncData; |
23 class SyncableService; | 23 class SyncableService; |
24 class WriteNode; | 24 class WriteNode; |
25 class WriteTransaction; | 25 class WriteTransaction; |
26 | 26 |
27 typedef std::vector<syncer::SyncData> SyncDataList; | 27 typedef std::vector<syncer::SyncData> SyncDataList; |
28 } // namespace syncer | 28 } // namespace syncer |
29 | 29 |
30 namespace browser_sync { | 30 namespace sync_driver { |
31 class SyncApiComponentFactory; | 31 class SyncApiComponentFactory; |
32 | 32 |
33 // Datatype agnostic change processor. One instance of GenericChangeProcessor | 33 // Datatype agnostic change processor. One instance of GenericChangeProcessor |
34 // is created for each datatype and lives on the datatype's thread. It then | 34 // is created for each datatype and lives on the datatype's thread. It then |
35 // handles all interaction with the sync api, both translating pushes from the | 35 // handles all interaction with the sync api, both translating pushes from the |
36 // local service into transactions and receiving changes from the sync model, | 36 // local service into transactions and receiving changes from the sync model, |
37 // which then get converted into SyncChange's and sent to the local service. | 37 // which then get converted into SyncChange's and sent to the local service. |
38 // | 38 // |
39 // As a rule, the GenericChangeProcessor is not thread safe, and should only | 39 // As a rule, the GenericChangeProcessor is not thread safe, and should only |
40 // be used on the same thread in which it was created. | 40 // be used on the same thread in which it was created. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 scoped_ptr<syncer::AttachmentService> attachment_service_; | 151 scoped_ptr<syncer::AttachmentService> attachment_service_; |
152 // Must be destroyed before attachment_service_ to ensure WeakPtrs are | 152 // Must be destroyed before attachment_service_ to ensure WeakPtrs are |
153 // invalidated before attachment_service_ is destroyed. | 153 // invalidated before attachment_service_ is destroyed. |
154 base::WeakPtrFactory<syncer::AttachmentService> | 154 base::WeakPtrFactory<syncer::AttachmentService> |
155 attachment_service_weak_ptr_factory_; | 155 attachment_service_weak_ptr_factory_; |
156 syncer::AttachmentServiceProxy attachment_service_proxy_; | 156 syncer::AttachmentServiceProxy attachment_service_proxy_; |
157 | 157 |
158 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); | 158 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); |
159 }; | 159 }; |
160 | 160 |
161 } // namespace browser_sync | 161 } // namespace sync_driver |
162 | 162 |
163 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 163 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
OLD | NEW |