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

Issue 2683413003: Introduce AsyncDocumentSubresourceFilter. (Closed)

Created:
3 years, 10 months ago by pkalinnikov
Modified:
3 years, 10 months ago
CC:
blundell+watchlist_chromium.org, chromium-reviews, darin-cc_chromium.org, droger+watchlist_chromium.org, jam, melandory, sdefresne+watchlist_chromium.org, subresource-filter-reviews_chromium.org, jochen (gone - plz use gerrit)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce AsyncDocumentSubresourceFilter. AsyncDocumentSubresourceFilter (ADSF) is an asynchronous wrapper around DocumentSubresourceFilter (DSF). When ADSF is constructed, it creates an ADSF::Core and initializes it asynchronously on a SequencedTaskRunner using the supplied initialization |params| and a VerifiedRuleset. The task runner and VerifiedRuleset are taken from VerifiedRuleset::Handle provided to the constructor. ADSF::Core remains owned by ADSF, but lives on (and is accessed on) the task runner. During ADSF::Core initialization an ActivationState for the current frame is calculated, and then reported back via |activation_state_callback| on the task runner associated with the ADSF creator's thread (normally, the UI thread). If MemoryMappedRuleset is not present or malformed, then a default ActivationState is reported (with ActivationLevel equal to DISABLED). Although the full initialization of ADSF/ADSF::Core is asynchronous, the properties of SequencedTaskRunner allow the ADSF instance to be immediately used after construction. The key purpose of ADSF is providing decisions on whether to allow loading subframes for the current frame. The GetLoadPolicyForSubdocument async method serves this purpose, and boils down to calling the GetLoadPolicy method of DSF on the task runner and returning the result to the caller's task runner. BUG=637415 Review-Url: https://codereview.chromium.org/2683413003 Cr-Commit-Position: refs/heads/master@{#451648} Committed: https://chromium.googlesource.com/chromium/src/+/3e809d1f60ee19d1021842752704717001f1e0b4

Patch Set 1 #

Total comments: 14

Patch Set 2 : Address initial comments from engedy@. #

Patch Set 3 : Add unittests. #

Patch Set 4 : Add first_disallowed_load_callback to ADSF. #

Total comments: 6

Patch Set 5 : Distinguish main-frame and subframe ADSF initialization params. #

Total comments: 7

Patch Set 6 : Address comments from csharrison@. #

Total comments: 45

Patch Set 7 : Address more comments from engedy@. #

Total comments: 4

Patch Set 8 : Address comments from jochen@. #

Patch Set 9 : Fix build. #

Patch Set 10 : Fix blink tests build. #

Patch Set 11 : Fix fix blink test build. #

Total comments: 4

Patch Set 12 : Rebase and clean up. #

Patch Set 13 : Rebase. #

Messages

