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

Side by Side Diff: sync/api/attachments/attachment_store.h

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Remove AttachmentServiceBase for reals. 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 unified diff | Download patch
OLDNEW
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_API_ATTACHMENTS_ATTACHMENT_STORE_H_ 5 #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_
6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "sync/base/sync_export.h" 11 #include "sync/base/sync_export.h"
12 12
13 namespace base { 13 namespace base {
14 class RefCountedMemory; 14 class RefCountedMemory;
15 } // namespace base 15 } // namespace base
16 16
17 namespace syncer { 17 namespace syncer {
18 18
19 class Attachment; 19 class Attachment;
20 class AttachmentId; 20 class AttachmentId;
21 21
22 // A place to locally store and access Attachments. 22 // A place to locally store and access Attachments.
23 class SYNC_EXPORT AttachmentStore { 23 class SYNC_EXPORT AttachmentStore {
24 public: 24 public:
25 AttachmentStore(); 25 AttachmentStore();
26 virtual ~AttachmentStore(); 26 virtual ~AttachmentStore();
27 27
28 // TODO(maniscalco): Consider udpating Read and Write methods to support 28 // TODO(maniscalco): Consider udpating Read and Write methods to support
29 // resumable transfers. 29 // resumable transfers (bug 353292).
30 30
31 enum Result { 31 enum Result {
32 SUCCESS, // No error. 32 SUCCESS, // No error.
33 NOT_FOUND, // Attachment was not found or does not exist. 33 NOT_FOUND, // Attachment was not found or does not exist.
34 UNSPECIFIED_ERROR, // An unspecified error occurred. 34 UNSPECIFIED_ERROR, // An unspecified error occurred.
35 }; 35 };
36 36
37 typedef base::Callback<void(const Result&, scoped_ptr<Attachment>)> 37 typedef base::Callback<void(const Result&, scoped_ptr<Attachment>)>
38 ReadCallback; 38 ReadCallback;
39 typedef base::Callback<void(const Result&, const AttachmentId& id)> 39 typedef base::Callback<void(const Result&, const AttachmentId& id)>
(...skipping 17 matching lines...) Expand all
57 // 57 //
58 // This does not remove the attachment from the server. |callback| will be 58 // This does not remove the attachment from the server. |callback| will be
59 // invoked when finished. If the attachment does not exist, |callback|'s 59 // invoked when finished. If the attachment does not exist, |callback|'s
60 // Result will be NOT_FOUND. 60 // Result will be NOT_FOUND.
61 virtual void Drop(const AttachmentId& id, const DropCallback& callback) = 0; 61 virtual void Drop(const AttachmentId& id, const DropCallback& callback) = 0;
62 }; 62 };
63 63
64 } // namespace syncer 64 } // namespace syncer
65 65
66 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ 66 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698