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

Unified Diff: sync/syncable/mutable_entry.cc

Issue 394293003: Do not update AttachmentIds after uploading attachments to sync server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 a506e4f5cef32e361050af5d22306aa3e4213a8f..b1c1ff43226dcb6697b8925ab41bf7f62f51f56f 100644
--- a/sync/syncable/mutable_entry.cc
+++ b/sync/syncable/mutable_entry.cc
@@ -246,19 +246,18 @@ void MutableEntry::PutAttachmentMetadata(
}
}
-void MutableEntry::UpdateAttachmentIdWithServerInfo(
- const sync_pb::AttachmentIdProto& updated_attachment_id) {
+void MutableEntry::MarkAttachmentAsOnServer(
+ const sync_pb::AttachmentIdProto& attachment_id) {
DCHECK(kernel_);
- DCHECK(!updated_attachment_id.unique_id().empty());
+ DCHECK(!attachment_id.unique_id().empty());
write_transaction()->TrackChangesTo(kernel_);
sync_pb::AttachmentMetadata& attachment_metadata =
kernel_->mutable_ref(ATTACHMENT_METADATA);
for (int i = 0; i < attachment_metadata.record_size(); ++i) {
sync_pb::AttachmentMetadataRecord* record =
attachment_metadata.mutable_record(i);
- if (record->id().unique_id() != updated_attachment_id.unique_id())
+ if (record->id().unique_id() != attachment_id.unique_id())
continue;
- *record->mutable_id() = updated_attachment_id;
record->set_is_on_server(true);
}
kernel_->mark_dirty(&dir()->kernel_->dirty_metahandles);
« 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