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_SHARED_CHANGE_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_H_ |
6 #define COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // waiting for non-UI threads. | 46 // waiting for non-UI threads. |
47 // | 47 // |
48 // Note: since we control the work being done while holding the lock, we ensure | 48 // Note: since we control the work being done while holding the lock, we ensure |
49 // no I/O or other intensive work is done while blocking the UI thread (all | 49 // no I/O or other intensive work is done while blocking the UI thread (all |
50 // the work is in-memory sync interactions). | 50 // the work is in-memory sync interactions). |
51 // | 51 // |
52 // We use virtual methods so that we can use mock's in testing. | 52 // We use virtual methods so that we can use mock's in testing. |
53 class SharedChangeProcessor | 53 class SharedChangeProcessor |
54 : public base::RefCountedThreadSafe<SharedChangeProcessor> { | 54 : public base::RefCountedThreadSafe<SharedChangeProcessor> { |
55 public: | 55 public: |
56 typedef base::Callback<void(DataTypeController::ConfigureResult start_result, | 56 using StartDoneCallback = |
57 const SyncMergeResult& local_merge_result, | 57 base::Callback<void(DataTypeController::ConfigureResult start_result, |
58 const SyncMergeResult& syncer_merge_result)> | 58 const SyncMergeResult& local_merge_result, |
59 StartDoneCallback; | 59 const SyncMergeResult& syncer_merge_result)>; |
60 | 60 |
61 // Create an uninitialized SharedChangeProcessor. | 61 // Create an uninitialized SharedChangeProcessor. |
62 explicit SharedChangeProcessor(ModelType type); | 62 explicit SharedChangeProcessor(ModelType type); |
63 | 63 |
64 void StartAssociation(StartDoneCallback start_done, | 64 void StartAssociation(StartDoneCallback start_done, |
65 SyncClient* const sync_client, | 65 SyncClient* const sync_client, |
66 GenericChangeProcessorFactory* processor_factory, | 66 GenericChangeProcessorFactory* processor_factory, |
67 UserShare* user_share, | 67 UserShare* user_share, |
68 std::unique_ptr<DataTypeErrorHandler> error_handler); | 68 std::unique_ptr<DataTypeErrorHandler> error_handler); |
69 | 69 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // The local service for this type. Only set if the DTC for the type uses | 156 // The local service for this type. Only set if the DTC for the type uses |
157 // SharedChangeProcessor::StartAssociation(). | 157 // SharedChangeProcessor::StartAssociation(). |
158 base::WeakPtr<SyncableService> local_service_; | 158 base::WeakPtr<SyncableService> local_service_; |
159 | 159 |
160 DISALLOW_COPY_AND_ASSIGN(SharedChangeProcessor); | 160 DISALLOW_COPY_AND_ASSIGN(SharedChangeProcessor); |
161 }; | 161 }; |
162 | 162 |
163 } // namespace syncer | 163 } // namespace syncer |
164 | 164 |
165 #endif // COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_H_ | 165 #endif // COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_H_ |
OLD | NEW |