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

Issue 2661433002: Introduce VerifiedRulesetDealer and its async Handle. (Closed)

Created:
3 years, 11 months ago by pkalinnikov
Modified:
3 years, 10 months ago
Reviewers:
engedy
CC:
chromium-reviews, jam, darin-cc_chromium.org, mlamouri+watch-content_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce VerifiedRulesetDealer and its async Handle. VerifiedRulesetDealer (VRD) is an non-thread-safe class that manages memory-mapping and distributing the ruleset like RulesetDealer, but additionally does integrity checking the first time before handing out a given version of the ruleset. VRD::Handle is a non-thread-safe counterpart of VRD that, regardless of the thread it lives on, associates an instance of VRD with a SequencedTaskRunner and provides asynchronous access to it using PostTask internally. Properties of the SequencedTaskRunner guarantee sequential ordering of the accesses. The VRD will usually live on a blocking pool thread because it does blocking IO, and the Handle facilitates accessing it from the UI thread. BUG=637415 Review-Url: https://codereview.chromium.org/2661433002 Cr-Commit-Position: refs/heads/master@{#447494} Committed: https://chromium.googlesource.com/chromium/src/+/ab97ff6908a975ddf24b72fef99d2539d8d43aa0

Patch Set 1 #

Patch Set 2 : Add forgotten files. #

Patch Set 3 : Clean-up. #

Total comments: 14

Patch Set 4 : Address comments; remove AsyncPtr; add unittests. #

Patch Set 5 : Add build dependency. #

Patch Set 6 : Add one more build dependency. #

Total comments: 6

Patch Set 7 : Minor changes; clean up unittest. #

Total comments: 29

Patch Set 8 : Address comments; add more tests. #

Total comments: 22

Patch Set 9 : Address more comments; refactor tests; add test. #

Total comments: 20

