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

Unified Diff: chrome/browser/sync/engine/syncapi.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/engine/syncapi.h
diff --git a/chrome/browser/sync/engine/syncapi.h b/chrome/browser/sync/engine/syncapi.h
index 5a0cacd0bbfc88dee355330e62b2df962965fbec..ad1e8d2ddf7187c8ada77d8d1d0731b25f6d0ea5 100644
--- a/chrome/browser/sync/engine/syncapi.h
+++ b/chrome/browser/sync/engine/syncapi.h
@@ -275,13 +275,13 @@ class BaseNode {
virtual const syncable::Entry* GetEntry() const = 0;
virtual const BaseTransaction* GetTransaction() const = 0;
- // Dumps all node info into a DictionaryValue and returns it.
+ // Dumps a summary of node info into a DictionaryValue and returns it.
// Transfers ownership of the DictionaryValue to the caller.
- DictionaryValue* ToValue() const;
+ DictionaryValue* GetSummaryAsValue() const;
- // 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 node details into a DictionaryValue and returns it.
+ // Transfers ownership of the DictionaryValue to the caller.
+ DictionaryValue* GetDetailsAsValue() const;
protected:
BaseNode();
@@ -971,39 +971,73 @@ class SyncManager {
void RemoveObserver(Observer* observer);
// Returns a pointer to the JsBackend (which is owned by the sync
- // manager). Never returns NULL. The following events are sent by
- // the returned backend:
- //
- // onNotificationStateChange({ enabled: (boolean) }):
- // Sent when notifications are enabled or disabled.
- //
- // onIncomingNotification({ changedTypes: (array) }):
- // Sent when an incoming notification arrives. |changedTypes|
- // is a list of sync types (strings) which have changed.
- //
- // The following messages are processed by the returned backend:
- //
- // getNotificationState():
- // callback(boolean notificationsEnabled):
- // notificationsEnabled: whether or not notifications are
- // enabled.
+ // manager). Never returns NULL. jsDocs for raised events are below:
+
+ /**
+ * @param {{ enabled: boolean }} details enabled is set to whether
+ * or not notifications are enabled.
+ */
+ // function onNotificationStateChange(details);
+
+ /**
+ * @param {{ changedTypes: Array.<string> }} details changedTypes is
+ * a list of types (as strings) for which there are new updates.
+ */
+ // function onIncomingNotification(details);
+
+ // jsDocs for handled messages are below (all other messages are
+ // ignored).
+
+ /**
+ * Gets the current notification state.
+ *
+ * @param {function(boolean)} callback Called with whether or not
+ * notifications are enabled.
+ */
+ // function getNotificationState(callback);
+
+ /**
+ * Gets details about the root node.
+ *
+ * @param {function(!Object)} callback Called with details about the
+ * root node.
+ */
+ // TODO(akalin): Change this to getRootNodeId or eliminate it
+ // entirely.
//
- // getRootNode():
- // callback(dictionary nodeInfo):
- // nodeInfo: Information on the root node.
- //
- // getNodesById(array idList):
- // idList: A list of IDs as strings.
- // callback(array nodeList):
- // nodeList: Information on each node for each valid id in
- // idList. Not guaranteed to be in any order.
- //
- // getChildNodeIds(string id):
- // id: The id of the node for which to return the child node ids.
- // callback(array idList):
- // idList: The child node IDs of the node with the given id.
- //
- // All other messages are dropped.
+ // function getRootNodeDetails(callback);
+
+ /**
+ * Gets summary information for a list of ids.
+ *
+ * @param {Array.<string>} idList List of 64-bit ids in decimal
+ * string form.
+ * @param {Array.<{id: string, title: string, isFolder: boolean}>}
+ * callback Called with summaries for the nodes in idList that
+ * exist.
+ */
+ // function getNodeSummariesById(idList, callback);
+
+ /**
+ * Gets detailed information for a list of ids.
+ *
+ * @param {Array.<string>} idList List of 64-bit ids in decimal
+ * string form.
+ * @param {Array.<!Object>} callback Called with detailed
+ * information for the nodes in idList that exist.
+ */
+ // function getNodeDetailsById(idList, callback);
+
+ /**
+ * Gets child ids for a given id.
+ *
+ * @param {string} id 64-bit id in decimal string form of the parent
+ * node.
+ * @param {Array.<string>} callback Called with the (possibly empty)
+ * list of child ids.
+ */
+ // function getChildNodeIds(id);
+
browser_sync::JsBackend* GetJsBackend();
// Status-related getters. Typically GetStatusSummary will suffice, but

Powered by Google App Engine
This is Rietveld 408576698