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

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

Issue 659293002: Make sure new render is used when navigating away from about:blank in WebUI renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nit fixes Created 6 years, 2 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 | content/browser/frame_host/render_frame_host_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e6e93d96f64bbbbcb7c1d75d017efb528f705af2..aa2b2fe6bffa6a366294b76ee33574a9323a63a3 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -690,7 +690,9 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
// For security, we should transition between processes when one is a Web UI
// page and one isn't.
- if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL(
+ if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
+ render_frame_host_->GetProcess()->GetID()) ||
+ WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL(
browser_context, current_effective_url)) {
// If so, force a swap if destination is not an acceptable URL for Web UI.
// Here, data URLs are never allowed.
@@ -747,7 +749,8 @@ SiteInstance* RenderFrameHostManager::GetSiteInstanceForNavigation(
SiteInstance* new_instance = current_instance;
// We do not currently swap processes for navigations in webview tag guests.
- bool is_guest_scheme = current_instance->GetSiteURL().SchemeIs(kGuestScheme);
+ if (current_instance->GetSiteURL().SchemeIs(kGuestScheme))
+ return current_instance;
// Determine if we need a new BrowsingInstance for this entry. If true, this
// implies that it will get a new SiteInstance (and likely process), and that
@@ -765,14 +768,13 @@ SiteInstance* RenderFrameHostManager::GetSiteInstanceForNavigation(
render_frame_host_->GetSiteInstance()->GetSiteURL();
bool current_is_view_source_mode = current_entry ?
current_entry->IsViewSourceMode() : dest_is_view_source_mode;
- bool force_swap = !is_guest_scheme &&
- ShouldSwapBrowsingInstancesForNavigation(
- current_effective_url,
- current_is_view_source_mode,
- dest_instance,
- SiteInstanceImpl::GetEffectiveURL(browser_context, dest_url),
- dest_is_view_source_mode);
- if (!is_guest_scheme && (ShouldTransitionCrossSite() || force_swap)) {
+ bool force_swap = ShouldSwapBrowsingInstancesForNavigation(
+ current_effective_url,
+ current_is_view_source_mode,
+ dest_instance,
+ SiteInstanceImpl::GetEffectiveURL(browser_context, dest_url),
+ dest_is_view_source_mode);
+ if (ShouldTransitionCrossSite() || force_swap) {
new_instance = GetSiteInstanceForURL(
dest_url,
dest_instance,
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698