summaryrefslogtreecommitdiffstats
path: root/content/browser/site_instance_impl.cc
diff options
context:
space:
mode:
authorsimonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-02 11:18:17 +0000
committersimonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-02 11:18:17 +0000
commit855d7d572fb4d4aaf97464771661c6805e0347a5 (patch)
tree97f134d721e2763b5669bb8e01ddb5504674fbd7 /content/browser/site_instance_impl.cc
parent0b97fd59fe09f6c911b9d32e6c47841450d88508 (diff)
downloadchromium_src-855d7d572fb4d4aaf97464771661c6805e0347a5.zip
chromium_src-855d7d572fb4d4aaf97464771661c6805e0347a5.tar.gz
chromium_src-855d7d572fb4d4aaf97464771661c6805e0347a5.tar.bz2
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
Diffstat (limited to 'content/browser/site_instance_impl.cc')
-rw-r--r--content/browser/site_instance_impl.cc26
1 files changed, 17 insertions, 9 deletions
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);
}