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

Unified Diff: sync/syncable/mutable_entry.cc

Issue 11441026: [Sync] Add support for loading, updating and querying delete journals in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
Index: sync/syncable/mutable_entry.cc
diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc
index 5090ad1a9116739a00d89ae6f6952ec9c765acaa..e7306b2db608313403ff4dc9b02c632f1a29e23b 100644
--- a/sync/syncable/mutable_entry.cc
+++ b/sync/syncable/mutable_entry.cc
@@ -273,9 +273,13 @@ bool MutableEntry::Put(ProtoField field,
bool MutableEntry::Put(BitField field, bool value) {
DCHECK(kernel_);
write_transaction_->SaveOriginal(kernel_);
- if (kernel_->ref(field) != value) {
+ bool old_value = kernel_->ref(field);
+ if (old_value != value) {
kernel_->put(field, value);
kernel_->mark_dirty(GetDirtyIndexHelper());
+
+ if (field == SERVER_IS_DEL)
+ dir()->UpdateDeleteJournals(write_transaction(), old_value, *kernel_);
tim (not reviewing) 2012/12/13 23:41:30 One thing is that as-written, we could not use Upd
haitaol1 2012/12/14 19:22:38 Comments added. On 2012/12/13 23:41:30, timsteel
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698