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

Unified Diff: sync/api/attachments/attachment.h

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/api/attachments/attachment.h
diff --git a/sync/api/attachments/attachment.h b/sync/api/attachments/attachment.h
index af4c36da70b0f71eb8393c03fc0fa89074d7265d..cb9d12ca51f84c23cd173ed9f35f9b0f8afa8c0a 100644
--- a/sync/api/attachments/attachment.h
+++ b/sync/api/attachments/attachment.h
@@ -32,15 +32,17 @@ class SYNC_EXPORT Attachment {
// Creates an attachment with a unique id and the supplied data.
//
// Used when creating a brand new attachment.
- static Attachment Create(const scoped_refptr<base::RefCountedMemory>& data);
+ static Attachment CreateNew(
+ const scoped_refptr<base::RefCountedMemory>& data);
// Creates an attachment with the supplied id and data.
//
// Used when you want to recreate a specific attachment. E.g. creating a local
// copy of an attachment that already exists on the sync server.
- static Attachment CreateWithId(
+ static Attachment RestoreExisting(
const AttachmentId& id,
- const scoped_refptr<base::RefCountedMemory>& data);
+ const scoped_refptr<base::RefCountedMemory>& data,
+ uint32_t crc32c);
// Returns this attachment's id.
const AttachmentId& GetId() const;
@@ -48,12 +50,16 @@ class SYNC_EXPORT Attachment {
// Returns this attachment's data.
const scoped_refptr<base::RefCountedMemory>& GetData() const;
+ uint32_t GetCrc32c() const;
maniscalco 2014/11/11 00:44:53 Maybe indicate that this is a cheap operation? e.
pavely 2014/11/11 22:27:14 Done.
+
private:
AttachmentId id_;
scoped_refptr<base::RefCountedMemory> data_;
+ uint32_t crc32c_;
Attachment(const AttachmentId& id,
- const scoped_refptr<base::RefCountedMemory>& data);
+ const scoped_refptr<base::RefCountedMemory>& data,
+ uint32_t crc32c);
};
typedef std::vector<syncer::Attachment> AttachmentList;

Powered by Google App Engine
This is Rietveld 408576698