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

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

Issue 7033043: [Sync] Speed up sync node browser/search in about:sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 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
Index: chrome/browser/sync/syncable/syncable.h
diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h
index cace53e327a93e1d251231a2d5de470f94ce88ac..5b31201da3cc6e98d672d063b14d3e29f2d40b85 100644
--- a/chrome/browser/sync/syncable/syncable.h
+++ b/chrome/browser/sync/syncable/syncable.h
@@ -335,6 +335,10 @@ struct EntryKernel {
return id_fields[field - ID_FIELDS_BEGIN];
}
+ // Does a case in-sensitive search for a given string, which must be
+ // lower case.
+ bool ContainsString(const std::string& lowercase_query) const;
+
// Dumps all kernel info into a DictionaryValue and returns it.
// Transfers ownership of the DictionaryValue to the caller.
DictionaryValue* ToValue() const;
@@ -846,8 +850,14 @@ class Directory {
typedef EventChannel<DirectoryEventTraits, base::Lock> Channel;
typedef std::vector<int64> ChildHandles;
- // Returns the child meta handles for given parent id.
- void GetChildHandles(BaseTransaction*, const Id& parent_id,
+ // Returns the child meta handles for given parent id. Clears
+ // |result| if there are no children.
+ void GetChildHandlesById(BaseTransaction*, const Id& parent_id,
+ ChildHandles* result);
+
+ // Returns the child meta handles for given meta handle. Clears
+ // |result| if there are no children.
+ void GetChildHandlesByHandle(BaseTransaction*, int64 handle,
ChildHandles* result);
// Find the first or last child in the positional ordering under a parent,
@@ -873,6 +883,10 @@ class Directory {
// WARNING: THIS METHOD PERFORMS SYNCHRONOUS I/O VIA SQLITE.
bool SaveChanges();
+ // Fill in |result| with all entry kernels.
+ void GetAllEntryKernels(BaseTransaction* trans,
+ std::vector<const EntryKernel*>* result);
+
// Returns the number of entities with the unsynced bit set.
int64 unsynced_entity_count() const;
@@ -1072,6 +1086,11 @@ class Directory {
const ScopedKernelLock& lock,
const Id& parent_id);
+ // Append the handles of the children of |parent_id| to |result|.
+ void AppendChildHandles(
+ const ScopedKernelLock& lock,
+ const Id& parent_id, Directory::ChildHandles* result);
+
Kernel* kernel_;
DirectoryBackingStore* store_;

Powered by Google App Engine
This is Rietveld 408576698