| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 virtual ~Delegate() {} | 45 virtual ~Delegate() {} |
| 46 | 46 |
| 47 // Attachment is uploaded to server and attachment_id is updated with server | 47 // Attachment is uploaded to server and attachment_id is updated with server |
| 48 // url. | 48 // url. |
| 49 virtual void OnAttachmentUploaded(const AttachmentId& attachment_id) = 0; | 49 virtual void OnAttachmentUploaded(const AttachmentId& attachment_id) = 0; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 AttachmentService(); | 52 AttachmentService(); |
| 53 virtual ~AttachmentService(); | 53 virtual ~AttachmentService(); |
| 54 | 54 |
| 55 // Return a pointer to the AttachmentStore owned by this object. |
| 56 // |
| 57 // May return NULL. |
| 58 virtual AttachmentStore* GetStore() = 0; |
| 59 |
| 55 // See SyncData::GetOrDownloadAttachments. | 60 // See SyncData::GetOrDownloadAttachments. |
| 56 virtual void GetOrDownloadAttachments( | 61 virtual void GetOrDownloadAttachments( |
| 57 const AttachmentIdList& attachment_ids, | 62 const AttachmentIdList& attachment_ids, |
| 58 const GetOrDownloadCallback& callback) = 0; | 63 const GetOrDownloadCallback& callback) = 0; |
| 59 | 64 |
| 60 // Schedules the attachments identified by |attachment_ids| to be uploaded to | 65 // Schedules the attachments identified by |attachment_ids| to be uploaded to |
| 61 // the server. | 66 // the server. |
| 62 // | 67 // |
| 63 // Assumes the attachments are already in the attachment store. | 68 // Assumes the attachments are already in the attachment store. |
| 64 // | 69 // |
| 65 // A request to upload attachments is persistent in that uploads will be | 70 // A request to upload attachments is persistent in that uploads will be |
| 66 // automatically retried if transient errors occur. | 71 // automatically retried if transient errors occur. |
| 67 // | 72 // |
| 68 // A request to upload attachments does not persist across restarts of Chrome. | 73 // A request to upload attachments does not persist across restarts of Chrome. |
| 69 // | 74 // |
| 70 // Invokes OnAttachmentUploaded on the Delegate (if provided). | 75 // Invokes OnAttachmentUploaded on the Delegate (if provided). |
| 71 virtual void UploadAttachments(const AttachmentIdSet& attachment_ids) = 0; | 76 virtual void UploadAttachments(const AttachmentIdSet& attachment_ids) = 0; |
| 72 }; | 77 }; |
| 73 | 78 |
| 74 } // namespace syncer | 79 } // namespace syncer |
| 75 | 80 |
| 76 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ | 81 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_H_ |
| OLD | NEW |