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

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

Issue 982883002: [Sync] Add size and crc32c to AttachmentId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 5 years, 9 months 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
« no previous file with comments | « sync/api/attachments/attachment.cc ('k') | sync/api/attachments/attachment_id.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/attachments/attachment_id.h
diff --git a/sync/api/attachments/attachment_id.h b/sync/api/attachments/attachment_id.h
index 6ce331a98aa55091a0eae4f4b391113d888bc245..1c53355f8c476acb2fd81267eedd378c7582c9ea 100644
--- a/sync/api/attachments/attachment_id.h
+++ b/sync/api/attachments/attachment_id.h
@@ -35,14 +35,24 @@ class SYNC_EXPORT AttachmentId {
// Needed for using AttachmentId as key in std::map.
bool operator<(const AttachmentId& other) const;
- // Creates a unique attachment id.
- static AttachmentId Create();
+ // Creates a unique id for an attachment.
+ //
+ // |size| is the attachment's size in bytes.
+ //
+ // |crc32c| is the attachment's crc32c.
+ static AttachmentId Create(size_t size, uint32_t crc32c);
// Creates an attachment id from an initialized proto.
static AttachmentId CreateFromProto(const sync_pb::AttachmentIdProto& proto);
const sync_pb::AttachmentIdProto& GetProto() const;
+ // Returns the size (in bytes) the attachment.
+ size_t GetSize() const;
+
+ // Returns the crc32c the attachment.
+ uint32_t GetCrc32c() const;
+
private:
// Necessary since we forward-declare sync_pb::AttachmentIdProto; see comments
// in immutable.h.
« no previous file with comments | « sync/api/attachments/attachment.cc ('k') | sync/api/attachments/attachment_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698