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