Commit 2e07434c authored by kouhei's avatar kouhei Committed by Chromium LUCI CQ

TabLoadingFrameNavigationPolicy: Check navigation target URL scheme

Before this CL, ShouldThrottleWebContents checked last committed URL if
it was eligible for the policy. However, since the navigation which we
would like to apply policy hasn't committed yet, this was checking the
WebContent's URL before navigation.

This CL changes it to `GetURL()` so that it would check the scheme of
the URL of the navigation target page.

BUG=1082920

Change-Id: I1aed97316e985b62be581e6f6a8d5447c2fc28f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2573851
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarChris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833982}
parent bbc1b315
...@@ -77,7 +77,8 @@ bool TabLoadingFrameNavigationPolicy::ShouldThrottleWebContents( ...@@ -77,7 +77,8 @@ bool TabLoadingFrameNavigationPolicy::ShouldThrottleWebContents(
// Don't throttle unless http or https. // Don't throttle unless http or https.
bool throttled = true; bool throttled = true;
const GURL& url = contents->GetLastCommittedURL(); // Use `GetVisibleURL()` since we haven't committed the navigation yet.
const GURL& url = contents->GetVisibleURL();
if (!CanThrottleUrlScheme(url)) if (!CanThrottleUrlScheme(url))
throttled = false; throttled = false;
......
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