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

Unified Diff: content/browser/site_instance_impl.cc

Issue 378743002: Navigation transitions: Place transition page in same process as destination page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clang build. Created 6 years, 5 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 | « chrome/browser/android/content_view_util.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_instance_impl.cc
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index b6e6918c0a48d755b0ae631270858c440afd3cb0..102c06758f932e4ab86c9c1ae14e7f613c569e3e 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);
}
« no previous file with comments | « chrome/browser/android/content_view_util.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698