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

Unified Diff: chrome/browser/sync/glue/sync_backend_host_core.cc

Issue 224563004: sync: Re-implement getAllNodes WebUI function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix Created 6 years, 9 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/glue/sync_backend_host_core.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_core.cc b/chrome/browser/sync/glue/sync_backend_host_core.cc
index c49171a5404e2cd338542e4baeccd17a86f193af..c744f9893ce3cb96bb1fd8a793f2db2ce951867e 100644
--- a/chrome/browser/sync/glue/sync_backend_host_core.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_core.cc
@@ -640,6 +640,33 @@ void SyncBackendHostCore::DeleteSyncDataFolder() {
}
}
+void SyncBackendHostCore::GetAllNodesForTypes(
+ syncer::ModelTypeSet types,
+ scoped_refptr<base::SequencedTaskRunner> task_runner,
+ base::Callback<void(const std::vector<syncer::ModelType>& type,
+ ScopedVector<base::ListValue>)> callback) {
+ std::vector<syncer::ModelType> types_vector;
+ ScopedVector<base::ListValue> node_lists;
+
+ syncer::ModelSafeRoutingInfo routes;
+ registrar_->GetModelSafeRoutingInfo(&routes);
+ syncer::ModelTypeSet enabled_types = GetRoutingInfoTypes(routes);
+
+ for (syncer::ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) {
+ types_vector.push_back(it.Get());
+ if (!enabled_types.Has(it.Get())) {
+ node_lists.push_back(new base::ListValue());
+ } else {
+ node_lists.push_back(
+ sync_manager_->GetAllNodesForType(it.Get()).release());
+ }
+ }
+
+ task_runner->PostTask(
+ FROM_HERE,
+ base::Bind(callback, types_vector, base::Passed(&node_lists)));
+}
+
void SyncBackendHostCore::StartSavingChanges() {
// We may already be shut down.
if (!sync_loop_)
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_core.h ('k') | chrome/browser/sync/glue/sync_backend_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698