From 855d7d572fb4d4aaf97464771661c6805e0347a5 Mon Sep 17 00:00:00 2001 From: "simonhatch@chromium.org" Date: Sat, 2 Aug 2014 11:18:17 +0000 Subject: Navigation transitions: Place transition page in same process as destination page. Per creis' request, place the transition page in the same process as the destination page. This is done to avoid the overhead of potentially spawning an extra new renderer for the transition. The idea behind this was to put the transition page into the same render process as the incoming page. Approach so far was to instantiate a new WebContents in the embedder via a new function createNativeWebContentsWithSharedSiteInstance(source_content_view_core), passing the SiteInstance of the incoming page. The transition ContentViewCore can then be navigated to a blank page and the serialized markup is added to the page. Since the transition and incoming pages share the same SiteInstance, they will be placed in the same process. Design doc: https://docs.google.com/a/chromium.org/document/d/17jg1RRL3RI969cLwbKBIcoGDsPwqaEdBxafGNYGwiY4/edit# Implementation details: https://docs.google.com/a/chromium.org/document/d/1kREPtFJaeLoDKwrfmrYTD7DHCdxX1RzFBga2gNY8lyE/edit#heading=h.bng2kpmyvxq5 BUG=370696 Review URL: https://codereview.chromium.org/378743002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287192 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/site_instance_impl.cc | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'content/browser/site_instance_impl.cc') diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index b6e6918..102c067 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc @@ -241,10 +241,12 @@ SiteInstance* SiteInstance::CreateForURL(BrowserContext* browser_context, /*static*/ bool SiteInstance::IsSameWebSite(BrowserContext* browser_context, - const GURL& real_url1, - const GURL& real_url2) { - GURL url1 = SiteInstanceImpl::GetEffectiveURL(browser_context, real_url1); - GURL url2 = SiteInstanceImpl::GetEffectiveURL(browser_context, real_url2); + const GURL& real_src_url, + const GURL& real_dest_url) { + GURL src_url = SiteInstanceImpl::GetEffectiveURL(browser_context, + real_src_url); + GURL dest_url = SiteInstanceImpl::GetEffectiveURL(browser_context, + real_dest_url); // We infer web site boundaries based on the registered domain name of the // top-level page and the scheme. We do not pay attention to the port if @@ -254,20 +256,26 @@ bool SiteInstance::IsSameWebSite(BrowserContext* browser_context, // Some special URLs will match the site instance of any other URL. This is // done before checking both of them for validity, since we want these URLs // to have the same site instance as even an invalid one. - if (IsRendererDebugURL(url1) || IsRendererDebugURL(url2)) + if (IsRendererDebugURL(src_url) || IsRendererDebugURL(dest_url)) return true; // If either URL is invalid, they aren't part of the same site. - if (!url1.is_valid() || !url2.is_valid()) + if (!src_url.is_valid() || !dest_url.is_valid()) return false; + // If the destination url is just a blank page, we treat them as part of the + // same site. + GURL blank_page(url::kAboutBlankURL); + if (dest_url == blank_page) + return true; + // If the schemes differ, they aren't part of the same site. - if (url1.scheme() != url2.scheme()) + if (src_url.scheme() != dest_url.scheme()) return false; return net::registry_controlled_domains::SameDomainOrHost( - url1, - url2, + src_url, + dest_url, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); } -- cgit v1.1