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

Unified Diff: chrome/browser/sync/syncable/syncable.h

Issue 8396022: [Sync] Add HasChildren() function and use it instead of GetFirstChildId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
Index: chrome/browser/sync/syncable/syncable.h
diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h
index 4f8875f92ddac46987a8a898a70f446fbde1fc8c..6bf46e5aaa2834cba713f76bc8a64a88f039f21f 100644
--- a/chrome/browser/sync/syncable/syncable.h
+++ b/chrome/browser/sync/syncable/syncable.h
@@ -920,9 +920,12 @@ class Directory {
void GetChildHandlesByHandle(BaseTransaction*, int64 handle,
ChildHandles* result);
+ // Returns true iff |id| has children.
rlarocque 2011/10/26 22:43:18 Should we mention that self-looped children are no
akalin 2011/10/27 00:19:21 I don't think so, since deleted == self-looped. H
+ bool HasChildren(BaseTransaction* trans, const Id& id);
+
// Find the first or last child in the positional ordering under a parent,
// and return its id. Returns a root Id if parent has no children.
- virtual Id GetFirstChildId(BaseTransaction* trans, const Id& parent_id);
+ Id GetFirstChildId(BaseTransaction* trans, const Id& parent_id);
Id GetLastChildId(BaseTransaction* trans, const Id& parent_id);
// Compute a local predecessor position for |update_item|. The position
@@ -1149,6 +1152,12 @@ class Directory {
const ScopedKernelLock& lock,
const Id& parent_id, Directory::ChildHandles* result);
+ // Returns a pointer to what is probably (but not certainly) the
+ // first child of |parent_id|, or NULL if |parent_id| definitely has
+ // no children.
+ EntryKernel* GetPossibleFirstChild(
+ const ScopedKernelLock& lock, const Id& parent_id);
+
Kernel* kernel_;
DirectoryBackingStore* store_;

Powered by Google App Engine
This is Rietveld 408576698