Chromium Code Reviews
DescriptionRefactor 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. #Messages
Total messages: 53 (35 generated)
|