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

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

Issue 2375183002: Add metrics for paths in file scheme exceptions in content settings. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | components/content_settings/core/common/content_settings_pattern.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 afa1af23744522a7ffc222075f31745fa06b8453..6439d4e2cea59270b28ebd5c969ed4692c7820e3 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -621,10 +621,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;
}
« no previous file with comments | « no previous file | components/content_settings/core/common/content_settings_pattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698