• danakj's avatar
    Clean-up the failed navigation case for same/cross document decisions · e9570a3c
    danakj authored
    Step 2 for bug 1125106. This is a subset of the mega-patch in
    https://chromium-review.googlesource.com/c/chromium/src/+/2462248.
    
    In order to address crbug.com/1125106, we would like to enforce that we
    do not call GetFrameHostForNavigation() with a same-document navigation.
    
    In order to fix crbug.com/1018385, a conversion from same-document to
    cross-document was introduced when a navigation request fails (for
    example when it is blocked). This was added in CommitErrorPage() which
    is called directly from OnRequestFailedInternal() or after that method
    runs the NavigationThrottles which eventually call back to
    NavigationRequest::OnFailureChecksComplete().
    
    But since OnRequestFailedInternal() needs to first call
    GetFrameHostForNavigation(), we want the NavigationRequest to be
    converted to cross-document before that call, which means before we run
    the NavigationThrottles instead of after. So we move the conversion from
    CommitErrorPage() up to OnRequestFailedInternal().
    
    R=alexmos@chromium.org, creis@chromium.org
    
    Bug: 1125106
    Change-Id: Iab3d1fb60433a0600c67c72da8f122fd75120802
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2552943
    Commit-Queue: danakj <danakj@chromium.org>
    Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#831048}
    e9570a3c
navigation_request.cc 221 KB