| Index: sync/api/attachments/attachment.cc
|
| diff --git a/sync/api/attachments/attachment.cc b/sync/api/attachments/attachment.cc
|
| index 896ff1fbde1b8bf4ef7237a55149b47f1fadd54d..a6d0b8e744d99e0d677067e2cd48ef5fb0fd5c85 100644
|
| --- a/sync/api/attachments/attachment.cc
|
| +++ b/sync/api/attachments/attachment.cc
|
| @@ -12,16 +12,25 @@ namespace syncer {
|
| Attachment::~Attachment() {}
|
|
|
| // Static.
|
| -scoped_ptr<Attachment> Attachment::Create(
|
| +sync_pb::AttachmentId Attachment::CreateId() {
|
| + sync_pb::AttachmentId result;
|
| + // Only requirement here is that this id must be globally unique.
|
| + // TODO(maniscalco): Consider making this base64 encoded.
|
| + result.set_unique_id(base::RandBytesAsString(16));
|
| + return result;
|
| +}
|
| +
|
| +// Static.
|
| +Attachment Attachment::Create(
|
| const scoped_refptr<base::RefCountedMemory>& data) {
|
| return CreateWithId(CreateId(), data);
|
| }
|
|
|
| // Static.
|
| -scoped_ptr<Attachment> Attachment::CreateWithId(
|
| +Attachment Attachment::CreateWithId(
|
| const sync_pb::AttachmentId& id,
|
| const scoped_refptr<base::RefCountedMemory>& data) {
|
| - return scoped_ptr<Attachment>(new Attachment(id, data)).Pass();
|
| + return Attachment(id, data);
|
| }
|
|
|
| const sync_pb::AttachmentId& Attachment::GetId() const { return id_; }
|
| @@ -37,13 +46,4 @@ Attachment::Attachment(const sync_pb::AttachmentId& id,
|
| DCHECK(data);
|
| }
|
|
|
| -// Static.
|
| -sync_pb::AttachmentId Attachment::CreateId() {
|
| - sync_pb::AttachmentId result;
|
| - // Only requirement here is that this id must be globally unique.
|
| - // TODO(maniscalco): Consider making this base64 encoded.
|
| - result.set_unique_id(base::RandBytesAsString(16));
|
| - return result;
|
| -}
|
| -
|
| } // namespace syncer
|
|
|