Commit 21751042 authored by rajendrant's avatar rajendrant Committed by Commit Bot

Add more checks for subresource redirect

Adds checks for whether navigation is committed and only for http/https
navigations.

Bug: 1055573
Change-Id: Ib65801efbe1cd66362c885e5b2f0442de65aa918
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078784Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Commit-Queue: rajendrant <rajendrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745280}
parent 505b4d31
...@@ -118,7 +118,9 @@ void SubresourceRedirectObserver::DidFinishNavigation( ...@@ -118,7 +118,9 @@ void SubresourceRedirectObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) { content::NavigationHandle* navigation_handle) {
DCHECK(navigation_handle); DCHECK(navigation_handle);
if (!navigation_handle->IsInMainFrame() || if (!navigation_handle->IsInMainFrame() ||
navigation_handle->IsSameDocument()) { !navigation_handle->HasCommitted() ||
navigation_handle->IsSameDocument() ||
!navigation_handle->GetURL().SchemeIsHTTPOrHTTPS()) {
return; return;
} }
auto* optimization_guide_decider = GetOptimizationGuideDeciderFromWebContents( auto* optimization_guide_decider = GetOptimizationGuideDeciderFromWebContents(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment