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

Unified Diff: sync/internal_api/attachments/fake_attachment_downloader.cc

Issue 710073003: Store attachment crc in AttachmentStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Add comment in attachment_util.h. Created 6 years, 1 month 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/internal_api/attachments/fake_attachment_downloader.cc
diff --git a/sync/internal_api/attachments/fake_attachment_downloader.cc b/sync/internal_api/attachments/fake_attachment_downloader.cc
index 1f2795e7dfdd849c42e122f13de4c907068555a3..53abc61da11ca18381381e3f7de83c0ce02d2589 100644
--- a/sync/internal_api/attachments/fake_attachment_downloader.cc
+++ b/sync/internal_api/attachments/fake_attachment_downloader.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "sync/internal_api/public/attachments/attachment_util.h"
namespace syncer {
@@ -24,8 +25,9 @@ void FakeAttachmentDownloader::DownloadAttachment(
// attachment.
scoped_refptr<base::RefCountedMemory> data(new base::RefCountedBytes());
scoped_ptr<Attachment> attachment;
+ const uint32_t crc32c = ComputeCrc32c(data);
attachment.reset(
- new Attachment(Attachment::CreateWithId(attachment_id, data)));
+ new Attachment(Attachment::CreateFromParts(attachment_id, data, crc32c)));
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(callback, DOWNLOAD_SUCCESS, base::Passed(&attachment)));
« no previous file with comments | « sync/internal_api/attachments/attachment_util.cc ('k') | sync/internal_api/attachments/on_disk_attachment_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698