| Index: sync/api/attachments/attachment.cc
|
| diff --git a/sync/api/attachments/attachment.cc b/sync/api/attachments/attachment.cc
|
| index 32a514ac341bcb55cf53bd54fe1d662c34af9459..b682520e100022bd0ed4652f5678528bd15c9133 100644
|
| --- a/sync/api/attachments/attachment.cc
|
| +++ b/sync/api/attachments/attachment.cc
|
| @@ -15,14 +15,15 @@
|
| Attachment Attachment::Create(
|
| const scoped_refptr<base::RefCountedMemory>& data) {
|
| uint32_t crc32c = ComputeCrc32c(data);
|
| - return CreateFromParts(AttachmentId::Create(data->size(), crc32c), data);
|
| + return CreateFromParts(AttachmentId::Create(), data, crc32c);
|
| }
|
|
|
| // Static.
|
| Attachment Attachment::CreateFromParts(
|
| const AttachmentId& id,
|
| - const scoped_refptr<base::RefCountedMemory>& data) {
|
| - return Attachment(id, data);
|
| + const scoped_refptr<base::RefCountedMemory>& data,
|
| + uint32_t crc32c) {
|
| + return Attachment(id, data, crc32c);
|
| }
|
|
|
| const AttachmentId& Attachment::GetId() const { return id_; }
|
| @@ -31,14 +32,12 @@
|
| return data_;
|
| }
|
|
|
| -uint32_t Attachment::GetCrc32c() const {
|
| - return id_.GetCrc32c();
|
| -}
|
| +uint32_t Attachment::GetCrc32c() const { return crc32c_; }
|
|
|
| Attachment::Attachment(const AttachmentId& id,
|
| - const scoped_refptr<base::RefCountedMemory>& data)
|
| - : id_(id), data_(data) {
|
| - DCHECK_EQ(id.GetSize(), data->size());
|
| + const scoped_refptr<base::RefCountedMemory>& data,
|
| + uint32_t crc32c)
|
| + : id_(id), data_(data), crc32c_(crc32c) {
|
| DCHECK(data.get());
|
| }
|
|
|
|
|