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

Issue 2844063002: Add support for multiple simultaneous subresource_filter::Configurations. (Closed)

Created:
3 years, 7 months ago by engedy
Modified:
3 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, grt+watch_chromium.org, jam, subresource-filter-reviews_chromium.org, timvolodine, vakh+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for multiple simultaneous subresource_filter::Configurations. Also introduce the concept of presets, which will be used in a follow-up CL to enable the feature on phishing sites by default. BUG=708181 Review-Url: https://codereview.chromium.org/2844063002 Cr-Commit-Position: refs/heads/master@{#470559} Committed: https://chromium.googlesource.com/chromium/src/+/610e540fa3179c3a5ed8eb91b7d48e935c67d86d

Patch Set 1 : Correct base. #

Patch Set 2 : Minimal polish, still missing unittests for multiple simultaneous configs. #

Total comments: 6

Patch Set 3 : Further tests. #

Patch Set 4 : Polish + rebase. #

Total comments: 61

Patch Set 5 : Addressed all comments except traces and refactoring. #

Patch Set 6 : Rebase. #

Total comments: 3

Patch Set 7 : Fix compile error. #

Total comments: 2

Patch Set 8 : Tests + polish. #

Patch Set 9 : Comment typo. #

Patch Set 10 : Comment nit. #

Total comments: 16

Patch Set 11 : Fix unit_tests. #

Patch Set 12 : Add tests for disabled presets. #

Patch Set 13 : Polish factory_unittests. #

Patch Set 14 : Addressed comments from csharrison@. #

Total comments: 10

Patch Set 15 : Address all comments. #

Total comments: 2

Patch Set 16 : Addressed nit from sorin@. #

