Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2618363002: PlzNavigate: don't send unexpected form urls to the browser (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index be46fd8b8128c5eb43ff8e6d8c75d1861c037bce..b67de19e5879156475894a2edac5549ac1ad6b74 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5398,6 +5398,15 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
info.urlRequest.checkForBrowserSideNavigation() &&
ShouldMakeNetworkRequestForURL(url)) {
if (info.defaultPolicy == blink::WebNavigationPolicyCurrentTab) {
+ if (RenderThreadImpl::current() &&
+ RenderThreadImpl::current()->layout_test_mode()) {
+ // Layout tests sometimes attempt to load urls of the form
+ // about:blank?foo which the browser doesn't expect and will convert to
+ // about:blank. Don't send these to the browser.
+ if (url.SchemeIs(url::kAboutScheme) && url.path() == "blank")
nasko 2017/01/09 23:57:51 Ugh, is "blank: really parsed as the "path" part o
clamy 2017/01/10 12:13:52 Yeah I know. I had to print all parts of the url t
+ return info.defaultPolicy;
+ }
+
BeginNavigation(info);
return blink::WebNavigationPolicyHandledByClient;
} else {
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698