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

Side by Side Diff: sync/api/attachments/attachment.cc

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Rename GetAttachments to GetLocalAttachmentsForUpload. 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
« no previous file with comments | « sync/api/attachments/attachment.h ('k') | sync/api/attachments/attachment_id.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "sync/api/attachments/attachment.h" 5 #include "sync/api/attachments/attachment.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace syncer { 9 namespace syncer {
10 10
11 Attachment::~Attachment() {} 11 Attachment::~Attachment() {}
12 12
13 // Static. 13 // Static.
14 scoped_ptr<Attachment> Attachment::Create( 14 Attachment Attachment::Create(
15 const scoped_refptr<base::RefCountedMemory>& data) { 15 const scoped_refptr<base::RefCountedMemory>& data) {
16 return CreateWithId(AttachmentId::Create(), data); 16 return CreateWithId(AttachmentId::Create(), data);
17 } 17 }
18 18
19 // Static. 19 // Static.
20 scoped_ptr<Attachment> Attachment::CreateWithId( 20 Attachment Attachment::CreateWithId(
21 const AttachmentId& id, 21 const AttachmentId& id,
22 const scoped_refptr<base::RefCountedMemory>& data) { 22 const scoped_refptr<base::RefCountedMemory>& data) {
23 return scoped_ptr<Attachment>(new Attachment(id, data)).Pass(); 23 return Attachment(id, data);
24 } 24 }
25 25
26 const AttachmentId& Attachment::GetId() const { return id_; } 26 const AttachmentId& Attachment::GetId() const { return id_; }
27 27
28 const scoped_refptr<base::RefCountedMemory>& Attachment::GetData() const { 28 const scoped_refptr<base::RefCountedMemory>& Attachment::GetData() const {
29 return data_; 29 return data_;
30 } 30 }
31 31
32 Attachment::Attachment(const AttachmentId& id, 32 Attachment::Attachment(const AttachmentId& id,
33 const scoped_refptr<base::RefCountedMemory>& data) 33 const scoped_refptr<base::RefCountedMemory>& data)
34 : id_(id), data_(data) { 34 : id_(id), data_(data) {
35 DCHECK(data); 35 DCHECK(data);
36 } 36 }
37 37
38 } // namespace syncer 38 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/api/attachments/attachment.h ('k') | sync/api/attachments/attachment_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698