Chromium Code Reviews| 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..6200331a98801800c3f111e00370ce03eb8acc02 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 = GURL(url::kAboutBlankURL); |
|
David Trainor- moved to gerrit
2014/07/31 00:48:47
GURL blank_page(url::kAboutBlankURL); ?
shatch
2014/07/31 18:41:34
Done.
|
| + 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); |
| } |