Patch Set 10 : Refactor tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+634 lines, -44 lines) Patch
M components/subresource_filter/content/browser/BUILD.gn View 1 2 3 4 5 3 chunks +5 lines, -0 lines 0 comments Download
A components/subresource_filter/content/browser/verified_ruleset_dealer.h View 1 2 3 4 5 6 7 8 1 chunk +92 lines, -0 lines 0 comments Download
A components/subresource_filter/content/browser/verified_ruleset_dealer.cc View 1 2 3 4 5 6 7 8 1 chunk +81 lines, -0 lines 0 comments Download
A components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +339 lines, -0 lines 0 comments Download
M components/subresource_filter/content/common/ruleset_dealer.h View 1 2 3 4 5 6 2 chunks +10 lines, -9 lines 0 comments Download
M components/subresource_filter/content/common/ruleset_dealer.cc View 1 2 3 4 5 6 1 chunk +8 lines, -2 lines 0 comments Download
M components/subresource_filter/content/common/ruleset_dealer_unittest.cc View 1 2 3 10 chunks +23 lines, -23 lines 0 comments Download
M components/subresource_filter/content/renderer/subresource_filter_agent.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/subresource_filter/core/common/test_ruleset_creator.h View 1 2 3 4 5 6 7 2 chunks +20 lines, -3 lines 0 comments Download
M components/subresource_filter/core/common/test_ruleset_creator.cc View 1 2 3 4 5 6 7 5 chunks +54 lines, -5 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 59 (43 generated)
pkalinnikov
Balazs, PTAL. I will add unittests for VerifiedRulesetDealer soon.
3 years, 11 months ago (2017-01-26 13:45:49 UTC) #6
engedy
Looking good, some initial comments. https://codereview.chromium.org/2661433002/diff/40001/components/subresource_filter/content/browser/verified_ruleset_dealer.h File components/subresource_filter/content/browser/verified_ruleset_dealer.h (right): https://codereview.chromium.org/2661433002/diff/40001/components/subresource_filter/content/browser/verified_ruleset_dealer.h#newcode34 components/subresource_filter/content/browser/verified_ruleset_dealer.h:34: // Memory maps the ...
3 years, 10 months ago (2017-01-27 09:47:11 UTC) #9
pkalinnikov
PTAL. https://codereview.chromium.org/2661433002/diff/40001/components/subresource_filter/content/browser/verified_ruleset_dealer.h File components/subresource_filter/content/browser/verified_ruleset_dealer.h (right): https://codereview.chromium.org/2661433002/diff/40001/components/subresource_filter/content/browser/verified_ruleset_dealer.h#newcode34 components/subresource_filter/content/browser/verified_ruleset_dealer.h:34: // Memory maps the subresource filtering ruleset file ...
3 years, 10 months ago (2017-01-27 18:12:24 UTC) #10
pkalinnikov
Please see patch#7.
3 years, 10 months ago (2017-01-30 10:53:45 UTC) #28
engedy
Flushing pending comments on older patchset. https://codereview.chromium.org/2661433002/diff/100001/components/subresource_filter/content/browser/verified_ruleset_dealer.h File components/subresource_filter/content/browser/verified_ruleset_dealer.h (right): https://codereview.chromium.org/2661433002/diff/100001/components/subresource_filter/content/browser/verified_ruleset_dealer.h#newcode42 components/subresource_filter/content/browser/verified_ruleset_dealer.h:42: class VerifiedRulesetDealer : ...
3 years, 10 months ago (2017-01-30 10:55:02 UTC) #29
engedy
Some more comments. https://codereview.chromium.org/2661433002/diff/120001/components/subresource_filter/content/browser/verified_ruleset_dealer.h File components/subresource_filter/content/browser/verified_ruleset_dealer.h (right): https://codereview.chromium.org/2661433002/diff/120001/components/subresource_filter/content/browser/verified_ruleset_dealer.h#newcode25 components/subresource_filter/content/browser/verified_ruleset_dealer.h:25: // State of the last ruleset ...
3 years, 10 months ago (2017-01-30 13:27:37 UTC) #32
engedy
Last set of comments, will take a final look afterwards. https://codereview.chromium.org/2661433002/diff/120001/components/subresource_filter/content/browser/verified_ruleset_dealer.cc File components/subresource_filter/content/browser/verified_ruleset_dealer.cc (right): https://codereview.chromium.org/2661433002/diff/120001/components/subresource_filter/content/browser/verified_ruleset_dealer.cc#newcode30 ...
3 years, 10 months ago (2017-01-30 15:59:34 UTC) #33
pkalinnikov
PTAL. Resolved all nits but the ones about friendship. https://codereview.chromium.org/2661433002/diff/100001/components/subresource_filter/content/browser/verified_ruleset_dealer.h File components/subresource_filter/content/browser/verified_ruleset_dealer.h (right): https://codereview.chromium.org/2661433002/diff/100001/components/subresource_filter/content/browser/verified_ruleset_dealer.h#newcode42 components/subresource_filter/content/browser/verified_ruleset_dealer.h:42: ...
3 years, 10 months ago (2017-01-30 17:14:12 UTC) #34
pkalinnikov
https://codereview.chromium.org/2661433002/diff/140001/components/subresource_filter/content/browser/verified_ruleset_dealer.h File components/subresource_filter/content/browser/verified_ruleset_dealer.h (right): https://codereview.chromium.org/2661433002/diff/140001/components/subresource_filter/content/browser/verified_ruleset_dealer.h#newcode27 components/subresource_filter/content/browser/verified_ruleset_dealer.h:27: // A ruleset file starts from the UNVERIFIED state, ...
3 years, 10 months ago (2017-01-30 17:26:06 UTC) #37
engedy
Looking great, LGTM % comments. Also, could you please point out in the second paragraph ...
3 years, 10 months ago (2017-01-31 13:10:56 UTC) #40
pkalinnikov
PTAL. Changed the way how test callbacks work. https://codereview.chromium.org/2661433002/diff/140001/components/subresource_filter/content/browser/verified_ruleset_dealer.cc File components/subresource_filter/content/browser/verified_ruleset_dealer.cc (right): https://codereview.chromium.org/2661433002/diff/140001/components/subresource_filter/content/browser/verified_ruleset_dealer.cc#newcode42 components/subresource_filter/content/browser/verified_ruleset_dealer.cc:42: if ...
3 years, 10 months ago (2017-02-01 09:22:28 UTC) #44
engedy
LGTM % nits and simplification suggestions. https://codereview.chromium.org/2661433002/diff/160001/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc File components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc (right): https://codereview.chromium.org/2661433002/diff/160001/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc#newcode47 components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc:47: testing::TestRuleset& indexed_1() { ...
3 years, 10 months ago (2017-02-01 10:09:33 UTC) #46
pkalinnikov
https://codereview.chromium.org/2661433002/diff/160001/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc File components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc (right): https://codereview.chromium.org/2661433002/diff/160001/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc#newcode47 components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc:47: testing::TestRuleset& indexed_1() { return test_ruleset_pair_1_.indexed; } On 2017/02/01 10:09:33, ...
3 years, 10 months ago (2017-02-01 11:00:02 UTC) #49
engedy
LGTM, thanks!
3 years, 10 months ago (2017-02-01 11:46:15 UTC) #52
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/2661433002/180001
3 years, 10 months ago (2017-02-01 12:54:40 UTC) #56
commit-bot: I haz the power
3 years, 10 months ago (2017-02-01 12:59:51 UTC) #59
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/ab97ff6908a975ddf24b72fef99d...

Powered by Google App Engine
This is Rietveld 408576698