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_FACTORY_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_FACTORY_H_ |
6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_FACTORY_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 | 9 |
10 namespace syncer { | 10 namespace syncer { |
11 class AttachmentService; | 11 class AttachmentService; |
12 class SyncableService; | 12 class SyncableService; |
13 class SyncMergeResult; | 13 class SyncMergeResult; |
14 struct UserShare; | 14 struct UserShare; |
15 } | 15 } |
16 | 16 |
17 namespace browser_sync { | 17 namespace browser_sync { |
18 | 18 |
19 class DataTypeErrorHandler; | 19 class DataTypeErrorHandler; |
20 class GenericChangeProcessor; | 20 class GenericChangeProcessor; |
21 class SyncApiComponentFactory; | |
21 | 22 |
22 // Because GenericChangeProcessors are created and used only from the model | 23 // Because GenericChangeProcessors are created and used only from the model |
23 // thread, their lifetime is strictly shorter than other components like | 24 // thread, their lifetime is strictly shorter than other components like |
24 // DataTypeController, which live before / after communication with model | 25 // DataTypeController, which live before / after communication with model |
25 // threads begins and ends. | 26 // threads begins and ends. |
26 // The GCP is created "on the fly" at just the right time, on just the right | 27 // The GCP is created "on the fly" at just the right time, on just the right |
27 // thread. Given that, we use a factory to instantiate GenericChangeProcessors | 28 // thread. Given that, we use a factory to instantiate GenericChangeProcessors |
28 // so that tests can choose to use a fake processor (i.e instead of injection). | 29 // so that tests can choose to use a fake processor (i.e instead of injection). |
29 class GenericChangeProcessorFactory { | 30 class GenericChangeProcessorFactory { |
30 public: | 31 public: |
31 GenericChangeProcessorFactory(); | 32 GenericChangeProcessorFactory(); |
32 virtual ~GenericChangeProcessorFactory(); | 33 virtual ~GenericChangeProcessorFactory(); |
33 virtual scoped_ptr<GenericChangeProcessor> CreateGenericChangeProcessor( | 34 virtual scoped_ptr<GenericChangeProcessor> CreateGenericChangeProcessor( |
34 syncer::UserShare* user_share, | 35 syncer::UserShare* user_share, |
35 browser_sync::DataTypeErrorHandler* error_handler, | 36 browser_sync::DataTypeErrorHandler* error_handler, |
36 const base::WeakPtr<syncer::SyncableService>& local_service, | 37 const base::WeakPtr<syncer::SyncableService>& local_service, |
37 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, | 38 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, |
38 scoped_ptr<syncer::AttachmentService> attachment_service); | 39 SyncApiComponentFactory* sync_factory); |
maniscalco
2014/05/15 20:09:28
Can you document the sync_factory parameter? I th
pavely
2014/05/16 00:19:10
Done.
| |
40 | |
39 private: | 41 private: |
40 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessorFactory); | 42 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessorFactory); |
41 }; | 43 }; |
42 | 44 |
43 } // namespace browser_sync | 45 } // namespace browser_sync |
44 | 46 |
45 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_FACTORY_H_ | 47 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_FACTORY_H_ |
OLD | NEW |