| Index: content/browser/site_instance_impl.cc
|
| diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
| index c12a0c79160a24dea7b2667816cb670fc4f89114..ac535c86914a5be0e40f3eba2403c906721ce3d8 100644
|
| --- a/content/browser/site_instance_impl.cc
|
| +++ b/content/browser/site_instance_impl.cc
|
| @@ -292,10 +292,10 @@ scoped_refptr<SiteInstance> SiteInstance::CreateForURL(
|
| bool SiteInstance::IsSameWebSite(BrowserContext* browser_context,
|
| const GURL& real_src_url,
|
| const GURL& real_dest_url) {
|
| + GURL dest_url =
|
| + SiteInstanceImpl::GetEffectiveURL(browser_context, 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
|
| @@ -312,19 +312,18 @@ bool SiteInstance::IsSameWebSite(BrowserContext* browser_context,
|
| 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)
|
| + // If the destination url is just a blank page, a data: URL, or another page
|
| + // without an origin, we can't reason about its origin.
|
| + url::Origin dest_origin(dest_url);
|
| + if (dest_origin.unique())
|
| return true;
|
|
|
| // If the schemes differ, they aren't part of the same site.
|
| - if (src_url.scheme() != dest_url.scheme())
|
| + if (src_url.scheme() != dest_origin.scheme())
|
| return false;
|
|
|
| return net::registry_controlled_domains::SameDomainOrHost(
|
| - src_url,
|
| - dest_url,
|
| + src_url, dest_origin.GetURL(),
|
| net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
|
| }
|
|
|
|
|