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

Unified Diff: components/content_settings/core/common/content_settings_pattern.cc

Issue 2367683002: 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
Index: components/content_settings/core/common/content_settings_pattern.cc
diff --git a/components/content_settings/core/common/content_settings_pattern.cc b/components/content_settings/core/common/content_settings_pattern.cc
index 348892e5d1523be701aa21a356b6aab3c60cb8c3..d27a128dc743de6977f4677985d4c34a91772891 100644
--- a/components/content_settings/core/common/content_settings_pattern.cc
+++ b/components/content_settings/core/common/content_settings_pattern.cc
@@ -614,6 +614,12 @@ ContentSettingsPattern::SchemeType ContentSettingsPattern::GetScheme() const {
return SCHEME_OTHER;
}
+bool ContentSettingsPattern::HasPath() const {
+ if (GetScheme() != SCHEME_FILE)
+ return false;
lshang 2016/09/26 01:57:13 How about using DCHECK here? Since HasPath() is on
alexmos 2016/09/26 23:40:24 Done.
+ return !parts_.is_path_wildcard && !parts_.path.empty();
+}
+
ContentSettingsPattern::Relation ContentSettingsPattern::Compare(
const ContentSettingsPattern& other) const {
// Two invalid patterns are identical in the way they behave. They don't match

Powered by Google App Engine
This is Rietveld 408576698