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

Unified Diff: sync/api/attachments/attachment_service.h

Issue 264793007: Keep track of which attachments are referenced by which sync entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak. Created 6 years, 8 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
« no previous file with comments | « sync/api/attachments/attachment_id.cc ('k') | sync/api/attachments/attachment_service_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « sync/api/attachments/attachment_id.cc ('k') | sync/api/attachments/attachment_service_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698