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

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

Issue 2793993002: [subresource_filter] Replace KMP by std::search. (Closed)
Patch Set: Address comments from csharrison@ Created 3 years, 8 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/test_ruleset_utils.h
diff --git a/components/subresource_filter/core/common/test_ruleset_utils.h b/components/subresource_filter/core/common/test_ruleset_utils.h
index ef7086502eafe1405b44af188eaf147ea0f3fcae..1b612f8dc4c8e8d6043f2d29ec0be844d426ddcd 100644
--- a/components/subresource_filter/core/common/test_ruleset_utils.h
+++ b/components/subresource_filter/core/common/test_ruleset_utils.h
@@ -15,8 +15,19 @@
namespace subresource_filter {
namespace testing {
+// Creates a simple blacklist URL rule from a |pattern| of a certain |type|. The
engedy 2017/04/05 10:55:11 This is used only by a single call site to create
pkalinnikov 2017/04/05 13:29:21 SGTM. However, such a rule would be considered uns
engedy 2017/04/05 13:41:33 Sounds good.
+// anchors of the rule's pattern are set to ANCHOR_TYPE_NONE, and the rule
+// targets all element types.
+proto::UrlRule CreateUrlRule(base::StringPiece pattern,
+ proto::UrlPatternType pattern_type);
+
+// Creates a blacklist URL rule which targets subresources of any type such that
engedy 2017/04/05 10:55:10 nit: ... such that the resource URL ends with |suf
pkalinnikov 2017/04/05 13:29:21 Done.
+// their URLs end with |suffix|.
proto::UrlRule CreateSuffixRule(base::StringPiece suffix);
+// Same as CreateUrlRule(pattern, proto::URL_PATTERN_TYPE_WILDCARDED), but the
+// rule applies to the specified |activation_types|, and to no element types.
+// Additionally, it is restricted to a set of |domains| (if provided).
proto::UrlRule CreateWhitelistRuleForDocument(
base::StringPiece pattern,
int32_t activation_types = proto::ACTIVATION_TYPE_DOCUMENT,

Powered by Google App Engine
This is Rietveld 408576698