summaryrefslogtreecommitdiffstats
path: root/sync/api/attachments/attachment_id.h
diff options
context:
space:
mode:
Diffstat (limited to 'sync/api/attachments/attachment_id.h')
-rw-r--r--sync/api/attachments/attachment_id.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sync/api/attachments/attachment_id.h b/sync/api/attachments/attachment_id.h
index 6ce331a..1c53355 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.