summaryrefslogtreecommitdiffstats
path: root/sync/syncable/entry.h
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-29 21:18:31 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-29 21:18:31 +0000
commitbb7e03b8ab6af206f37d14f3f99c0725d9e3664e (patch)
treee33381a964fff8c35163cb0b9872507e54b6008f /sync/syncable/entry.h
parentf7435c24972d397d40f56755cb8993db390c3858 (diff)
downloadchromium_src-bb7e03b8ab6af206f37d14f3f99c0725d9e3664e.zip
chromium_src-bb7e03b8ab6af206f37d14f3f99c0725d9e3664e.tar.gz
chromium_src-bb7e03b8ab6af206f37d14f3f99c0725d9e3664e.tar.bz2
sync: Count nodes more efficiently
The GetTotalNodesCount() function is called sufficiently often that it makes sense to spend some effort optimizing its implementation. The current implementation uses some traversal functions that are fairly slow, especially since GetSuccessorId() was made more expensive by the implementation of UniquePositions. This change moves the implementation into the syncable::Directory. This allows it to take advantage of the Directory's internal data structures and avoid unnecessary lookups. BUG=248143,238621 Review URL: https://chromiumcodereview.appspot.com/15322003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/syncable/entry.h')
-rw-r--r--sync/syncable/entry.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sync/syncable/entry.h b/sync/syncable/entry.h
index 26ccc0a..097f8a8 100644
--- a/sync/syncable/entry.h
+++ b/sync/syncable/entry.h
@@ -108,6 +108,7 @@ class SYNC_EXPORT Entry {
Id GetPredecessorId() const;
Id GetSuccessorId() const;
Id GetFirstChildId() const;
+ int GetTotalNodeCount() const;
// Returns a vector of this node's children's handles.
// Clears |result| if there are no children. If this node is of a type that