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

Unified Diff: sync/syncable/model_type.cc

Issue 12820010: sync: Define histogram ints for model types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove comment Created 7 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
« no previous file with comments | « sync/internal_api/public/base/model_type.h ('k') | sync/syncable/model_type_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/model_type.cc
diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc
index d6e145e3cf9fad0352e5fe7b2cf58492dc463aaf..37bdd361ac3abd2d86053cd7ca59cd08688cf9c9 100644
--- a/sync/syncable/model_type.cc
+++ b/sync/syncable/model_type.cc
@@ -449,6 +449,71 @@ const char* ModelTypeToString(ModelType model_type) {
return "INVALID";
}
+// The normal rules about histograms apply here. Always append to the bottom of
+// the list, and be careful to not reuse integer values that have already been
+// assigned. Don't forget to update histograms.xml when you make changes to
+// this list.
+int ModelTypeToHistogramInt(ModelType model_type) {
+ switch (model_type) {
+ case UNSPECIFIED:
+ return 0;
+ case TOP_LEVEL_FOLDER:
+ return 1;
+ case BOOKMARKS:
+ return 2;
+ case PREFERENCES:
+ return 3;
+ case PASSWORDS:
+ return 4;
+ case AUTOFILL_PROFILE:
+ return 5;
+ case AUTOFILL:
+ return 6;
+ case THEMES:
+ return 7;
+ case TYPED_URLS:
+ return 8;
+ case EXTENSIONS:
+ return 9;
+ case SEARCH_ENGINES:
+ return 10;
+ case SESSIONS:
+ return 11;
+ case APPS:
+ return 12;
+ case APP_SETTINGS:
+ return 13;
+ case EXTENSION_SETTINGS:
+ return 14;
+ case APP_NOTIFICATIONS:
+ return 15;
+ case HISTORY_DELETE_DIRECTIVES:
+ return 16;
+ case NIGORI:
+ return 17;
+ case DEVICE_INFO:
+ return 18;
+ case EXPERIMENTS:
+ return 19;
+ case SYNCED_NOTIFICATIONS:
+ return 20;
+ case PRIORITY_PREFERENCES:
+ return 21;
+ case DICTIONARY:
+ return 22;
+ case FAVICON_IMAGES:
+ return 23;
+ case FAVICON_TRACKING:
+ return 24;
+ case PROXY_TABS:
+ return 25;
+ // Silence a compiler warning.
+ case MODEL_TYPE_COUNT:
+ return 0;
+ }
+ return 0;
+}
+
base::StringValue* ModelTypeToValue(ModelType model_type) {
if (model_type >= FIRST_REAL_MODEL_TYPE) {
return new base::StringValue(ModelTypeToString(model_type));
« no previous file with comments | « sync/internal_api/public/base/model_type.h ('k') | sync/syncable/model_type_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698