Index: components/sync/driver/data_type_controller.h |
diff --git a/components/sync/driver/data_type_controller.h b/components/sync/driver/data_type_controller.h |
index d3ab89d9642ff232a0a913dadab98408dade2865..848a26d0091a702aec301902da913678e30d60cc 100644 |
--- a/components/sync/driver/data_type_controller.h |
+++ b/components/sync/driver/data_type_controller.h |
@@ -16,6 +16,7 @@ |
#include "components/sync/api/data_type_error_handler.h" |
#include "components/sync/base/model_type.h" |
#include "components/sync/base/unrecoverable_error_handler.h" |
+#include "components/sync/engine/cycle/status_counters.h" |
namespace syncer { |
@@ -70,6 +71,9 @@ class DataTypeController : public base::SupportsWeakPtr<DataTypeController> { |
std::unique_ptr<base::ListValue>)> |
AllNodesCallback; |
+ typedef base::Callback<void(ModelType, const StatusCounters&)> |
+ StatusCountersCallback; |
+ |
typedef std::map<ModelType, std::unique_ptr<DataTypeController>> TypeMap; |
typedef std::map<ModelType, DataTypeController::State> StateMap; |
@@ -146,6 +150,17 @@ class DataTypeController : public base::SupportsWeakPtr<DataTypeController> { |
// Used for populating nodes in Sync Node Browser of chrome://sync-internals. |
virtual void GetAllNodes(const AllNodesCallback& callback) = 0; |
+ // Collects StatusCounters for this datatype and passes them to |callback|. |
maxbogue
2016/10/06 17:16:32
"Collects StatusCounters for this datatype and pas
Gang Wu
2016/10/07 03:59:43
Done.
|
+ // |callback| should wrapped with syncer::BindToCurrentThread already. then we |
+ // can enforcing the asynchronous call for |callback|. Also, enforcing posting |
+ // |callback| back to UI thread even collecting StatusCounters on UI thread, |
+ // can prevent that results of ProfileSyncService::GetTypeStatusMap are |
+ // applied to UI before sync counters collected here. Otherwise results of |
+ // ProfileSyncService::GetTypeStatusMap will overwrite counters with empty |
+ // data. |
+ // Used for display counters in chrome://sync-internals. |
+ virtual void GetStatusCounters(const StatusCountersCallback& callback) = 0; |
+ |
protected: |
DataTypeController(ModelType type, const base::Closure& dump_stack); |