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

Issue 2669833004: Refactor subresource filter activation to support PlzNavigate cleanly. (Closed)

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

Description

Refactor subresource filter activation to support PlzNavigate cleanly. In a pre-PlzNavigate world, the SubresourceFilterAgent on the renderer side expected that an activation IPC message would arrive between DidStart- and DidCommitProvisionalLoad if the decision was made on the browser side to activate filtering for a given navigation. By default, if no message arrived, that meant no activation for a given load, therefore the SubresourceFilter used to reset the activation state in DidStartProvisionalLoad to DISABLED. (This was also the mechanism to undo activation in case the provisional load did not commit.) With PlzNavigate, however, the activation IPC message (which is sent from ReadyToCommitNavigation) always arrives even before DidStartProvisionalLoad, which means that the activation state would be reset immediately after being set from the IPC, were it not for a workaround that has been implemented in [1] to suppress resetting the activation state if the URL of the provisional load matched the URL for which activation was intended (sent along in the IPC). This CL removes this workaround, and refactors activation so that: -- DidStartProvisionalLoad does not play a role anymore. -- The activation IPC message can now be sent any time as long as it arrives before DidCommitProvisionalLoad (but after the prior load committing). -- As a general rule, no activation IPC message is sent anymore for failed navigations: -- This has already been the case for aborts; plus for failed navigations when PlzNavigate is disabled. (ReadyToCommitNavigation has never been invoked in these scenarios.) -- For failed navigations when PlzNavigate is enabled, there is now an explicit suppression for sending the activation message. -- In the edge case when the provisional load fails on the renderer-side after FrameMsg_CommitNavigation, the activation state is now reset in DidFailProvisionalLoad. [1] https://codereview.chromium.org/2446503002 BUG=637415 Review-Url: https://codereview.chromium.org/2669833004 Cr-Commit-Position: refs/heads/master@{#450681} Committed: https://chromium.googlesource.com/chromium/src/+/c53cedcb18d6344ae238ef6290bcbd0308bc40a6

Patch Set 1 #

Patch Set 2 : Polish. #

Patch Set 3 : Polish. #

Patch Set 4 : Rebase. #

Total comments: 4

Patch Set 5 : Addressed comments. #

Patch Set 6 : Rebase again + fix errors. #

Patch Set 7 : Format + presubmit warnings. #

Patch Set 8 : Rebase. #

Total comments: 9

Patch Set 9 : Rebased, addressed comments. #

Total comments: 4

Patch Set 10 : Rebase. #

Patch Set 11 : Comment nit. #

Patch Set 12 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -115 lines) Patch
M chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +12 lines, -12 lines 0 comments Download
M components/subresource_filter/content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M components/subresource_filter/content/browser/DEPS View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M components/subresource_filter/content/browser/content_subresource_filter_driver.h View 1 2 3 4 5 6 2 chunks +4 lines, -7 lines 0 comments Download
M components/subresource_filter/content/browser/content_subresource_filter_driver.cc View 1 chunk +5 lines, -5 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 2 chunks +4 lines, -2 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 5 chunks +18 lines, -8 lines 0 comments Download
M components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +56 lines, -20 lines 0 comments Download
M components/subresource_filter/content/common/document_subresource_filter.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M components/subresource_filter/content/common/subresource_filter_messages.h View 1 2 1 chunk +12 lines, -5 lines 0 comments Download
M components/subresource_filter/content/renderer/subresource_filter_agent.h View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -7 lines 0 comments Download
M components/subresource_filter/content/renderer/subresource_filter_agent.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +32 lines, -39 lines 0 comments Download
M components/subresource_filter/content/renderer/subresource_filter_agent_unittest.cc View 1 2 3 4 5 6 7 5 chunks +11 lines, -9 lines 0 comments Download

Messages

