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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 946543003: PlzNavigate: have renderer-initiated navigations be same-process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment changes Created 5 years, 9 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
Index: content/browser/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index c0d72bb670dd180ca7dfeabfa2fe12cc4df34703..3344f3dab66dccb585fde4aa1d2720e9838b5bc5 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -751,9 +751,16 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
// The appropriate RenderFrameHost to commit the navigation.
RenderFrameHostImpl* navigation_rfh = nullptr;
- // TODO(carlosk): do not swap processes for renderer initiated navigations
- // (see crbug.com/440266).
+ // Renderer-initiated navigations that may require a SiteInstance swap are
+ // sent to the browser via the OpenURL IPC and are afterwards treated as
+ // browser-initiated navigations. NavigationRequests marked as
+ // renderer-initiated are created by receiving a BeginNavigation IPC, and will
+ // then proceed in the same renderer that sent the IPC due to the condition
+ // below.
+ // TODO(carlosk): Once there is support for cross-process scripting check for
+ // non-browser-initiated navigations should be removed (see crbug.com/440266).
if (current_site_instance == dest_site_instance.get() ||
+ !request.browser_initiated() ||
(!frame_tree_node_->IsMainFrame() &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSitePerProcess))) {

Powered by Google App Engine
This is Rietveld 408576698