summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/sync_manager_impl.h
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-07 20:30:34 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-07 20:30:34 +0000
commitc77435705b8f6a9173cdecc5e6eeb2f1911cc48a (patch)
tree8d1113110fed798c28e18124c68440baeaeed88d /sync/internal_api/sync_manager_impl.h
parente5af9bcbb29f9207de974e278e614ebc0609ea08 (diff)
downloadchromium_src-c77435705b8f6a9173cdecc5e6eeb2f1911cc48a.zip
chromium_src-c77435705b8f6a9173cdecc5e6eeb2f1911cc48a.tar.gz
chromium_src-c77435705b8f6a9173cdecc5e6eeb2f1911cc48a.tar.bz2
sync: Re-implement getAllNodes WebUI function
Removes the existing implementation of getAllNodes. This was the last function based on the old "makeSyncFunction" and "JsMessageHandler" interface, so its removal leaves behind quite a bit of dead code. This CL removes some of it. The rest will be removed in a future CL. Replaces it with some infrastructure intended to be more compatible with the future of sync, where each type is more independent. Requests to getAllNodes are routed through a DirectoryTypeDebugInfoEmitter in the ModelTypeRegistry. A NonBlockingTypeDebugInfoEmitter will be implemented in a future CL. The new system also intended to support "streaming" results. Rather than waiting for all types to return their nodes, the system could be modified to allow some types to get back to the JavaScript layer sooner than others so it can display results earlier. However, we do not currently take advantage of this functionality. The return type of getAllNodes is now an array of per-type objects, rather than one big list of nodes. This, too, should help us implement streaming support in the future. For now, most of the JavaScript callbacks will convert the data back to the old format before operating on it. BUG=328606 Review URL: https://codereview.chromium.org/224563004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl.h')
-rw-r--r--sync/internal_api/sync_manager_impl.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h
index f73a89d..52d382e 100644
--- a/sync/internal_api/sync_manager_impl.h
+++ b/sync/internal_api/sync_manager_impl.h
@@ -117,6 +117,8 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl :
virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE;
virtual ScopedVector<syncer::ProtocolEvent>
GetBufferedProtocolEvents() OVERRIDE;
+ virtual scoped_ptr<base::ListValue> GetAllNodesForType(
+ syncer::ModelType type) OVERRIDE;
// SyncEncryptionHandler::Observer implementation.
virtual void OnPassphraseRequired(
@@ -217,10 +219,6 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl :
base::TimeDelta GetNudgeDelayTimeDelta(const ModelType& model_type);
typedef std::map<ModelType, NotificationInfo> NotificationInfoMap;
- typedef JsArgList (SyncManagerImpl::*UnboundJsMessageHandler)(
- const JsArgList&);
- typedef base::Callback<JsArgList(const JsArgList&)> JsMessageHandler;
- typedef std::map<std::string, JsMessageHandler> JsMessageHandlerMap;
// Determine if the parents or predecessors differ between the old and new
// versions of an entry. Note that a node's index may change without its
@@ -266,16 +264,6 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl :
// Checks for server reachabilty and requests a nudge.
void OnNetworkConnectivityChangedImpl();
- // Helper function used only by the constructor.
- void BindJsMessageHandler(
- const std::string& name, UnboundJsMessageHandler unbound_message_handler);
-
- // JS message handlers.
- JsArgList GetAllNodes(const JsArgList& args);
- JsArgList GetNodeSummariesById(const JsArgList& args);
- JsArgList GetNodeDetailsById(const JsArgList& args);
- JsArgList GetChildNodeIds(const JsArgList& args);
-
syncable::Directory* directory();
base::FilePath database_path_;
@@ -351,7 +339,6 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl :
NotificationInfoMap notification_info_map_;
// These are for interacting with chrome://sync-internals.
- JsMessageHandlerMap js_message_handlers_;
JsSyncManagerObserver js_sync_manager_observer_;
JsMutationEventObserver js_mutation_event_observer_;
JsSyncEncryptionHandlerObserver js_sync_encryption_handler_observer_;