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

Unified Diff: components/subresource_filter/core/common/url_pattern_index.h

Issue 2894523006: Add instrumentation hooks to mesaure which subresource filter rules are used.
Patch Set: Created 3 years, 7 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/subresource_filter/core/common/url_pattern_index.h
diff --git a/components/subresource_filter/core/common/url_pattern_index.h b/components/subresource_filter/core/common/url_pattern_index.h
index 30224dce7680cf873b2d8697f285b67abd88ab5d..b08983071fec40dc126eaf530608a5ccd341e516 100644
--- a/components/subresource_filter/core/common/url_pattern_index.h
+++ b/components/subresource_filter/core/common/url_pattern_index.h
@@ -89,6 +89,13 @@ class UrlPatternIndexBuilder {
DISALLOW_COPY_AND_ASSIGN(UrlPatternIndexBuilder);
};
+// Need some way to inject ruleset reporting.
+class RuleRecorder {
+ public:
+ virtual void RecordRuleUsage(const flat::UrlRule* rule) = 0;
+ virtual ~RuleRecorder(){};
+};
+
// Encapsulates a read-only index built over the URL patterns of a set of URL
// rules, and provides fast matching of network requests against these rules.
class UrlPatternIndexMatcher {
@@ -121,7 +128,8 @@ class UrlPatternIndexMatcher {
proto::ElementType element_type,
proto::ActivationType activation_type,
bool is_third_party,
- bool disable_generic_rules) const;
+ bool disable_generic_rules,
+ RuleRecorder* recorder) const;
private:
// Must outlive this instance.

Powered by Google App Engine
This is Rietveld 408576698