| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SYNCABLE_SERVICE_H_ | 5 #ifndef SYNC_API_SYNCABLE_SERVICE_H_ |
| 6 #define SYNC_API_SYNCABLE_SERVICE_H_ | 6 #define SYNC_API_SYNCABLE_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Informs the service to begin syncing the specified synced datatype |type|. | 31 // Informs the service to begin syncing the specified synced datatype |type|. |
| 32 // The service should then merge |initial_sync_data| into it's local data, | 32 // The service should then merge |initial_sync_data| into it's local data, |
| 33 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the | 33 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the |
| 34 // two. After this, the SyncableService's local data should match the server | 34 // two. After this, the SyncableService's local data should match the server |
| 35 // data, and the service should be ready to receive and process any further | 35 // data, and the service should be ready to receive and process any further |
| 36 // SyncChange's as they occur. | 36 // SyncChange's as they occur. |
| 37 // Returns: A default SyncError (IsSet() == false) if no errors were | 37 // Returns: A default SyncError (IsSet() == false) if no errors were |
| 38 // encountered, and a filled SyncError (IsSet() == true) | 38 // encountered, and a filled SyncError (IsSet() == true) |
| 39 // otherwise. | 39 // otherwise. |
| 40 virtual SyncError MergeDataAndStartSyncing( | 40 virtual SyncError MergeDataAndStartSyncing( |
| 41 syncable::ModelType type, | 41 syncer::ModelType type, |
| 42 const SyncDataList& initial_sync_data, | 42 const SyncDataList& initial_sync_data, |
| 43 scoped_ptr<SyncChangeProcessor> sync_processor, | 43 scoped_ptr<SyncChangeProcessor> sync_processor, |
| 44 scoped_ptr<SyncErrorFactory> error_handler) = 0; | 44 scoped_ptr<SyncErrorFactory> error_handler) = 0; |
| 45 | 45 |
| 46 // Stop syncing the specified type and reset state. | 46 // Stop syncing the specified type and reset state. |
| 47 virtual void StopSyncing(syncable::ModelType type) = 0; | 47 virtual void StopSyncing(syncer::ModelType type) = 0; |
| 48 | 48 |
| 49 // Fills a list of SyncData from the local data. This should create an up | 49 // Fills a list of SyncData from the local data. This should create an up |
| 50 // to date representation of the SyncableService's view of that datatype, and | 50 // to date representation of the SyncableService's view of that datatype, and |
| 51 // should match/be a subset of the server's view of that datatype. | 51 // should match/be a subset of the server's view of that datatype. |
| 52 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const = 0; | 52 virtual SyncDataList GetAllSyncData(syncer::ModelType type) const = 0; |
| 53 | 53 |
| 54 // SyncChangeProcessor interface. | 54 // SyncChangeProcessor interface. |
| 55 // Process a list of new SyncChanges and update the local data as necessary. | 55 // Process a list of new SyncChanges and update the local data as necessary. |
| 56 // Returns: A default SyncError (IsSet() == false) if no errors were | 56 // Returns: A default SyncError (IsSet() == false) if no errors were |
| 57 // encountered, and a filled SyncError (IsSet() == true) | 57 // encountered, and a filled SyncError (IsSet() == true) |
| 58 // otherwise. | 58 // otherwise. |
| 59 virtual SyncError ProcessSyncChanges( | 59 virtual SyncError ProcessSyncChanges( |
| 60 const tracked_objects::Location& from_here, | 60 const tracked_objects::Location& from_here, |
| 61 const SyncChangeList& change_list) OVERRIDE = 0; | 61 const SyncChangeList& change_list) OVERRIDE = 0; |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 virtual ~SyncableService(); | 64 virtual ~SyncableService(); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace syncer | 67 } // namespace syncer |
| 68 | 68 |
| 69 #endif // SYNC_API_SYNCABLE_SERVICE_H_ | 69 #endif // SYNC_API_SYNCABLE_SERVICE_H_ |
| OLD | NEW |