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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2150243002: Revert of Simplify RenderFrameImpl::decidePolicyForNavigation and avoid DCHECK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | no next file » | 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 f4d007f7551cc14a10f555a42f6d7f81c24d0db8..0fe03c647e108e470c63b818949ba1f795a02eed 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4979,10 +4979,13 @@
info.navigationType != blink::WebNavigationTypeReload);
if (!should_fork && url.SchemeIs(url::kFileScheme)) {
- // Fork non-file to file opens. Note that this may fork unnecessarily if
- // another tab (hosting a file or not) targeted this one before its
- // initial navigation, but that shouldn't cause a problem.
- should_fork = !old_url.SchemeIs(url::kFileScheme);
+ // Fork non-file to file opens. Check the opener URL if this is the
+ // initial navigation in a newly opened window.
+ GURL source_url(old_url);
+ if (is_initial_navigation && source_url.is_empty() && frame_->opener())
+ source_url = frame_->opener()->top()->document().url();
+ DCHECK(!source_url.is_empty());
+ should_fork = !source_url.SchemeIs(url::kFileScheme);
}
if (!should_fork) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698