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

Issue 9390018: Implementation of a Matching strategy for URLs in the Declarative WebRequest API. (Closed)

Created:
8 years, 10 months ago by battre
Modified:
8 years, 10 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip+watch_chromium.org
Visibility:
Public.

Description

Implementation of a Matching strategy for URLs in the Declarative WebRequest API. The Declarative WebRequest API needs to be able to match each outgoing URLRequest against a large set of rules. This CL lays the foundation for this. URLRequests can be matched using various criteria (e.g. "hostname ends in foobar.com", or "URL contains 'secret'", or both). In order to match many of these patterns very quickly we want to rely on the Aho-Corasick algorithm. This CL is one step before the A.-C. algorithm: It implements the reduction of URL Pattern matches to that of Substring matches. The SubstringSetMatcher is implemented trivially and will be replaced with a A.-C. implementation in a second CL. BUG=112155 TEST=no Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=122503

Patch Set 1 #

Total comments: 38

Patch Set 2 : Addressed specific feedback, no refactoring, yet #

Patch Set 3 : Refactored for memory improvements #

Total comments: 9

Patch Set 4 : Cleanup #

Total comments: 12

Patch Set 5 : Pacify clang and MSVC #

Total comments: 3

Patch Set 6 : Addressed comments, more fixes for MSVC and clang #

Patch Set 7 : MSVC does not support EXPECT_NE on iterators #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1592 lines, -1 line) Patch
A chrome/browser/extensions/api/declarative/substring_set_matcher.h View 1 2 3 4 5 1 chunk +81 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/declarative/substring_set_matcher.cc View 1 2 3 4 1 chunk +77 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/declarative/substring_set_matcher_unittest.cc View 1 2 3 4 5 6 1 chunk +160 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/declarative/url_matcher.h View 1 2 3 4 5 1 chunk +262 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/declarative/url_matcher.cc View 1 2 3 4 5 6 1 chunk +606 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/declarative/url_matcher_unittest.cc View 1 2 3 4 5 1 chunk +399 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 1 chunk +5 lines, -1 line 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
battre
Hi, may I ask you to review this CL, please? The CL is pretty large ...
8 years, 10 months ago (2012-02-13 21:39:26 UTC) #1
Matt Perry
How much memory do the EasyList strings take up? This implementation results in a lot ...
8 years, 10 months ago (2012-02-14 01:38:34 UTC) #2
battre
I will send a separate email for the refactoring. http://codereview.chromium.org/9390018/diff/1/chrome/browser/extensions/api/declarative/substring_set_matcher.cc File chrome/browser/extensions/api/declarative/substring_set_matcher.cc (right): http://codereview.chromium.org/9390018/diff/1/chrome/browser/extensions/api/declarative/substring_set_matcher.cc#newcode35 chrome/browser/extensions/api/declarative/substring_set_matcher.cc:35: ...
8 years, 10 months ago (2012-02-14 19:32:20 UTC) #3
battre
This is a refactored version of the CL that should safe a significant amount of ...
8 years, 10 months ago (2012-02-14 19:45:37 UTC) #4
Matt Perry
I think the transition to scoped_ptr and linked_ptr everywhere is unnecessary. SubstringPattern is the only ...
8 years, 10 months ago (2012-02-14 19:56:16 UTC) #5
Matt Perry
http://codereview.chromium.org/9390018/diff/6013/chrome/browser/extensions/api/declarative/url_matcher.h File chrome/browser/extensions/api/declarative/url_matcher.h (right): http://codereview.chromium.org/9390018/diff/6013/chrome/browser/extensions/api/declarative/url_matcher.h#newcode178 chrome/browser/extensions/api/declarative/url_matcher.h:178: PatternSingletons pattern_singletons_; Also, this should use a set, or ...
8 years, 10 months ago (2012-02-14 20:47:47 UTC) #6
battre
Still needs more polish, but the proposed modifications to use a base::hash_set in one place ...
8 years, 10 months ago (2012-02-14 21:56:42 UTC) #7
Matt Perry
There is a significant amount of logic to handle the case of identical SubstringPatterns. Do ...
8 years, 10 months ago (2012-02-14 23:52:25 UTC) #8
battre
Hi Matt, I have cleaned the CL. I think it is polished and feature complete ...
8 years, 10 months ago (2012-02-15 18:05:01 UTC) #9
Matt Perry
Getting close. http://codereview.chromium.org/9390018/diff/13001/chrome/browser/extensions/api/declarative/url_matcher.cc File chrome/browser/extensions/api/declarative/url_matcher.cc (right): http://codereview.chromium.org/9390018/diff/13001/chrome/browser/extensions/api/declarative/url_matcher.cc#newcode460 chrome/browser/extensions/api/declarative/url_matcher.cc:460: // Build the union of both result ...
8 years, 10 months ago (2012-02-15 22:45:17 UTC) #10
battre
http://codereview.chromium.org/9390018/diff/13001/chrome/browser/extensions/api/declarative/url_matcher.cc File chrome/browser/extensions/api/declarative/url_matcher.cc (right): http://codereview.chromium.org/9390018/diff/13001/chrome/browser/extensions/api/declarative/url_matcher.cc#newcode460 chrome/browser/extensions/api/declarative/url_matcher.cc:460: // Build the union of both result sets. On ...
8 years, 10 months ago (2012-02-16 14:45:55 UTC) #11
Matt Perry
LGTM. (Aaron said you can commit with just my LGTM. He'll take a look later.) ...
8 years, 10 months ago (2012-02-16 19:25:46 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/battre@chromium.org/9390018/22003
8 years, 10 months ago (2012-02-17 12:42:36 UTC) #13
commit-bot: I haz the power
8 years, 10 months ago (2012-02-17 14:05:45 UTC) #14
Change committed as 122503

Powered by Google App Engine
This is Rietveld 408576698