Total messages: 99 (69 generated)
pkalinnikov
Balazs, please take an initial look. I will add tests a bit later.
3 years, 10 months ago (2017-02-10 14:06:28 UTC) #4
engedy
Some initial comments. https://codereview.chromium.org/2683413003/diff/1/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/1/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode21 components/subresource_filter/content/browser/async_document_subresource_filter.h:21: // ADSF is an asynchronous version ...
3 years, 10 months ago (2017-02-10 14:31:59 UTC) #5
pkalinnikov
Addressed initial comments. https://codereview.chromium.org/2683413003/diff/1/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/1/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode21 components/subresource_filter/content/browser/async_document_subresource_filter.h:21: // ADSF is an asynchronous version ...
3 years, 10 months ago (2017-02-10 15:15:14 UTC) #9
pkalinnikov
PTAL.
3 years, 10 months ago (2017-02-13 13:47:49 UTC) #19
Charlie Harrison
Quick request for comment https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode38 components/subresource_filter/content/browser/async_document_subresource_filter.h:38: struct InitializationParams { From looking ...
3 years, 10 months ago (2017-02-13 14:15:45 UTC) #21
pkalinnikov
https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode38 components/subresource_filter/content/browser/async_document_subresource_filter.h:38: struct InitializationParams { On 2017/02/13 14:15:45, Charlie Harrison wrote: ...
3 years, 10 months ago (2017-02-13 14:22:50 UTC) #22
pkalinnikov
https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode38 components/subresource_filter/content/browser/async_document_subresource_filter.h:38: struct InitializationParams { On 2017/02/13 14:22:50, pkalinnikov wrote: > ...
3 years, 10 months ago (2017-02-13 14:27:39 UTC) #23
Charlie Harrison
https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode38 components/subresource_filter/content/browser/async_document_subresource_filter.h:38: struct InitializationParams { On 2017/02/13 14:27:39, pkalinnikov wrote: > ...
3 years, 10 months ago (2017-02-13 14:33:59 UTC) #24
pkalinnikov
PTAL again. Charlie, feel free to review the whole CL. https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode38 ...
3 years, 10 months ago (2017-02-13 15:26:49 UTC) #29
Charlie Harrison
Generally this CL lgtm, thanks for the quick responses https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h File components/subresource_filter/content/browser/async_document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/60001/components/subresource_filter/content/browser/async_document_subresource_filter.h#newcode38 components/subresource_filter/content/browser/async_document_subresource_filter.h:38: ...
3 years, 10 months ago (2017-02-13 16:00:40 UTC) #32
Charlie Harrison
A few nits and one thing I caught using this class in unit tests. https://codereview.chromium.org/2683413003/diff/80001/components/subresource_filter/content/browser/async_document_subresource_filter.cc ...
3 years, 10 months ago (2017-02-13 20:07:50 UTC) #33
pkalinnikov
Addressed. Thanks! https://codereview.chromium.org/2683413003/diff/80001/components/subresource_filter/content/browser/async_document_subresource_filter.cc File components/subresource_filter/content/browser/async_document_subresource_filter.cc (right): https://codereview.chromium.org/2683413003/diff/80001/components/subresource_filter/content/browser/async_document_subresource_filter.cc#newcode131 components/subresource_filter/content/browser/async_document_subresource_filter.cc:131: filter_.emplace(url::Origin(params.document_url), activation_state, ruleset, On 2017/02/13 20:07:50, Charlie ...
3 years, 10 months ago (2017-02-14 09:31:07 UTC) #36
Charlie Harrison
https://codereview.chromium.org/2683413003/diff/80001/components/subresource_filter/content/browser/async_document_subresource_filter.cc File components/subresource_filter/content/browser/async_document_subresource_filter.cc (right): https://codereview.chromium.org/2683413003/diff/80001/components/subresource_filter/content/browser/async_document_subresource_filter.cc#newcode131 components/subresource_filter/content/browser/async_document_subresource_filter.cc:131: filter_.emplace(url::Origin(params.document_url), activation_state, ruleset, On 2017/02/14 09:31:07, pkalinnikov wrote: > ...
3 years, 10 months ago (2017-02-14 13:07:40 UTC) #39
engedy
Looks great, thanks! LGTM % one or two comments, and some nits and wordsmithing. https://codereview.chromium.org/2683413003/diff/100001/components/subresource_filter/content/browser/async_document_subresource_filter.cc ...
3 years, 10 months ago (2017-02-14 15:13:14 UTC) #40
pkalinnikov
Addressed, thanks! engedy@: The are couple of questions. PTAL. csharrison@: There is one question for ...
3 years, 10 months ago (2017-02-14 18:47:14 UTC) #43
Charlie Harrison
https://codereview.chromium.org/2683413003/diff/100001/components/subresource_filter/content/browser/async_document_subresource_filter.cc File components/subresource_filter/content/browser/async_document_subresource_filter.cc (right): https://codereview.chromium.org/2683413003/diff/100001/components/subresource_filter/content/browser/async_document_subresource_filter.cc#newcode53 components/subresource_filter/content/browser/async_document_subresource_filter.cc:53: VerifiedRuleset::Handle* ruleset_handle, On 2017/02/14 18:47:13, pkalinnikov wrote: > On ...
3 years, 10 months ago (2017-02-14 19:31:06 UTC) #44
engedy
Still LGTM, thanks! See replies below. https://codereview.chromium.org/2683413003/diff/100001/components/subresource_filter/content/browser/async_document_subresource_filter.cc File components/subresource_filter/content/browser/async_document_subresource_filter.cc (right): https://codereview.chromium.org/2683413003/diff/100001/components/subresource_filter/content/browser/async_document_subresource_filter.cc#newcode53 components/subresource_filter/content/browser/async_document_subresource_filter.cc:53: VerifiedRuleset::Handle* ruleset_handle, On ...
3 years, 10 months ago (2017-02-14 20:33:31 UTC) #47
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/2683413003/120001
3 years, 10 months ago (2017-02-14 20:42:17 UTC) #51
pkalinnikov
Jochen, please review the added DEPS from "third_party/WebKit/public/platform".
3 years, 10 months ago (2017-02-15 09:12:14 UTC) #54
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2683413003/diff/120001/components/subresource_filter/content/browser/DEPS File components/subresource_filter/content/browser/DEPS (right): https://codereview.chromium.org/2683413003/diff/120001/components/subresource_filter/content/browser/DEPS#newcode5 components/subresource_filter/content/browser/DEPS:5: "+third_party/WebKit/public/platform", please only depend on individual headers https://codereview.chromium.org/2683413003/diff/120001/components/subresource_filter/content/browser/async_document_subresource_filter.h File ...
3 years, 10 months ago (2017-02-15 10:32:11 UTC) #55
pkalinnikov
Jochen, PTAL again. https://codereview.chromium.org/2683413003/diff/120001/components/subresource_filter/content/browser/DEPS File components/subresource_filter/content/browser/DEPS (right): https://codereview.chromium.org/2683413003/diff/120001/components/subresource_filter/content/browser/DEPS#newcode5 components/subresource_filter/content/browser/DEPS:5: "+third_party/WebKit/public/platform", On 2017/02/15 10:32:10, jochen wrote: ...
3 years, 10 months ago (2017-02-15 11:47:40 UTC) #58
pkalinnikov
On 2017/02/15 11:47:40, pkalinnikov wrote: > Jochen, PTAL again. > > https://codereview.chromium.org/2683413003/diff/120001/components/subresource_filter/content/browser/DEPS > File components/subresource_filter/content/browser/DEPS ...
3 years, 10 months ago (2017-02-16 10:56:31 UTC) #73
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2683413003/diff/200001/components/subresource_filter/content/common/document_subresource_filter.h File components/subresource_filter/content/common/document_subresource_filter.h (right): https://codereview.chromium.org/2683413003/diff/200001/components/subresource_filter/content/common/document_subresource_filter.h#newcode24 components/subresource_filter/content/common/document_subresource_filter.h:24: #include "third_party/WebKit/public/platform/WebDocumentSubresourceFilterLoadPolicy.h" please change subresource_filter/content/common/DEPS to enumerate individual webkit ...
3 years, 10 months ago (2017-02-16 14:46:21 UTC) #74
pkalinnikov
Balazs, can you make a final round? Jochen, I managed to get rid of the ...
3 years, 10 months ago (2017-02-17 17:51:38 UTC) #80
pkalinnikov
Guys, please disregard patchsets 8-11.
3 years, 10 months ago (2017-02-17 17:52:25 UTC) #81
engedy
Thanks for cleaning up the dependencies, Pavel. LGTM.
3 years, 10 months ago (2017-02-20 12:51:12 UTC) #84
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/2683413003/240001
3 years, 10 months ago (2017-02-20 12:52:03 UTC) #87
commit-bot: I haz the power
Failed to apply patch for components/subresource_filter/content/browser/BUILD.gn: While running git apply --index -p1; error: patch failed: ...
3 years, 10 months ago (2017-02-20 13:56:52 UTC) #89
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/2683413003/260001
3 years, 10 months ago (2017-02-20 16:53:20 UTC) #96
commit-bot: I haz the power
3 years, 10 months ago (2017-02-20 17:58:56 UTC) #99
Message was sent while issue was closed.
Committed patchset #13 (id:260001) as
https://chromium.googlesource.com/chromium/src/+/3e809d1f60ee19d1021842752704...

Powered by Google App Engine
This is Rietveld 408576698