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,
// of ProactivelySwapBrowsingInstance experiment doesn't include them. The
// cost of getting a new process on same-site navigation would (probably?) be
// too high.
if (SiteInstanceImpl::IsSameWebSite(current_instance->GetIsolationContext(),
current_url, dest_url, true)) {
if (SiteInstanceImpl::IsSameSite(current_instance->GetIsolationContext(),
current_url, dest_url, true)) {
return false;
}
......@@ -1854,7 +1854,7 @@ bool RenderFrameHostManager::IsCurrentlySameSite(RenderFrameHostImpl* candidate,
// 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
// this time.
if (SiteInstanceImpl::IsSameWebSite(
if (SiteInstanceImpl::IsSameSite(
candidate->GetSiteInstance()->GetIsolationContext(),
candidate->last_successful_url(), dest_url,
should_compare_effective_urls)) {
......@@ -1865,7 +1865,7 @@ bool RenderFrameHostManager::IsCurrentlySameSite(RenderFrameHostImpl* candidate,
// example, "about:blank"). If so, examine the replicated origin to determine
// the site.
if (!candidate->GetLastCommittedOrigin().opaque() &&
SiteInstanceImpl::IsSameWebSite(
SiteInstanceImpl::IsSameSite(
candidate->GetSiteInstance()->GetIsolationContext(),
GURL(candidate->GetLastCommittedOrigin().Serialize()), dest_url,
should_compare_effective_urls)) {
......
......@@ -605,7 +605,7 @@ class CONTENT_EXPORT RenderFrameHostManager
// should be the same as |new_is_view_source_mode|.
//
// 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
// already be committed to a Web UI URL (such as the NTP).
bool ShouldSwapBrowsingInstancesForNavigation(
......
......@@ -1516,7 +1516,7 @@ class CrossSiteDocumentBlockingServiceWorkerTest : public ContentBrowserTest {
// 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
// to SetSSLConfig with CERT_COMMON_NAME_IS_DOMAIN argument).
ASSERT_FALSE(SiteInstanceImpl::IsSameWebSite(
ASSERT_FALSE(SiteInstanceImpl::IsSameSite(
IsolationContext(shell()->web_contents()->GetBrowserContext()),
GetURLOnServiceWorkerServer("/"), GetURLOnCrossOriginServer("/"),
true /* should_use_effective_urls */));
......
......@@ -524,7 +524,7 @@ bool SiteInstance::ShouldAssignSiteForURL(const GURL& url) {
bool SiteInstanceImpl::IsSameSiteWithURL(const GURL& url) {
if (IsDefaultSiteInstance()) {
// about:blank URLs should always be considered same site just like they are
// in IsSameWebSite().
// in IsSameSite().
if (url.IsAboutBlank())
return true;
......@@ -541,9 +541,8 @@ bool SiteInstanceImpl::IsSameSiteWithURL(const GURL& url) {
!browsing_instance_->HasSiteInstance(url);
}
return SiteInstanceImpl::IsSameWebSite(
GetIsolationContext(), site_, url,
true /* should_compare_effective_urls */);
return SiteInstanceImpl::IsSameSite(GetIsolationContext(), site_, url,
true /* should_compare_effective_urls */);
}
bool SiteInstanceImpl::IsOriginalUrlSameSite(
......@@ -552,15 +551,15 @@ bool SiteInstanceImpl::IsOriginalUrlSameSite(
if (IsDefaultSiteInstance())
return IsSameSiteWithURL(dest_url);
return IsSameWebSite(GetIsolationContext(), original_url_, dest_url,
should_compare_effective_urls);
return IsSameSite(GetIsolationContext(), original_url_, dest_url,
should_compare_effective_urls);
}
// static
bool SiteInstanceImpl::IsSameWebSite(const IsolationContext& isolation_context,
const GURL& real_src_url,
const GURL& real_dest_url,
bool should_compare_effective_urls) {
bool SiteInstanceImpl::IsSameSite(const IsolationContext& isolation_context,
const GURL& real_src_url,
const GURL& real_dest_url,
bool should_compare_effective_urls) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
BrowserContext* browser_context =
isolation_context.browser_or_resource_context().ToBrowserContext();
......
......@@ -71,10 +71,10 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
// without converting them to effective URLs first. This is useful for
// avoiding OOPIFs when otherwise same-site URLs may look cross-site via
// their effective URLs.
static bool IsSameWebSite(const IsolationContext& isolation_context,
const GURL& src_url,
const GURL& dest_url,
bool should_compare_effective_urls);
static bool IsSameSite(const IsolationContext& isolation_context,
const GURL& src_url,
const GURL& dest_url,
bool should_compare_effective_urls);
// SiteInstance interface overrides.
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