Patch Set 17 : Rebase. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1017 lines, -347 lines) Patch
M chrome/browser/component_updater/subresource_filter_component_installer.h View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/component_updater/subresource_filter_component_installer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +38 lines, -17 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc View 1 2 3 2 chunks +4 lines, -8 lines 0 comments Download
M chrome/browser/subresource_filter/chrome_subresource_filter_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/subresource_filter/subresource_filter_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -6 lines 0 comments Download
M chrome/browser/subresource_filter/subresource_filter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +5 lines, -2 lines 0 comments Download
M components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +36 lines, -11 lines 0 comments Download
M components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +77 lines, -65 lines 2 comments Download
M components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 21 chunks +99 lines, -69 lines 0 comments Download
M components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc View 1 2 3 4 5 6 7 4 chunks +4 lines, -4 lines 0 comments Download
M components/subresource_filter/core/browser/subresource_filter_features.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +122 lines, -42 lines 0 comments Download
M components/subresource_filter/core/browser/subresource_filter_features.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +232 lines, -47 lines 0 comments Download
M components/subresource_filter/core/browser/subresource_filter_features_test_support.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +20 lines, -6 lines 0 comments Download
M components/subresource_filter/core/browser/subresource_filter_features_test_support.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +47 lines, -10 lines 0 comments Download
M components/subresource_filter/core/browser/subresource_filter_features_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +313 lines, -48 lines 0 comments Download
M components/subresource_filter/core/common/activation_scope.h View 1 chunk +1 line, -1 line 0 comments Download
M testing/variations/fieldtrial_testing_config.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -3 lines 0 comments Download
M tools/metrics/histograms/enums.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 108 (70 generated)
engedy
Charlie, this is severely lacking unittests, but could you please take a high-level look at ...
3 years, 7 months ago (2017-04-26 20:58:57 UTC) #7
engedy
On 2017/04/26 20:58:57, engedy wrote: > Charlie, this is severely lacking unittests, but could you ...
3 years, 7 months ago (2017-04-26 20:59:20 UTC) #8
Charlie Harrison
Oh man does this code make me nervous :P I think this deserves some major ...
3 years, 7 months ago (2017-04-26 21:28:11 UTC) #9
engedy
Addressed comments, added a whole bunch of comments and tests, and made things more readable. ...
3 years, 7 months ago (2017-05-03 12:04:46 UTC) #18
engedy
+Pavel, PTAL as well.
3 years, 7 months ago (2017-05-03 12:12:59 UTC) #21
Charlie Harrison
Since driver factory is going away do you think we could implement the tests in ...
3 years, 7 months ago (2017-05-03 12:15:29 UTC) #22
engedy
On 2017/05/03 12:15:29, Charlie Harrison wrote: > Since driver factory is going away do you ...
3 years, 7 months ago (2017-05-03 12:29:21 UTC) #23
Charlie Harrison
Flushing some initial comments. https://codereview.chromium.org/2844063002/diff/80001/chrome/browser/component_updater/subresource_filter_component_installer.cc File chrome/browser/component_updater/subresource_filter_component_installer.cc (right): https://codereview.chromium.org/2844063002/diff/80001/chrome/browser/component_updater/subresource_filter_component_installer.cc#newcode122 chrome/browser/component_updater/subresource_filter_component_installer.cc:122: // In addition to "", ...
3 years, 7 months ago (2017-05-03 14:52:18 UTC) #26
pkalinnikov
Added some comments. On a high level, do we really need that complicated priority system? ...
3 years, 7 months ago (2017-05-04 12:04:22 UTC) #27
Charlie Harrison
I tend to agree with Pavel here, the priority system should be as simple as ...
3 years, 7 months ago (2017-05-04 12:39:22 UTC) #28
engedy
All done except the refactoring and TRACE_EVENTs. Please take another look. https://codereview.chromium.org/2844063002/diff/80001/chrome/browser/component_updater/subresource_filter_component_installer.cc File chrome/browser/component_updater/subresource_filter_component_installer.cc (right): ...
3 years, 7 months ago (2017-05-05 12:25:43 UTC) #31
Charlie Harrison
https://codereview.chromium.org/2844063002/diff/80001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h File components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h (right): https://codereview.chromium.org/2844063002/diff/80001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h#newcode160 components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h:160: // The activation decision corresponding to the most recently ...
3 years, 7 months ago (2017-05-05 13:12:53 UTC) #38
engedy
https://codereview.chromium.org/2844063002/diff/140001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc (right): https://codereview.chromium.org/2844063002/diff/140001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc#newcode112 components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc:112: if (decision == ActivationDecision::ACTIVATED) { On 2017/05/05 13:12:52, Charlie ...
3 years, 7 months ago (2017-05-05 13:21:24 UTC) #39
pkalinnikov
Quick responses. Will do another round later. https://codereview.chromium.org/2844063002/diff/80001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc (right): https://codereview.chromium.org/2844063002/diff/80001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc#newcode127 components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc:127: // Remember ...
3 years, 7 months ago (2017-05-05 13:29:59 UTC) #40
Charlie Harrison
https://codereview.chromium.org/2844063002/diff/80001/components/subresource_filter/core/browser/subresource_filter_features.h File components/subresource_filter/core/browser/subresource_filter_features.h (right): https://codereview.chromium.org/2844063002/diff/80001/components/subresource_filter/core/browser/subresource_filter_features.h#newcode78 components/subresource_filter/core/browser/subresource_filter_features.h:78: On 2017/05/05 13:29:58, pkalinnikov wrote: > On 2017/05/05 12:25:42, ...
3 years, 7 months ago (2017-05-05 14:00:08 UTC) #43
engedy
Charlie, please take another look. Presets can now be disabled, and it is also possible ...
3 years, 7 months ago (2017-05-05 19:24:12 UTC) #48
engedy
*its*
3 years, 7 months ago (2017-05-05 19:25:09 UTC) #49
engedy
Also, this is getting too big already, let's do add the TRACE's in a follow-up ...
3 years, 7 months ago (2017-05-05 19:29:26 UTC) #50
Charlie Harrison
This generally looks good, I think the new logic is much easier to comprehend https://codereview.chromium.org/2844063002/diff/200001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc ...
3 years, 7 months ago (2017-05-05 21:16:38 UTC) #55
engedy
PTAL. https://codereview.chromium.org/2844063002/diff/200001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc (right): https://codereview.chromium.org/2844063002/diff/200001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc#newcode117 components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc:117: [url, this](const Configuration& config) { On 2017/05/05 21:16:37, ...
3 years, 7 months ago (2017-05-05 21:31:53 UTC) #59
Charlie Harrison
This generally LGTM but let's wait for Pavel to review too. Also, let's make sure ...
3 years, 7 months ago (2017-05-05 21:52:51 UTC) #61
pkalinnikov
LGTM % nits. https://codereview.chromium.org/2844063002/diff/280001/components/subresource_filter/core/browser/subresource_filter_features.cc File components/subresource_filter/core/browser/subresource_filter_features.cc (right): https://codereview.chromium.org/2844063002/diff/280001/components/subresource_filter/core/browser/subresource_filter_features.cc#newcode44 components/subresource_filter/core/browser/subresource_filter_features.cc:44: return !!std::count_if(pieces_.begin(), pieces_.end(), predicate); nit: Could ...
3 years, 7 months ago (2017-05-08 11:48:43 UTC) #64
engedy
All done, please take a final look. https://codereview.chromium.org/2844063002/diff/200001/components/subresource_filter/core/browser/subresource_filter_features.h File components/subresource_filter/core/browser/subresource_filter_features.h (right): https://codereview.chromium.org/2844063002/diff/200001/components/subresource_filter/core/browser/subresource_filter_features.h#newcode45 components/subresource_filter/core/browser/subresource_filter_features.h:45: // filtering ...
3 years, 7 months ago (2017-05-08 14:40:20 UTC) #68
engedy
Dear owners, please review: @Sorin: c/b/component_updater/subresource_filter_component_installer* @Alexei: testing/variations/fieldtrial_testing_config.json @Nathan: c/b/safe_browsing/safe_browsing_service_browsertest.cc
3 years, 7 months ago (2017-05-08 14:42:02 UTC) #70
Alexei Svitkine (slow)
lgtm
3 years, 7 months ago (2017-05-08 15:43:56 UTC) #76
pkalinnikov
LGTM.
3 years, 7 months ago (2017-05-08 15:49:35 UTC) #77
Sorin Jianu
lgtm Thank you! component updater lgtm https://codereview.chromium.org/2844063002/diff/320001/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc File chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc (right): https://codereview.chromium.org/2844063002/diff/320001/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc#newcode90 chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc:90: std::string ruleset_flavor) { ...
3 years, 7 months ago (2017-05-09 01:49:08 UTC) #80
engedy
https://codereview.chromium.org/2844063002/diff/320001/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc File chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc (right): https://codereview.chromium.org/2844063002/diff/320001/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc#newcode90 chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc:90: std::string ruleset_flavor) { On 2017/05/09 01:49:08, Sorin Jianu wrote: ...
3 years, 7 months ago (2017-05-09 11:39:35 UTC) #90
engedy
@Nathan, friendly ping.
3 years, 7 months ago (2017-05-09 21:33:45 UTC) #94
Nathan Parker
safe_browsing* LGTM
3 years, 7 months ago (2017-05-09 21:44:32 UTC) #95
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/2844063002/360001
3 years, 7 months ago (2017-05-10 13:08:59 UTC) #98
commit-bot: I haz the power
Committed patchset #17 (id:360001) as https://chromium.googlesource.com/chromium/src/+/610e540fa3179c3a5ed8eb91b7d48e935c67d86d
3 years, 7 months ago (2017-05-10 14:16:50 UTC) #101
Bryan McQuade
https://codereview.chromium.org/2844063002/diff/360001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc (right): https://codereview.chromium.org/2844063002/diff/360001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc#newcode107 components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc:107: if (!url.SchemeIsHTTPOrHTTPS()) { looking at this now, does this ...
3 years, 7 months ago (2017-05-17 13:55:49 UTC) #103
engedy
https://codereview.chromium.org/2844063002/diff/360001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc File components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc (right): https://codereview.chromium.org/2844063002/diff/360001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc#newcode107 components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc:107: if (!url.SchemeIsHTTPOrHTTPS()) { On 2017/05/17 13:55:48, Bryan McQuade wrote: ...
3 years, 7 months ago (2017-05-17 14:21:41 UTC) #104
Bryan McQuade
On 2017/05/17 at 14:21:41, engedy wrote: > https://codereview.chromium.org/2844063002/diff/360001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc > File components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc (right): > > https://codereview.chromium.org/2844063002/diff/360001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc#newcode107 ...
3 years, 7 months ago (2017-05-17 14:23:27 UTC) #105
Charlie Harrison
On 2017/05/17 14:21:41, engedy wrote: > https://codereview.chromium.org/2844063002/diff/360001/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc > File > components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc > (right): > > ...
3 years, 7 months ago (2017-05-17 14:28:34 UTC) #106
engedy
> We want to know how often urls are whitelisted, since this helps us to ...
3 years, 7 months ago (2017-05-17 14:29:57 UTC) #107
engedy
3 years, 7 months ago (2017-05-17 14:33:52 UTC) #108
Message was sent while issue was closed.
> engedy: What about just returning this activation decision if at least one
> configuration matched?

That's somewhat unfortunate, as activation-list-scoped configs will never match
(once we add the extra check), so if you navigate to a site with non-HTTP(s)
scheme, we a different enum would be recorded based on whether the non-matching
config was ALL_SITES or ACTIVATION_LIST. But if we can live with that, I'm fine
with it.

Powered by Google App Engine
This is Rietveld 408576698