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

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

Issue 272043002: Invoke AttachmentUploader and update AttachmentIds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android build 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
« no previous file with comments | « sync/api/attachments/attachment_service.h ('k') | sync/api/attachments/attachment_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/attachments/attachment_service_impl.h
diff --git a/sync/api/attachments/attachment_service_impl.h b/sync/api/attachments/attachment_service_impl.h
index f833b6f4596cb55a4d1e1464dd4d57b2e8941bf8..aa991103f4fadadf349da63e4e079796928610db 100644
--- a/sync/api/attachments/attachment_service_impl.h
+++ b/sync/api/attachments/attachment_service_impl.h
@@ -18,8 +18,13 @@ namespace syncer {
class SYNC_EXPORT AttachmentServiceImpl : public AttachmentService,
public base::NonThreadSafe {
public:
+ // |delegate| is optional delegate for AttachmentService to notify about
+ // asynchronous events (AttachmentUploaded). Pass NULL if delegate is not
+ // provided. AttachmentService doesn't take ownership of delegate, the pointer
+ // must be valid throughout AttachmentService lifetime.
AttachmentServiceImpl(scoped_ptr<AttachmentStore> attachment_store,
- scoped_ptr<AttachmentUploader> attachment_uploader);
+ scoped_ptr<AttachmentUploader> attachment_uploader,
+ Delegate* delegate);
virtual ~AttachmentServiceImpl();
// Create an AttachmentServiceImpl suitable for use in tests.
@@ -45,9 +50,12 @@ class SYNC_EXPORT AttachmentServiceImpl : public AttachmentService,
const AttachmentStore::Result& result);
void WriteDone(const StoreCallback& callback,
const AttachmentStore::Result& result);
+ void UploadDone(const AttachmentUploader::UploadResult& result,
+ const AttachmentId& attachment_id);
const scoped_ptr<AttachmentStore> attachment_store_;
const scoped_ptr<AttachmentUploader> attachment_uploader_;
+ Delegate* delegate_;
// Must be last data member.
base::WeakPtrFactory<AttachmentServiceImpl> weak_ptr_factory_;
« no previous file with comments | « sync/api/attachments/attachment_service.h ('k') | sync/api/attachments/attachment_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698