Index: sync/syncable/mutable_entry.cc |
diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc |
index 863e65b8b32f8424e183227ebe24e5f604ac4149..d9d5daa890f0c13fedd1723bfe9b27794a4b2d14 100644 |
--- a/sync/syncable/mutable_entry.cc |
+++ b/sync/syncable/mutable_entry.cc |
@@ -233,6 +233,20 @@ bool MutableEntry::PutPredecessor(const Id& predecessor_id) { |
return true; |
} |
+void MutableEntry::PutAttachmentMetadata( |
+ const sync_pb::AttachmentMetadata& attachment_metadata) { |
+ DCHECK(kernel_); |
+ write_transaction()->TrackChangesTo(kernel_); |
+ if (kernel_->ref(ATTACHMENT_METADATA).SerializeAsString() != |
+ attachment_metadata.SerializeAsString()) { |
+ dir()->UpdateAttachmentIndex(GetMetahandle(), |
+ kernel_->ref(ATTACHMENT_METADATA), |
+ attachment_metadata); |
+ kernel_->put(ATTACHMENT_METADATA, attachment_metadata); |
+ kernel_->mark_dirty(&dir()->kernel_->dirty_metahandles); |
+ } |
+} |
+ |
// This function sets only the flags needed to get this entry to sync. |
bool MarkForSyncing(MutableEntry* e) { |
DCHECK_NE(static_cast<MutableEntry*>(NULL), e); |