This source file includes following definitions.
- Create
- CreateWithId
- GetId
- GetData
- data_
#include "sync/api/attachments/attachment.h"
#include "base/logging.h"
namespace syncer {
Attachment::~Attachment() {}
Attachment Attachment::Create(
const scoped_refptr<base::RefCountedMemory>& data) {
return CreateWithId(AttachmentId::Create(), data);
}
Attachment Attachment::CreateWithId(
const AttachmentId& id,
const scoped_refptr<base::RefCountedMemory>& data) {
return Attachment(id, data);
}
const AttachmentId& Attachment::GetId() const { return id_; }
const scoped_refptr<base::RefCountedMemory>& Attachment::GetData() const {
return data_;
}
Attachment::Attachment(const AttachmentId& id,
const scoped_refptr<base::RefCountedMemory>& data)
: id_(id), data_(data) {
DCHECK(data);
}
}