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

Issue 2098233002: Implement matching of URL patterns. (Closed)

Created:
4 years, 5 months ago by pkalinnikov
Modified:
4 years, 5 months ago
Reviewers:
engedy
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@ruleset
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement matching of URL patterns. A compound Knuth-Morris-Pratt failure function is used to match URLs against the |pattern|. The |pattern| is split on the '*' wildcard symbol and then a failure function is built for each subpattern by BuildFailureFunctionFuzzy or BuildFailureFunction (depending on whether the subpattern contains separator placeholders), and appended to a vector. Some of the subpatterns can be exempted from being indexed. E.g., if the |pattern| has a BOUNDARY left anchor, the first subpattern can be matched by checking if it's a prefix of a URL. Each subpattern indexed with BuildFailureFunctionFuzzy is prepended with a value 1 (to distinguish them from the subpatterns indexed with BuildFailureFunction, their failure functions always start with 0). BUG=609747 Committed: https://crrev.com/15cf72498b6786b1f3f11b0b0695541484e50d0a Cr-Commit-Position: refs/heads/master@{#405098}

Patch Set 1 #

Total comments: 23

Patch Set 2 : Make the unittests code shorter. #

Patch Set 3 : Add dependency. #

Patch Set 4 : Address comments. #

Patch Set 5 : Fix int-to-bool cast warning. #

Patch Set 6 : Change comment. #

Patch Set 7 : Fix another cast warning. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+460 lines, -0 lines) Patch
M components/components_tests.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M components/subresource_filter.gypi View 1 chunk +4 lines, -0 lines 0 comments Download
M components/subresource_filter/core/common/BUILD.gn View 1 2 3 chunks +7 lines, -0 lines 0 comments Download
A components/subresource_filter/core/common/url_pattern.h View 1 2 3 1 chunk +53 lines, -0 lines 0 comments Download
A components/subresource_filter/core/common/url_pattern.cc View 1 2 3 4 1 chunk +76 lines, -0 lines 0 comments Download
A components/subresource_filter/core/common/url_pattern_matching.h View 1 2 3 4 5 1 chunk +61 lines, -0 lines 0 comments Download
A components/subresource_filter/core/common/url_pattern_matching.cc View 1 2 3 4 5 6 1 chunk +125 lines, -0 lines 0 comments Download
A components/subresource_filter/core/common/url_pattern_matching_unittest.cc View 1 1 chunk +133 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (18 generated)
pkalinnikov
PTAL.
4 years, 5 months ago (2016-07-12 13:28:36 UTC) #7
engedy
LGTM, thanks! I have added a comment to the text that you are also using ...
4 years, 5 months ago (2016-07-12 14:26:08 UTC) #10
pkalinnikov
PTAL again. https://codereview.chromium.org/2098233002/diff/40001/components/subresource_filter/core/common/url_pattern.h File components/subresource_filter/core/common/url_pattern.h (right): https://codereview.chromium.org/2098233002/diff/40001/components/subresource_filter/core/common/url_pattern.h#newcode21 components/subresource_filter/core/common/url_pattern.h:21: proto::UrlPatternType type = proto::URL_PATTERN_TYPE_UNSPECIFIED; On 2016/07/12 14:26:07, ...
4 years, 5 months ago (2016-07-12 14:48:13 UTC) #14
pkalinnikov
PTAL again.
4 years, 5 months ago (2016-07-12 14:48:17 UTC) #15
engedy
Still LGTM % comments. https://codereview.chromium.org/2098233002/diff/40001/components/subresource_filter/core/common/url_pattern_matching.h File components/subresource_filter/core/common/url_pattern_matching.h (right): https://codereview.chromium.org/2098233002/diff/40001/components/subresource_filter/core/common/url_pattern_matching.h#newcode39 components/subresource_filter/core/common/url_pattern_matching.h:39: // The URL |pattern| is ...
4 years, 5 months ago (2016-07-12 16:06:31 UTC) #17
pkalinnikov
https://codereview.chromium.org/2098233002/diff/40001/components/subresource_filter/core/common/url_pattern_matching.h File components/subresource_filter/core/common/url_pattern_matching.h (right): https://codereview.chromium.org/2098233002/diff/40001/components/subresource_filter/core/common/url_pattern_matching.h#newcode39 components/subresource_filter/core/common/url_pattern_matching.h:39: // The URL |pattern| is supposed to be normalized. ...
4 years, 5 months ago (2016-07-12 16:24:40 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2098233002/200001
4 years, 5 months ago (2016-07-12 17:03:44 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/261113)
4 years, 5 months ago (2016-07-12 17:45:48 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2098233002/200001
4 years, 5 months ago (2016-07-13 08:16:31 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:200001)
4 years, 5 months ago (2016-07-13 08:57:48 UTC) #27
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 08:57:51 UTC) #28
commit-bot: I haz the power
4 years, 5 months ago (2016-07-13 09:00:02 UTC) #30
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/15cf72498b6786b1f3f11b0b0695541484e50d0a
Cr-Commit-Position: refs/heads/master@{#405098}

Powered by Google App Engine
This is Rietveld 408576698