Commit 921758aa authored by Nasko Oskov's avatar Nasko Oskov Committed by Commit Bot

Rename SiteInstance's IsSameWebSite to IsSameSite.

The terminology we use in the SiteInstance and process model code is
"site" not "web site", therefore it makes more sense for the
IsSameWebSite method to be named IsSameSite and be more consistent with
the rest of the code.

Bug: 1015882
Change-Id: Icb4ba1464b8559ff07c10d2dc338014ec79522ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1869761Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707568}
parent cb36d6af
...@@ -144,8 +144,8 @@ bool ShouldProactivelySwapBrowsingInstance(RenderFrameHostImpl* current_rfh, ...@@ -144,8 +144,8 @@ bool ShouldProactivelySwapBrowsingInstance(RenderFrameHostImpl* current_rfh,
// of ProactivelySwapBrowsingInstance experiment doesn't include them. The // of ProactivelySwapBrowsingInstance experiment doesn't include them. The
// cost of getting a new process on same-site navigation would (probably?) be // cost of getting a new process on same-site navigation would (probably?) be
// too high. // too high.
if (SiteInstanceImpl::IsSameWebSite(current_instance->GetIsolationContext(), if (SiteInstanceImpl::IsSameSite(current_instance->GetIsolationContext(),
current_url, dest_url, true)) { current_url, dest_url, true)) {
return false; return false;
} }
...@@ -1854,7 +1854,7 @@ bool RenderFrameHostManager::IsCurrentlySameSite(RenderFrameHostImpl* candidate, ...@@ -1854,7 +1854,7 @@ bool RenderFrameHostManager::IsCurrentlySameSite(RenderFrameHostImpl* candidate,
// In the common case, we use the RenderFrameHost's last successful URL. Thus, // In the common case, we use the RenderFrameHost's last successful URL. Thus,
// we compare against the last successful commit when deciding whether to swap // we compare against the last successful commit when deciding whether to swap
// this time. // this time.
if (SiteInstanceImpl::IsSameWebSite( if (SiteInstanceImpl::IsSameSite(
candidate->GetSiteInstance()->GetIsolationContext(), candidate->GetSiteInstance()->GetIsolationContext(),
candidate->last_successful_url(), dest_url, candidate->last_successful_url(), dest_url,
should_compare_effective_urls)) { should_compare_effective_urls)) {
...@@ -1865,7 +1865,7 @@ bool RenderFrameHostManager::IsCurrentlySameSite(RenderFrameHostImpl* candidate, ...@@ -1865,7 +1865,7 @@ bool RenderFrameHostManager::IsCurrentlySameSite(RenderFrameHostImpl* candidate,
// example, "about:blank"). If so, examine the replicated origin to determine // example, "about:blank"). If so, examine the replicated origin to determine
// the site. // the site.
if (!candidate->GetLastCommittedOrigin().opaque() && if (!candidate->GetLastCommittedOrigin().opaque() &&
SiteInstanceImpl::IsSameWebSite( SiteInstanceImpl::IsSameSite(
candidate->GetSiteInstance()->GetIsolationContext(), candidate->GetSiteInstance()->GetIsolationContext(),
GURL(candidate->GetLastCommittedOrigin().Serialize()), dest_url, GURL(candidate->GetLastCommittedOrigin().Serialize()), dest_url,
should_compare_effective_urls)) { should_compare_effective_urls)) {
......
...@@ -605,7 +605,7 @@ class CONTENT_EXPORT RenderFrameHostManager ...@@ -605,7 +605,7 @@ class CONTENT_EXPORT RenderFrameHostManager
// should be the same as |new_is_view_source_mode|. // should be the same as |new_is_view_source_mode|.
// //
// We use the effective URL here, since that's what is used in the // We use the effective URL here, since that's what is used in the
// SiteInstance's site and when we later call IsSameWebSite. If there is no // SiteInstance's site and when we later call IsSameSite. If there is no
// current NavigationEntry, check the current SiteInstance's site, which might // current NavigationEntry, check the current SiteInstance's site, which might
// already be committed to a Web UI URL (such as the NTP). // already be committed to a Web UI URL (such as the NTP).
bool ShouldSwapBrowsingInstancesForNavigation( bool ShouldSwapBrowsingInstancesForNavigation(
......
...@@ -1516,7 +1516,7 @@ class CrossSiteDocumentBlockingServiceWorkerTest : public ContentBrowserTest { ...@@ -1516,7 +1516,7 @@ class CrossSiteDocumentBlockingServiceWorkerTest : public ContentBrowserTest {
// Sanity check of test setup - the 2 https servers should be cross-site // Sanity check of test setup - the 2 https servers should be cross-site
// (the second server should have a different hostname because of the call // (the second server should have a different hostname because of the call
// to SetSSLConfig with CERT_COMMON_NAME_IS_DOMAIN argument). // to SetSSLConfig with CERT_COMMON_NAME_IS_DOMAIN argument).
ASSERT_FALSE(SiteInstanceImpl::IsSameWebSite( ASSERT_FALSE(SiteInstanceImpl::IsSameSite(
IsolationContext(shell()->web_contents()->GetBrowserContext()), IsolationContext(shell()->web_contents()->GetBrowserContext()),
GetURLOnServiceWorkerServer("/"), GetURLOnCrossOriginServer("/"), GetURLOnServiceWorkerServer("/"), GetURLOnCrossOriginServer("/"),
true /* should_use_effective_urls */)); true /* should_use_effective_urls */));
......
...@@ -524,7 +524,7 @@ bool SiteInstance::ShouldAssignSiteForURL(const GURL& url) { ...@@ -524,7 +524,7 @@ bool SiteInstance::ShouldAssignSiteForURL(const GURL& url) {
bool SiteInstanceImpl::IsSameSiteWithURL(const GURL& url) { bool SiteInstanceImpl::IsSameSiteWithURL(const GURL& url) {
if (IsDefaultSiteInstance()) { if (IsDefaultSiteInstance()) {
// about:blank URLs should always be considered same site just like they are // about:blank URLs should always be considered same site just like they are
// in IsSameWebSite(). // in IsSameSite().
if (url.IsAboutBlank()) if (url.IsAboutBlank())
return true; return true;
...@@ -541,9 +541,8 @@ bool SiteInstanceImpl::IsSameSiteWithURL(const GURL& url) { ...@@ -541,9 +541,8 @@ bool SiteInstanceImpl::IsSameSiteWithURL(const GURL& url) {
!browsing_instance_->HasSiteInstance(url); !browsing_instance_->HasSiteInstance(url);
} }
return SiteInstanceImpl::IsSameWebSite( return SiteInstanceImpl::IsSameSite(GetIsolationContext(), site_, url,
GetIsolationContext(), site_, url, true /* should_compare_effective_urls */);
true /* should_compare_effective_urls */);
} }
bool SiteInstanceImpl::IsOriginalUrlSameSite( bool SiteInstanceImpl::IsOriginalUrlSameSite(
...@@ -552,15 +551,15 @@ bool SiteInstanceImpl::IsOriginalUrlSameSite( ...@@ -552,15 +551,15 @@ bool SiteInstanceImpl::IsOriginalUrlSameSite(
if (IsDefaultSiteInstance()) if (IsDefaultSiteInstance())
return IsSameSiteWithURL(dest_url); return IsSameSiteWithURL(dest_url);
return IsSameWebSite(GetIsolationContext(), original_url_, dest_url, return IsSameSite(GetIsolationContext(), original_url_, dest_url,
should_compare_effective_urls); should_compare_effective_urls);
} }
// static // static
bool SiteInstanceImpl::IsSameWebSite(const IsolationContext& isolation_context, bool SiteInstanceImpl::IsSameSite(const IsolationContext& isolation_context,
const GURL& real_src_url, const GURL& real_src_url,
const GURL& real_dest_url, const GURL& real_dest_url,
bool should_compare_effective_urls) { bool should_compare_effective_urls) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BrowserContext* browser_context = BrowserContext* browser_context =
isolation_context.browser_or_resource_context().ToBrowserContext(); isolation_context.browser_or_resource_context().ToBrowserContext();
......
...@@ -71,10 +71,10 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance, ...@@ -71,10 +71,10 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
// without converting them to effective URLs first. This is useful for // without converting them to effective URLs first. This is useful for
// avoiding OOPIFs when otherwise same-site URLs may look cross-site via // avoiding OOPIFs when otherwise same-site URLs may look cross-site via
// their effective URLs. // their effective URLs.
static bool IsSameWebSite(const IsolationContext& isolation_context, static bool IsSameSite(const IsolationContext& isolation_context,
const GURL& src_url, const GURL& src_url,
const GURL& dest_url, const GURL& dest_url,
bool should_compare_effective_urls); bool should_compare_effective_urls);
// SiteInstance interface overrides. // SiteInstance interface overrides.
int32_t GetId() override; int32_t GetId() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment