summaryrefslogtreecommitdiffstats
path: root/sync/syncable/model_neutral_mutable_entry.h
diff options
context:
space:
mode:
authorstanisc <stanisc@chromium.org>2015-07-22 15:15:43 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-22 22:17:05 +0000
commitf6215431bd639d6bada92a575fb4772572de4671 (patch)
treeef5ae1ad5a8c2cd3d03e8121672d42b51f34e9c0 /sync/syncable/model_neutral_mutable_entry.h
parent97c6546f0e728f5477ed8484e0150f1220147e15 (diff)
downloadchromium_src-f6215431bd639d6bada92a575fb4772572de4671.zip
chromium_src-f6215431bd639d6bada92a575fb4772572de4671.tar.gz
chromium_src-f6215431bd639d6bada92a575fb4772572de4671.tar.bz2
Sync: MutableEntry shouldn't track changes that have no actual impact on the stored data
This is a resubmit of https://codereview.chromium.org/1237493002/ that was reverted due to a DEBUG check failure in one of the tests. I originally added that DCHECK because I believed the MutableEntry.PutPredecessor call would only be made in a context of other mutations and that the entry would have to be already dirty. It turned out there is one particular codepath where BookmarkChangeProcessor::BookmarkNodeChildrenReordered gets called that reorders sync bookmarks without doing any other mutations and might result in failing the DCHECK. I removed the DCHECK and replaced it with a comment. Other than that the code change is the same as in the reverted patch. Original description: --------------------- This change optimizes MutableEntry and ModelNeutralMutableEntry methods that update sync data. Most of these methods compare new and old values and skip the update when the values match. However most of these methods still unconditionally register EntryKernel to be tracked in EntryKernelMutation list by making a TrackChangesTo call, which immediately makes a deep copy of EntryKernel. Then there is one more deep copy at the end of the transaction scope. This fix avoids the two unnecessary deep copies by calling TrackChangesTo only when necessary e.g. when the new value is actually different. In addition I used this as an opportunity to do a small code cleanup around marking MutableEntry instances as dirty. BUG=468144 Review URL: https://codereview.chromium.org/1239393002 Cr-Commit-Position: refs/heads/master@{#339956}
Diffstat (limited to 'sync/syncable/model_neutral_mutable_entry.h')
-rw-r--r--sync/syncable/model_neutral_mutable_entry.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sync/syncable/model_neutral_mutable_entry.h b/sync/syncable/model_neutral_mutable_entry.h
index 5ff71ad..76f5c63 100644
--- a/sync/syncable/model_neutral_mutable_entry.h
+++ b/sync/syncable/model_neutral_mutable_entry.h
@@ -100,7 +100,7 @@ class SYNC_EXPORT_PRIVATE ModelNeutralMutableEntry : public Entry {
protected:
explicit ModelNeutralMutableEntry(BaseWriteTransaction* trans);
- syncable::MetahandleSet* GetDirtyIndexHelper();
+ void MarkDirty();
private:
friend class syncer::WriteNode;