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

Unified Diff: components/subresource_filter/core/common/indexed_ruleset.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/indexed_ruleset.h
diff --git a/components/subresource_filter/core/common/indexed_ruleset.h b/components/subresource_filter/core/common/indexed_ruleset.h
index 00588f8a0a76514dd8699da5e167fb5ff4c1a881..aea8712c64febe7ac6486a951fac80f3a0a900e4 100644
--- a/components/subresource_filter/core/common/indexed_ruleset.h
+++ b/components/subresource_filter/core/common/indexed_ruleset.h
@@ -82,6 +82,13 @@ class IndexedRulesetMatcher {
// |size|.
IndexedRulesetMatcher(const uint8_t* buffer, size_t size);
+ // Creates an instance that matches URLs against the flat::IndexedRuleset
+ // provided as the root object of serialized data in the |buffer| of the given
+ // |size|. Usage of rules will be recorded to |recorder|.
+ IndexedRulesetMatcher(const uint8_t* buffer,
+ size_t size,
+ std::unique_ptr<RuleRecorder> recorder);
+
// Returns whether the subset of subresource filtering rules specified by the
// |activation_type| should be disabled for the |document| loaded from
// |parent_document_origin|. Always returns false if |activation_type| ==
@@ -108,6 +115,8 @@ class IndexedRulesetMatcher {
UrlPatternIndexMatcher whitelist_;
UrlPatternIndexMatcher deactivation_;
+ std::unique_ptr<RuleRecorder> recorder_;
+
DISALLOW_COPY_AND_ASSIGN(IndexedRulesetMatcher);
};

Powered by Google App Engine
This is Rietveld 408576698