Total messages: 53 (35 generated)
engedy
@Pavel, @Camille, please review. @Tanja, FYI.
3 years, 10 months ago (2017-02-03 16:01:28 UTC) #11
pkalinnikov
LGTM % nits. https://codereview.chromium.org/2669833004/diff/60001/components/subresource_filter/content/renderer/subresource_filter_agent.cc File components/subresource_filter/content/renderer/subresource_filter_agent.cc (right): https://codereview.chromium.org/2669833004/diff/60001/components/subresource_filter/content/renderer/subresource_filter_agent.cc#newcode167 components/subresource_filter/content/renderer/subresource_filter_agent.cc:167: // TODO(engedy): Add a test where ...
3 years, 10 months ago (2017-02-06 11:44:44 UTC) #14
engedy
https://codereview.chromium.org/2669833004/diff/60001/components/subresource_filter/content/renderer/subresource_filter_agent.cc File components/subresource_filter/content/renderer/subresource_filter_agent.cc (right): https://codereview.chromium.org/2669833004/diff/60001/components/subresource_filter/content/renderer/subresource_filter_agent.cc#newcode167 components/subresource_filter/content/renderer/subresource_filter_agent.cc:167: // TODO(engedy): Add a test where this is needed ...
3 years, 10 months ago (2017-02-07 12:47:07 UTC) #15
engedy
@Camille, friendly ping.
3 years, 10 months ago (2017-02-08 10:21:23 UTC) #25
clamy
@engedy: sorry I didn't have time to look at this today, will do a review ...
3 years, 10 months ago (2017-02-08 17:07:56 UTC) #30
engedy
On 2017/02/08 17:07:56, clamy (slow - catching up) wrote: > @engedy: sorry I didn't have ...
3 years, 10 months ago (2017-02-08 17:23:42 UTC) #31
clamy
Thanks! This looks like a nice refactoring. A few questions below. https://codereview.chromium.org/2669833004/diff/160001/components/subresource_filter/content/browser/DEPS File components/subresource_filter/content/browser/DEPS (right): ...
3 years, 10 months ago (2017-02-09 10:32:07 UTC) #32
engedy
Please take another look. (Sorry for rebasing and addressing comments in the same patch set, ...
3 years, 10 months ago (2017-02-09 13:42:01 UTC) #35
clamy
Thanks! Lgtm. https://codereview.chromium.org/2669833004/diff/160001/components/subresource_filter/content/browser/DEPS File components/subresource_filter/content/browser/DEPS (right): https://codereview.chromium.org/2669833004/diff/160001/components/subresource_filter/content/browser/DEPS#newcode5 components/subresource_filter/content/browser/DEPS:5: "+net/base", On 2017/02/09 13:42:01, engedy wrote: > ...
3 years, 10 months ago (2017-02-09 14:09:42 UTC) #36
engedy
https://codereview.chromium.org/2669833004/diff/180001/components/subresource_filter/content/renderer/subresource_filter_agent.cc File components/subresource_filter/content/renderer/subresource_filter_agent.cc (right): https://codereview.chromium.org/2669833004/diff/180001/components/subresource_filter/content/renderer/subresource_filter_agent.cc#newcode179 components/subresource_filter/content/renderer/subresource_filter_agent.cc:179: // TODO(engedy): Add a test where this is needed ...
3 years, 10 months ago (2017-02-09 14:11:05 UTC) #37
engedy
@Daniel, please review IPC changes (one parameter removed). @Matt, please review: -- minor refactoring in ...
3 years, 10 months ago (2017-02-09 14:21:45 UTC) #39
engedy
For clarity, IPC changes in `subresource_filter_messages.h`.
3 years, 10 months ago (2017-02-09 14:22:46 UTC) #40
clamy
https://codereview.chromium.org/2669833004/diff/180001/components/subresource_filter/content/renderer/subresource_filter_agent.cc File components/subresource_filter/content/renderer/subresource_filter_agent.cc (right): https://codereview.chromium.org/2669833004/diff/180001/components/subresource_filter/content/renderer/subresource_filter_agent.cc#newcode179 components/subresource_filter/content/renderer/subresource_filter_agent.cc:179: // TODO(engedy): Add a test where this is needed ...
3 years, 10 months ago (2017-02-09 14:49:24 UTC) #43
mattm
lgtm
3 years, 10 months ago (2017-02-09 21:15:09 UTC) #44
dcheng
ipc lgtm (many apologies for the delayed review)
3 years, 10 months ago (2017-02-14 09:17:17 UTC) #45
engedy
Thanks for the reviews! https://codereview.chromium.org/2669833004/diff/180001/components/subresource_filter/content/renderer/subresource_filter_agent.cc File components/subresource_filter/content/renderer/subresource_filter_agent.cc (right): https://codereview.chromium.org/2669833004/diff/180001/components/subresource_filter/content/renderer/subresource_filter_agent.cc#newcode179 components/subresource_filter/content/renderer/subresource_filter_agent.cc:179: // TODO(engedy): Add a test ...
3 years, 10 months ago (2017-02-15 12:10: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/2669833004/240001
3 years, 10 months ago (2017-02-15 12:11:37 UTC) #50
commit-bot: I haz the power
3 years, 10 months ago (2017-02-15 13:17:29 UTC) #53
Message was sent while issue was closed.
Committed patchset #12 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/c53cedcb18d6344ae238ef6290bc...

Powered by Google App Engine
This is Rietveld 408576698