OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SYNC_API_MODEL_TYPE_SERVICE_H_ | 5 #ifndef SYNC_API_MODEL_TYPE_SERVICE_H_ |
6 #define SYNC_API_MODEL_TYPE_SERVICE_H_ | 6 #define SYNC_API_MODEL_TYPE_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 // model type store. | 41 // model type store. |
42 virtual scoped_ptr<MetadataChangeList> CreateMetadataChangeList() = 0; | 42 virtual scoped_ptr<MetadataChangeList> CreateMetadataChangeList() = 0; |
43 | 43 |
44 // Perform the initial merge of data from the sync server. Should only need | 44 // Perform the initial merge of data from the sync server. Should only need |
45 // to be called when sync is first turned on, not on every restart. | 45 // to be called when sync is first turned on, not on every restart. |
46 virtual syncer::SyncError MergeSyncData( | 46 virtual syncer::SyncError MergeSyncData( |
47 scoped_ptr<MetadataChangeList> metadata_change_list, | 47 scoped_ptr<MetadataChangeList> metadata_change_list, |
48 EntityDataList entity_data_list) = 0; | 48 EntityDataList entity_data_list) = 0; |
49 | 49 |
50 // Apply changes from the sync server locally. | 50 // Apply changes from the sync server locally. |
| 51 // Please note that |entity_changes| might have fewer entries than |
| 52 // |metadata_change_list| in case when some of the data changes are filtered |
| 53 // out, or even be empty in case when a commit confirmation is processed and |
| 54 // only the metadata needs to persisted. |
51 virtual syncer::SyncError ApplySyncChanges( | 55 virtual syncer::SyncError ApplySyncChanges( |
52 scoped_ptr<MetadataChangeList> metadata_change_list, | 56 scoped_ptr<MetadataChangeList> metadata_change_list, |
53 EntityChangeList entity_changes) = 0; | 57 EntityChangeList entity_changes) = 0; |
54 | 58 |
55 // Asynchronously retrieve the sync metadata. | 59 // Asynchronously retrieve the sync metadata. |
56 virtual void LoadMetadata(MetadataCallback callback) = 0; | 60 virtual void LoadMetadata(MetadataCallback callback) = 0; |
57 | 61 |
58 // Asynchronously retrieve the corresponding sync data for |client_keys|. | 62 // Asynchronously retrieve the corresponding sync data for |client_keys|. |
59 virtual void GetData(ClientKeyList client_keys, DataCallback callback) = 0; | 63 virtual void GetData(ClientKeyList client_keys, DataCallback callback) = 0; |
60 | 64 |
(...skipping 12 matching lines...) Expand all Loading... |
73 void clear_change_processor(); | 77 void clear_change_processor(); |
74 | 78 |
75 private: | 79 private: |
76 // Recieves ownership in set_change_processor(...). | 80 // Recieves ownership in set_change_processor(...). |
77 scoped_ptr<syncer_v2::ModelTypeChangeProcessor> change_processor_; | 81 scoped_ptr<syncer_v2::ModelTypeChangeProcessor> change_processor_; |
78 }; | 82 }; |
79 | 83 |
80 } // namespace syncer_v2 | 84 } // namespace syncer_v2 |
81 | 85 |
82 #endif // SYNC_API_MODEL_TYPE_SERVICE_H_ | 86 #endif // SYNC_API_MODEL_TYPE_SERVICE_H_ |
OLD | NEW |