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

Unified Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 10825402: View-source URLs should use a separate SiteInstance in all cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes based on Charlie's comments. Created 8 years, 4 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 | « content/browser/renderer_host/render_view_host_manager_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/render_view_host_manager.cc
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index a11689187f7932b1b7873746bdbd253cd4471e70..62fec79d74de5e16ec285817f4bc86b6f9eb9689 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -488,6 +488,13 @@ SiteInstance* RenderViewHostManager::GetSiteInstanceForEntry(
if (curr_site_instance->HasWrongProcessForURL(dest_url))
return curr_site_instance->GetRelatedSiteInstance(dest_url);
+ // View-source URLs must use a new SiteInstance and BrowsingInstance.
+ // TODO(nasko): This is the same condition as later in the function. This
+ // should be taken into account when refactoring this method as part of
+ // http://crbug.com/123007.
+ if (entry.IsViewSourceMode())
+ return SiteInstance::CreateForURL(browser_context, dest_url);
+
// Normally the "site" on the SiteInstance is set lazily when the load
// actually commits. This is to support better process sharing in case
// the site redirects to some other site: we want to use the destination
« no previous file with comments | « content/browser/renderer_host/render_view_host_manager_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698