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

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

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_id.h ('k') | sync/api/attachments/attachment_id_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/attachments/attachment_id.cc
diff --git a/sync/api/attachments/attachment_id.cc b/sync/api/attachments/attachment_id.cc
index e61705e63ab7daecd4456249790e5bd17b159045..07f34102021517532a8079928b9fc2e91afc70d1 100644
--- a/sync/api/attachments/attachment_id.cc
+++ b/sync/api/attachments/attachment_id.cc
@@ -52,8 +52,8 @@ bool AttachmentId::operator<(const AttachmentId& other) const {
}
// Static.
-AttachmentId AttachmentId::Create() {
- sync_pb::AttachmentIdProto proto = CreateAttachmentIdProto();
+AttachmentId AttachmentId::Create(size_t size, uint32_t crc32c) {
+ sync_pb::AttachmentIdProto proto = CreateAttachmentIdProto(size, crc32c);
return AttachmentId(&proto);
}
@@ -71,4 +71,12 @@ const sync_pb::AttachmentIdProto& AttachmentId::GetProto() const {
AttachmentId::AttachmentId(sync_pb::AttachmentIdProto* proto)
: proto_(proto) {}
+size_t AttachmentId::GetSize() const {
+ return proto_.Get().size_bytes();
+}
+
+uint32_t AttachmentId::GetCrc32c() const {
+ return proto_.Get().crc32c();
+}
+
} // namespace syncer
« no previous file with comments | « sync/api/attachments/attachment_id.h ('k') | sync/api/attachments/attachment_id_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698