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

Unified Diff: sync/syncable/mutable_entry.cc

Issue 247983002: Keep track of which attachments are referenced by which sync entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rework tests and move AttachmentIdProto creation to avoid violating DEPS. Created 6 years, 8 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/syncable/mutable_entry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « sync/syncable/mutable_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698