Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_ | |
| 6 #define CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "chrome/browser/sync/syncable/model_type.h" | |
| 12 #include "chrome/browser/sync/api/sync_change_processor.h" | |
| 13 | |
| 14 class SyncData; | |
| 15 | |
| 16 typedef std::vector<SyncData> SyncDataList; | |
| 17 | |
| 18 class SyncableService : public SyncChangeProcessor { | |
| 19 public: | |
| 20 SyncableService(); | |
|
akalin
2011/05/20 00:19:39
use default constructor
Nicolas Zea
2011/05/20 02:00:28
Done.
| |
| 21 virtual ~SyncableService(); | |
|
akalin
2011/05/20 00:19:39
make destructor protected
Nicolas Zea
2011/05/20 02:00:28
Done.
| |
| 22 | |
| 23 // Informs the service to begin syncing the specified synced datatype |type|. | |
| 24 // The service should then merge |initial_sync_data| into it's local data, | |
| 25 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the | |
| 26 // two. After this, the SyncableService's local data should match the server | |
| 27 // data, and the service should be ready to receive and process any further | |
| 28 // SyncChange's as they occur. | |
| 29 virtual bool MergeDataAndStartSyncing( | |
| 30 syncable::ModelType type, | |
| 31 const SyncDataList& initial_sync_data, | |
| 32 SyncChangeProcessor* sync_processor) = 0; | |
| 33 | |
| 34 // Stop syncing the specified type and reset state. | |
| 35 virtual void StopSyncing(syncable::ModelType type) = 0; | |
| 36 | |
| 37 // Fills a list of SyncData from the local data. This should create an up | |
| 38 // to date representation of the SyncableService's view of that datatype, and | |
| 39 // should match/be a subset of the server's view of that datatype. | |
| 40 virtual bool GetAllSyncData(syncable::ModelType type, | |
| 41 SyncDataList* current_data) = 0; | |
| 42 | |
| 43 // SyncChangeProcessor interface. | |
| 44 // Process a list of new SyncChanges and update the local data as necessary. | |
| 45 virtual void ProcessSyncChanges(const SyncChangeList& change_list) = 0; | |
| 46 | |
| 47 private: | |
| 48 DISALLOW_COPY_AND_ASSIGN(SyncableService); | |
| 49 }; | |
| 50 | |
| 51 #endif // CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_ | |
| OLD | NEW |