| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/callback.h" | 10 #include "base/callback.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Stop syncing the specified type and reset state. | 57 // Stop syncing the specified type and reset state. |
| 58 virtual void StopSyncing(ModelType type) = 0; | 58 virtual void StopSyncing(ModelType type) = 0; |
| 59 | 59 |
| 60 // SyncChangeProcessor interface. | 60 // SyncChangeProcessor interface. |
| 61 // Process a list of new SyncChanges and update the local data as necessary. | 61 // Process a list of new SyncChanges and update the local data as necessary. |
| 62 // Returns: A default SyncError (IsSet() == false) if no errors were | 62 // Returns: A default SyncError (IsSet() == false) if no errors were |
| 63 // encountered, and a filled SyncError (IsSet() == true) | 63 // encountered, and a filled SyncError (IsSet() == true) |
| 64 // otherwise. | 64 // otherwise. |
| 65 virtual SyncError ProcessSyncChanges( | 65 virtual SyncError ProcessSyncChanges( |
| 66 const tracked_objects::Location& from_here, | 66 const tracked_objects::Location& from_here, |
| 67 const SyncChangeList& change_list) OVERRIDE = 0; | 67 const SyncChangeList& change_list) override = 0; |
| 68 | 68 |
| 69 // Returns AttachmentStore used by datatype. Attachment store is used by sync | 69 // Returns AttachmentStore used by datatype. Attachment store is used by sync |
| 70 // when uploading or downloading attachments. | 70 // when uploading or downloading attachments. |
| 71 // GetAttachmentStore is called right before MergeDataAndStartSyncing. If at | 71 // GetAttachmentStore is called right before MergeDataAndStartSyncing. If at |
| 72 // that time GetAttachmentStore returns NULL then datatype is considered not | 72 // that time GetAttachmentStore returns NULL then datatype is considered not |
| 73 // using attachments and all attempts to upload/download attachments will | 73 // using attachments and all attempts to upload/download attachments will |
| 74 // fail. Default implementation returns NULL. Datatype that uses sync | 74 // fail. Default implementation returns NULL. Datatype that uses sync |
| 75 // attachemnts should create attachment store and implement GetAttachmentStore | 75 // attachemnts should create attachment store and implement GetAttachmentStore |
| 76 // to return pointer to it. | 76 // to return pointer to it. |
| 77 virtual scoped_refptr<AttachmentStore> GetAttachmentStore(); | 77 virtual scoped_refptr<AttachmentStore> GetAttachmentStore(); |
| 78 | 78 |
| 79 protected: | 79 protected: |
| 80 virtual ~SyncableService(); | 80 virtual ~SyncableService(); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace syncer | 83 } // namespace syncer |
| 84 | 84 |
| 85 #endif // SYNC_API_SYNCABLE_SERVICE_H_ | 85 #endif // SYNC_API_SYNCABLE_SERVICE_H_ |
| OLD | NEW |