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

Unified Diff: components/sync/driver/model_type_controller.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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
« no previous file with comments | « components/sync/driver/model_association_manager.cc ('k') | components/sync/driver/startup_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/model_type_controller.cc
diff --git a/components/sync/driver/model_type_controller.cc b/components/sync/driver/model_type_controller.cc
index 5f67856938aa6c7ece367f49599cad6dfae3b5ec..69f56b916830dad8405847b4af18ba539c176fd5 100644
--- a/components/sync/driver/model_type_controller.cc
+++ b/components/sync/driver/model_type_controller.cc
@@ -39,9 +39,10 @@ void ReportError(ModelType model_type,
scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
const ModelErrorHandler& error_handler,
const ModelError& error) {
+ // TODO(wychen): enum uma should be strongly typed. crbug.com/661401
UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures",
ModelTypeToHistogramInt(model_type),
- MODEL_TYPE_COUNT);
+ static_cast<int>(MODEL_TYPE_COUNT));
ui_thread->PostTask(error.location(), base::Bind(error_handler, error));
}
@@ -250,8 +251,10 @@ void ModelTypeController::ReportModelError(const ModelError& error) {
void ModelTypeController::RecordStartFailure(ConfigureResult result) const {
DCHECK(CalledOnValidThread());
+ // TODO(wychen): enum uma should be strongly typed. crbug.com/661401
UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures",
- ModelTypeToHistogramInt(type()), MODEL_TYPE_COUNT);
+ ModelTypeToHistogramInt(type()),
+ static_cast<int>(MODEL_TYPE_COUNT));
#define PER_DATA_TYPE_MACRO(type_str) \
UMA_HISTOGRAM_ENUMERATION("Sync." type_str "ConfigureFailure", result, \
MAX_CONFIGURE_RESULT);
« no previous file with comments | « components/sync/driver/model_association_manager.cc ('k') | components/sync/driver/startup_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698