summaryrefslogtreecommitdiffstats
path: root/sync/syncable/model_neutral_mutable_entry.h
diff options
context:
space:
mode:
authorstanisc <stanisc@chromium.org>2015-07-16 16:18:56 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-16 23:19:33 +0000
commit193873c7e382f11bf09b6739d07ac82e9dd14fd7 (patch)
tree14e3928380fce49d4d2ebb938b6cd12939ac2561 /sync/syncable/model_neutral_mutable_entry.h
parent4927df40d0342522fc268f884835b43f9004549e (diff)
downloadchromium_src-193873c7e382f11bf09b6739d07ac82e9dd14fd7.zip
chromium_src-193873c7e382f11bf09b6739d07ac82e9dd14fd7.tar.gz
chromium_src-193873c7e382f11bf09b6739d07ac82e9dd14fd7.tar.bz2
Sync: MutableEntry shouldn't track changes that have no actual impact on the stored data
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/1237493002 Cr-Commit-Position: refs/heads/master@{#339162}
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;