Index: sync/api/attachments/attachment_service.h |
diff --git a/sync/api/attachments/attachment_service.h b/sync/api/attachments/attachment_service.h |
index 81a1a6350d229ec108e94680b85fb2dca5736d62..9e5e25d1489afef08909549afa08ed1f36e74cc9 100644 |
--- a/sync/api/attachments/attachment_service.h |
+++ b/sync/api/attachments/attachment_service.h |
@@ -38,11 +38,22 @@ class SYNC_EXPORT AttachmentService { |
// The result of a DropAttachments operation. |
enum DropResult { |
DROP_SUCCESS, // No error, all attachments dropped. |
- DROP_UNSPECIFIED_ERROR, // An unspecified error occurred. |
+ DROP_UNSPECIFIED_ERROR, // An unspecified error occurred. Some or all |
+ // attachments may not have been dropped. |
}; |
typedef base::Callback<void(const DropResult&)> DropCallback; |
+ // The result of a StoreAttachments operation. |
+ enum StoreResult { |
+ STORE_SUCCESS, // No error, all attachments stored (at least |
+ // locally). |
+ STORE_UNSPECIFIED_ERROR, // An unspecified error occurred. Some or all |
+ // attachments may not have been stored. |
+ }; |
+ |
+ typedef base::Callback<void(const StoreResult&)> StoreCallback; |
+ |
AttachmentService(); |
virtual ~AttachmentService(); |
@@ -55,10 +66,12 @@ class SYNC_EXPORT AttachmentService { |
virtual void DropAttachments(const AttachmentIdList& attachment_ids, |
const DropCallback& callback) = 0; |
- // This method should be called when a SyncData is about to be added to the |
- // sync database so we have a chance to persist the Attachment locally and |
- // schedule it for upload to the sync server. |
- virtual void OnSyncDataAdd(const SyncData& sync_data) = 0; |
+ // Store |attachments| on device and (eventually) upload them to the server. |
+ // |
+ // Invokes |callback| once the attachments have been written to device |
+ // storage. |
+ virtual void StoreAttachments(const AttachmentList& attachments, |
+ const StoreCallback& callback) = 0; |
// This method should be called when a SyncData is about to be deleted from |
// the sync database so we can remove any unreferenced attachments from local |