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

Issue 2844293003: Factor out UrlPatternIndex from IndexedRuleset. (Closed)

Created:
3 years, 7 months ago by pkalinnikov
Modified:
3 years, 7 months ago
Reviewers:
karandeepb, engedy
CC:
chromium-reviews, subresource-filter-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Factor out UrlPatternIndex from IndexedRuleset. This CL extracts the UrlPatternIndex class out of IndexedRuleset, and keeps the latter's implementation use the former as a building block. The new class can serve as a general-purpose tool for matching network requests against a set of URL rules. For example, it can be used by Declarative WebRequest API implementation. The follow-up step would be to cover UrlPatternIndex with tests and move it out from subresource_filter component to some generic place, e.g., components/url_matcher or components/url_pattern_index. BUG=713774 Review-Url: https://codereview.chromium.org/2844293003 Cr-Commit-Position: refs/heads/master@{#469618} Committed: https://chromium.googlesource.com/chromium/src/+/7a70ae843511b3e6d4f8a3924904fd3f7d1e0cba

Patch Set 1 #

Total comments: 31

Patch Set 2 : Address some comments from karandeepb@. #

Total comments: 47

Patch Set 3 : Address comments from engedy@. #

Patch Set 4 : Clean up. #

Total comments: 6

Patch Set 5 : Address final nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+347 lines, -876 lines) Patch
M components/subresource_filter/core/common/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M components/subresource_filter/core/common/PRESUBMIT.py View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/subresource_filter/core/common/document_subresource_filter_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M components/subresource_filter/core/common/flat/BUILD.gn View 1 chunk +2 lines, -1 line 0 comments Download
A components/subresource_filter/core/common/flat/indexed_ruleset.fbs View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
D components/subresource_filter/core/common/flat/rules.fbs View 1 chunk +0 lines, -104 lines 0 comments Download
A + components/subresource_filter/core/common/flat/url_pattern_index.fbs View 2 chunks +5 lines, -13 lines 0 comments Download
M components/subresource_filter/core/common/indexed_ruleset.h View 1 2 3 chunks +21 lines, -55 lines 0 comments Download
M components/subresource_filter/core/common/indexed_ruleset.cc View 1 2 3 chunks +32 lines, -542 lines 0 comments Download
M components/subresource_filter/core/common/indexed_ruleset_unittest.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M components/subresource_filter/core/common/url_pattern.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
A components/subresource_filter/core/common/url_pattern_index.h View 1 2 3 4 1 chunk +135 lines, -0 lines 0 comments Download
A + components/subresource_filter/core/common/url_pattern_index.cc View 1 2 3 12 chunks +120 lines, -158 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 41 (28 generated)
pkalinnikov
Balazs, PTAL. Do you think it's necessary to add UrlPatternIndex tests in this CL? Generally ...
3 years, 7 months ago (2017-04-27 16:07:24 UTC) #5
karandeepb
Thanks for working on this Pavel. Looks good. Have left some nits and questions. I ...
3 years, 7 months ago (2017-04-27 19:56:26 UTC) #8
pkalinnikov
Thanks Karan. Addressed all your comments except 2 so far. Yes, the next step would ...
3 years, 7 months ago (2017-04-28 10:06:50 UTC) #11
pkalinnikov
https://codereview.chromium.org/2844293003/diff/1/components/subresource_filter/core/common/indexed_ruleset.h File components/subresource_filter/core/common/indexed_ruleset.h (right): https://codereview.chromium.org/2844293003/diff/1/components/subresource_filter/core/common/indexed_ruleset.h#newcode36 components/subresource_filter/core/common/indexed_ruleset.h:36: static const int kIndexedFormatVersion; On 2017/04/27 19:56:25, karandeepb wrote: ...
3 years, 7 months ago (2017-04-28 16:53:08 UTC) #14
karandeepb
LGTM. Thanks! https://codereview.chromium.org/2844293003/diff/1/components/subresource_filter/core/common/indexed_ruleset.cc File components/subresource_filter/core/common/indexed_ruleset.cc (right): https://codereview.chromium.org/2844293003/diff/1/components/subresource_filter/core/common/indexed_ruleset.cc#newcode30 components/subresource_filter/core/common/indexed_ruleset.cc:30: if (!offset.o) On 2017/04/27 19:56:25, karandeepb wrote: ...
3 years, 7 months ago (2017-04-28 17:48:21 UTC) #15
engedy
LGTM % minor comments and nits. Great refactoring. Also quite painless, which is a testament ...
3 years, 7 months ago (2017-04-28 20:13:44 UTC) #16
pkalinnikov
Addressed all the comments (hopefully). Do you guys want to take another look? https://codereview.chromium.org/2844293003/diff/1/components/subresource_filter/core/common/indexed_ruleset.cc File ...
3 years, 7 months ago (2017-05-02 14:04:36 UTC) #17
karandeepb
Still LGTM.
3 years, 7 months ago (2017-05-02 17:33:34 UTC) #24
pkalinnikov
Thanks! Balazs, I'm waiting for a final sign-off from you.
3 years, 7 months ago (2017-05-04 16:49:01 UTC) #27
engedy
Still LGTM, couldn't resist some nits. :) https://codereview.chromium.org/2844293003/diff/20001/components/subresource_filter/core/common/url_pattern_index.h File components/subresource_filter/core/common/url_pattern_index.h (right): https://codereview.chromium.org/2844293003/diff/20001/components/subresource_filter/core/common/url_pattern_index.h#newcode105 components/subresource_filter/core/common/url_pattern_index.h:105: // - ...
3 years, 7 months ago (2017-05-05 08:00:16 UTC) #30
pkalinnikov
Done, thanks! Will submit as soon as the bots become happy. https://codereview.chromium.org/2844293003/diff/60001/components/subresource_filter/core/common/url_pattern_index.h File components/subresource_filter/core/common/url_pattern_index.h (right): ...
3 years, 7 months ago (2017-05-05 08:09:45 UTC) #33
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/2844293003/80001
3 years, 7 months ago (2017-05-05 09:13:18 UTC) #38
commit-bot: I haz the power
3 years, 7 months ago (2017-05-05 10:19:58 UTC) #41
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/7a70ae843511b3e6d4f8a3924904...

Powered by Google App Engine
This is Rietveld 408576698