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

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

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Pull in upstream changes. Created 6 years, 9 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.h
diff --git a/sync/api/attachments/attachment.h b/sync/api/attachments/attachment.h
index 1f1dbd2a93463a74209d23bff4d89e68ff8d6931..3511e02cb7fee3ac536d595d9e8530dffe51f31b 100644
--- a/sync/api/attachments/attachment.h
+++ b/sync/api/attachments/attachment.h
@@ -27,17 +27,19 @@ class SYNC_EXPORT Attachment {
// Default copy and assignment are welcome.
+ // Creates a unique attachment id.
+ static sync_pb::AttachmentId CreateId();
+
// Creates an attachment with a unique id and the supplied data.
//
// Used when creating a brand new attachment.
- static scoped_ptr<Attachment> Create(
- const scoped_refptr<base::RefCountedMemory>& data);
+ static Attachment Create(const scoped_refptr<base::RefCountedMemory>& data);
// Creates an attachment with the supplied id and data.
//
// Used when you want to recreate a specific attachment. E.g. creating a local
// copy of an attachment that already exists on the sync server.
- static scoped_ptr<Attachment> CreateWithId(
+ static Attachment CreateWithId(
const sync_pb::AttachmentId& id,
const scoped_refptr<base::RefCountedMemory>& data);
@@ -51,14 +53,8 @@ class SYNC_EXPORT Attachment {
sync_pb::AttachmentId id_;
scoped_refptr<base::RefCountedMemory> data_;
- friend class AttachmentTest;
- FRIEND_TEST_ALL_PREFIXES(AttachmentTest, CreateId_UniqueIdIsUnique);
-
Attachment(const sync_pb::AttachmentId& id,
const scoped_refptr<base::RefCountedMemory>& data);
-
- // Creates a unique attachment id.
- static sync_pb::AttachmentId CreateId();
};
typedef std::vector<syncer::Attachment> AttachmentList;

Powered by Google App Engine
This is Rietveld 408576698