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

Unified Diff: components/sync/engine_impl/model_type_registry.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/startup_controller.cc ('k') | components/sync/model/data_type_error_handler_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/model_type_registry.cc
diff --git a/components/sync/engine_impl/model_type_registry.cc b/components/sync/engine_impl/model_type_registry.cc
index bbdba9ea1b2a994221ea1658f699cf22e767850f..b31e201fd6ca1e02ce4d23408482240ed06769a5 100644
--- a/components/sync/engine_impl/model_type_registry.cc
+++ b/components/sync/engine_impl/model_type_registry.cc
@@ -122,17 +122,19 @@ void ModelTypeRegistry::ConnectNonBlockingType(
// TODO(crbug.com/658002): Store a pref before attempting migration
// indicating that it was attempted so we can avoid failure loops.
if (uss_migrator_.Run(type, user_share_, worker_ptr)) {
+ // TODO(wychen): enum uma should be strongly typed. crbug.com/661401
UMA_HISTOGRAM_ENUMERATION("Sync.USSMigrationSuccess",
ModelTypeToHistogramInt(type),
- MODEL_TYPE_COUNT);
+ static_cast<int>(MODEL_TYPE_COUNT));
// If we succesfully migrated, purge the directory of data for the type.
// Purging removes the directory's local copy of the data only.
directory()->PurgeEntriesWithTypeIn(ModelTypeSet(type), ModelTypeSet(),
ModelTypeSet());
} else {
+ // TODO(wychen): enum uma should be strongly typed. crbug.com/661401
UMA_HISTOGRAM_ENUMERATION("Sync.USSMigrationFailure",
ModelTypeToHistogramInt(type),
- MODEL_TYPE_COUNT);
+ static_cast<int>(MODEL_TYPE_COUNT));
}
}
« no previous file with comments | « components/sync/driver/startup_controller.cc ('k') | components/sync/model/data_type_error_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698