Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: sync/internal_api/public/attachments/attachment_service.h

Issue 538403004: Revert of Replace AttachmentStore's StoreAttachments with UploadAttachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 @@
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 @@
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 @@
virtual void DropAttachments(const AttachmentIdList& attachment_ids,
const DropCallback& callback) = 0;
- // Schedules the attachments identified by |attachment_ids| to be uploaded to
- // the server.
+ // Store |attachments| on device and (eventually) upload them 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.
- //
- // 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

Powered by Google App Engine
This is Rietveld 408576698