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

Unified Diff: components/sync/core/shared_model_type_processor.h

Issue 2319973003: [USS] Implement SharedModelTypeProcessor::GetAllNodes for USS (Closed)
Patch Set: change structure of the info a little bit Created 4 years, 3 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: components/sync/core/shared_model_type_processor.h
diff --git a/components/sync/core/shared_model_type_processor.h b/components/sync/core/shared_model_type_processor.h
index 20b80a0c6fd42a95875bfff788663d757a3dcbbe..4be1558bcfaf07f1b3f3c937916449c769017945 100644
--- a/components/sync/core/shared_model_type_processor.h
+++ b/components/sync/core/shared_model_type_processor.h
@@ -51,6 +51,15 @@ class SharedModelTypeProcessor : public ModelTypeProcessor,
// Returns true if the handshake with sync thread is complete.
bool IsConnected() const;
+ // Returns a ListValue representing all nodes for data type |type| through
+ // |callback| on this thread.
+ // Used for populating nodes in Sync Node Browser of chrome://sync-internals.
+ // TODO(gangwu): GetAllNodes could be in a helper class.
+ void GetAllNodes(
+ const scoped_refptr<base::TaskRunner>& task_runner,
+ const base::Callback<void(const syncer::ModelType type,
+ std::unique_ptr<base::ListValue>)>& callback);
+
// ModelTypeChangeProcessor implementation.
void Put(const std::string& storage_key,
std::unique_ptr<EntityData> entity_data,
@@ -143,6 +152,15 @@ class SharedModelTypeProcessor : public ModelTypeProcessor,
// Version of the above that generates a tag for |data|.
ProcessorEntityTracker* CreateEntity(const EntityData& data);
+ // This is callback function for ModelTypeService::GetAllData. This function
+ // will merge real data |batch| with metadata, then pass to |callback|.
+ void MergeDataWithMetadata(
+ const scoped_refptr<base::TaskRunner>& task_runner,
+ const base::Callback<void(const syncer::ModelType,
+ std::unique_ptr<base::ListValue>)>& callback,
+ syncer::SyncError error,
+ std::unique_ptr<DataBatch> batch);
+
const syncer::ModelType type_;
sync_pb::DataTypeState data_type_state_;

Powered by Google App Engine
This is Rietveld 408576698