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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 2367683002: Add metrics for paths in file scheme exceptions in content settings. (Closed)
Patch Set: Fix UMA name 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/content_settings/core/browser/host_content_settings_map.cc
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index 4779c643d4a2742508921be9e196896b29994d82..0e3f49fea1bfc19b6cd54567d3fd05b1ff4d790f 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -623,10 +623,28 @@ void HostContentSettingsMap::RecordExceptionMetrics() {
continue;
}
- UMA_HISTOGRAM_ENUMERATION("ContentSettings.ExceptionScheme",
- setting_entry.primary_pattern.GetScheme(),
+ ContentSettingsPattern::SchemeType scheme =
+ setting_entry.primary_pattern.GetScheme();
+ UMA_HISTOGRAM_ENUMERATION("ContentSettings.ExceptionScheme", scheme,
ContentSettingsPattern::SCHEME_MAX);
+ if (scheme == ContentSettingsPattern::SCHEME_FILE) {
+ UMA_HISTOGRAM_BOOLEAN("ContentSettings.ExceptionSchemeFile.HasPath",
+ setting_entry.primary_pattern.HasPath());
+ size_t num_values;
+ int histogram_value =
+ ContentSettingTypeToHistogramValue(content_type, &num_values);
+ if (setting_entry.primary_pattern.HasPath()) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "ContentSettings.ExceptionSchemeFile.Type.WithPath",
+ histogram_value, num_values);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION(
+ "ContentSettings.ExceptionSchemeFile.Type.WithoutPath",
+ histogram_value, num_values);
+ }
+ }
+
if (setting_entry.source == "preference")
++num_exceptions;
}

Powered by Google App Engine
This is Rietveld 408576698