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

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 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..92124d045d76c6cc1d2fc30d8ac6804554885c2e 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;
+ uint32_t crc = ComputeCrc32c(data);
maniscalco 2014/11/11 00:44:54 Since there are different kinds of CRCs, I suggest
pavely 2014/11/11 22:27:15 Done.
attachment.reset(
- new Attachment(Attachment::CreateWithId(attachment_id, data)));
+ new Attachment(Attachment::RestoreExisting(attachment_id, data, crc)));
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(callback, DOWNLOAD_SUCCESS, base::Passed(&attachment)));

Powered by Google App Engine
This is Rietveld 408576698