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

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

Issue 272043002: Invoke AttachmentUploader and update AttachmentIds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/api/attachments/attachment_service.h
diff --git a/sync/api/attachments/attachment_service.h b/sync/api/attachments/attachment_service.h
index 9e5e25d1489afef08909549afa08ed1f36e74cc9..c9c4b3337259901ee826126cb0fc3c55f73d4123 100644
--- a/sync/api/attachments/attachment_service.h
+++ b/sync/api/attachments/attachment_service.h
@@ -54,9 +54,23 @@ class SYNC_EXPORT AttachmentService {
typedef base::Callback<void(const StoreResult&)> StoreCallback;
+ // An interface that embedder code implements to be notified about different
+ // events that originate from AttachmentService.
+ class Delegate {
maniscalco 2014/05/09 18:12:11 I'm thinking about in which thread the delegate wi
pavely 2014/05/13 23:06:44 Done.
+ public:
+ virtual ~Delegate() {}
+
+ // Attachment is uploaded to server and attachment_id is updated with server
+ // url.
+ virtual void OnAttachmentUploaded(const AttachmentId& attachment_id) = 0;
+ };
+
AttachmentService();
virtual ~AttachmentService();
+ // Set delegate pointer. AttachmentService doesn't own delegate.
maniscalco 2014/05/09 18:12:11 Can we avoid adding a no-op implementation here?
pavely 2014/05/13 23:06:44 The reason was to not add implementation of it to
+ virtual void SetDelegate(Delegate* delegate) {}
maniscalco 2014/05/09 18:12:11 In the future we may move the delegate functionali
pavely 2014/05/13 23:06:44 Right now interface simple, explicit and will blow
+
// See SyncData::GetOrDownloadAttachments.
virtual void GetOrDownloadAttachments(
const AttachmentIdList& attachment_ids,

Powered by Google App Engine
This is Rietveld 408576698