| Index: sync/internal_api/public/attachments/attachment_service.h
|
| diff --git a/sync/internal_api/public/attachments/attachment_service.h b/sync/internal_api/public/attachments/attachment_service.h
|
| index 758f960a659b92a6c33fd7518ef6d98b68e7de9b..6ac8cc6993fdbd9f0300c7fd62277122b4c5b1f2 100644
|
| --- a/sync/internal_api/public/attachments/attachment_service.h
|
| +++ b/sync/internal_api/public/attachments/attachment_service.h
|
| @@ -14,7 +14,6 @@
|
|
|
| namespace syncer {
|
|
|
| -class AttachmentStore;
|
| class SyncData;
|
|
|
| // AttachmentService is responsible for managing a model type's attachments.
|
| @@ -45,6 +44,16 @@ class SYNC_EXPORT AttachmentService {
|
|
|
| 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;
|
| +
|
| // An interface that embedder code implements to be notified about different
|
| // events that originate from AttachmentService.
|
| // This interface will be called from the same thread AttachmentService was
|
| @@ -61,11 +70,6 @@ class SYNC_EXPORT AttachmentService {
|
| AttachmentService();
|
| virtual ~AttachmentService();
|
|
|
| - // Return a pointer to the AttachmentStore owned by this object.
|
| - //
|
| - // May return NULL.
|
| - virtual AttachmentStore* GetStore() = 0;
|
| -
|
| // See SyncData::GetOrDownloadAttachments.
|
| virtual void GetOrDownloadAttachments(
|
| const AttachmentIdList& attachment_ids,
|
| @@ -75,18 +79,12 @@ class SYNC_EXPORT AttachmentService {
|
| virtual void DropAttachments(const AttachmentIdList& attachment_ids,
|
| const DropCallback& callback) = 0;
|
|
|
| - // Schedules the attachments identified by |attachment_ids| to be uploaded to
|
| - // the server.
|
| - //
|
| - // Assumes the attachments are already in the attachment store.
|
| - //
|
| - // A request to upload attachments is persistent in that uploads will be
|
| - // automatically retried if transient errors occur.
|
| - //
|
| - // A request to upload attachments does not persist across restarts of Chrome.
|
| + // Store |attachments| on device and (eventually) upload them to the server.
|
| //
|
| - // Invokes OnAttachmentUploaded on the Delegate (if provided).
|
| - virtual void UploadAttachments(const AttachmentIdSet& attachment_ids) = 0;
|
| + // Invokes |callback| once the attachments have been written to device
|
| + // storage.
|
| + virtual void StoreAttachments(const AttachmentList& attachments,
|
| + const StoreCallback& callback) = 0;
|
| };
|
|
|
| } // namespace syncer
|
|
|