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

Unified Diff: sync/syncable/directory.h

Issue 15322003: sync: Count nodes more efficiently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement suggestions from review Created 7 years, 7 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/internal_api/base_node.cc ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.h
diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h
index 61c55224911d4b894ab0960ee73fec0f686691b2..1f787f28543ef0a2a9a4e57491f26001fec75424 100644
--- a/sync/syncable/directory.h
+++ b/sync/syncable/directory.h
@@ -321,6 +321,9 @@ class SYNC_EXPORT Directory {
bool GetChildHandlesByHandle(BaseTransaction*, int64 handle,
ChildHandles* result);
+ // Counts all items under the given node, including the node itself.
+ int GetTotalNodeCount(BaseTransaction*, EntryKernel* kernel_) const;
+
// Returns true iff |id| has children.
bool HasChildren(BaseTransaction* trans, const Id& id);
@@ -454,6 +457,12 @@ class SYNC_EXPORT Directory {
bool SafeToPurgeFromMemory(WriteTransaction* trans,
const EntryKernel* const entry) const;
+ // A helper used by GetTotalNodeCount.
+ void GetChildSetForKernel(
+ BaseTransaction*,
+ EntryKernel* kernel_,
+ std::deque<const OrderedChildSet*>* child_sets) const;
+
Directory& operator = (const Directory&);
public:
« no previous file with comments | « sync/internal_api/base_node.cc ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698