• Arthur Hemery's avatar
    [Security][COOP] Refactor core COOP logic. · 05c00770
    Arthur Hemery authored
    The current logic is implemented in the RenderFrameHostManager, but it
    would make more sense to have decisions taken in the NavigationRequest.
    This allows us to both clarify logic, as explained below, and to remove
    one mutator from the NavigationRequest interface.
    
    One single block of code that was doing a number of things is now split
    in three different logical parts, with some redundancy:
    
    - When we start a navigation, we do some coop inheritance heuristic to
    make sure the special case of instantly committing a speculative RFH in
    a sad tab does not mess up with attributes and proxy clearing.
    
    - When we hit a redirect, we recompute the COOP decision given the
    redirect headers.
    
    - When we receive the final headers, we compute the final COOP decision
    and do reporting if necessary.
    
    This clarifies the different bits of the COOP puzzle of setting
    require_browsing_instance_swap.
    
    Bug: 1076879
    Change-Id: Ibf96084b59b5aa62e2241df1abbdb24b2c20e1e1
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218092
    Commit-Queue: Arthur Hemery <ahemery@chromium.org>
    Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#776891}
    05c00770
navigation_request.h 58.3 KB