Rename "first_party_for_cookies" to "site_for_cookies".
This is consistent with the language used in
https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site to
describe the difference in behavior for "same-site" and "cross-site"
requests, and more accurately describes the extent of the check
that's happening under the hood when users choose to "block
third-party cookies".
This change is completely mechanical, produced by the following:
git grep -n -l \
-e 'first_party_for_cookies' -e 'west-first-party-cookies' \
-e 'FirstPartyForCookies' -e 'firstPartyForCookies' -- \
"*.h" "*.hpp" "*.cpp" "*.c" "*.cc" "*.cpp" "*.inl" "*.grd" \
"*.idl" "*.m" "*.mm" "*.py" "*.sh" "*.cfg" "*.tac" "*.go" \
"*SConscript" "SConscript*" "*.scons" "*.vcproj" "*.vsprops" \
"*.make" "*.gyp" "*.gypi" "*.isolate" "*.js" "*.html" "*.css" \
"*.ebuild" "*.pl" "*.pm" \
| xargs -L1 sed -i '' \
-e 's/first_party_for_cookies/site_for_cookies/g' \
-e 's/west-first-party-cookies/ietf-httpbis-cookie-same-site/' \
-e 's/FirstPartyForCookies/SiteForCookies/g' \
-e 's/firstPartyforCookies/siteForCookies/g' \
&& git cl format
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I8e6d48ae2ff15ba82b9d3b62d2a53faf4608819f
Reviewed-on: https://chromium-review.googlesource.com/590451
Commit-Queue: Mike West <[email protected]>
Reviewed-by: Ryan Sleevi <[email protected]>
Reviewed-by: Jochen Eisinger <[email protected]>
Cr-Commit-Position: refs/heads/master@{#493378}
diff --git a/android_webview/browser/aw_cookie_access_policy.cc b/android_webview/browser/aw_cookie_access_policy.cc
index e0a78cc..0b8053e 100644
--- a/android_webview/browser/aw_cookie_access_policy.cc
+++ b/android_webview/browser/aw_cookie_access_policy.cc
@@ -81,7 +81,7 @@
bool global = GetShouldAcceptCookies();
bool thirdParty = GetShouldAcceptThirdPartyCookies(request);
return AwStaticCookiePolicy(global, thirdParty)
- .AllowGet(request.url(), request.first_party_for_cookies());
+ .AllowGet(request.url(), request.site_for_cookies());
}
bool AwCookieAccessPolicy::OnCanSetCookie(const net::URLRequest& request,
@@ -90,7 +90,7 @@
bool global = GetShouldAcceptCookies();
bool thirdParty = GetShouldAcceptThirdPartyCookies(request);
return AwStaticCookiePolicy(global, thirdParty)
- .AllowSet(request.url(), request.first_party_for_cookies());
+ .AllowSet(request.url(), request.site_for_cookies());
}
bool AwCookieAccessPolicy::AllowGetCookie(const GURL& url,
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
index 10c8a59..8b7df22 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
@@ -659,7 +659,7 @@
std::unique_ptr<net::URLRequest> http_request(context.CreateRequest(
urls[i], net::DEFAULT_PRIORITY, NULL, TRAFFIC_ANNOTATION_FOR_TESTS));
WebRequestData request_data(http_request.get(), ON_BEFORE_REQUEST);
- http_request->set_first_party_for_cookies(firstPartyUrls[i]);
+ http_request->set_site_for_cookies(firstPartyUrls[i]);
// Now run both rules on the input.
matches = registry->GetMatches(request_data);
SCOPED_TRACE(testing::Message("i = ") << i << ", rule id = "
diff --git a/chrome/browser/loader/predictor_resource_throttle.cc b/chrome/browser/loader/predictor_resource_throttle.cc
index ea3c649..59a90da7 100644
--- a/chrome/browser/loader/predictor_resource_throttle.cc
+++ b/chrome/browser/loader/predictor_resource_throttle.cc
@@ -79,7 +79,7 @@
predictor_->timed_cache()->SetRecentlySeen(request_scheme_host);
if (resource_type == content::RESOURCE_TYPE_SUB_FRAME) {
predictor_->PredictFrameSubresources(request_scheme_host,
- request_->first_party_for_cookies());
+ request_->site_for_cookies());
}
}
}
@@ -115,8 +115,8 @@
}
predictor_->timed_cache()->SetRecentlySeen(new_scheme_host);
- predictor_->PredictFrameSubresources(
- new_scheme_host, redirect_info.new_first_party_for_cookies);
+ predictor_->PredictFrameSubresources(new_scheme_host,
+ redirect_info.new_site_for_cookies);
}
const char* PredictorResourceThrottle::GetNameForLogging() const {
diff --git a/chrome/browser/media/android/remote/remote_media_player_bridge.cc b/chrome/browser/media/android/remote/remote_media_player_bridge.cc
index 2b151b5e..51502645 100644
--- a/chrome/browser/media/android/remote/remote_media_player_bridge.cc
+++ b/chrome/browser/media/android/remote/remote_media_player_bridge.cc
@@ -43,16 +43,15 @@
int player_id,
const std::string& user_agent,
RemoteMediaPlayerManager* manager)
- : MediaPlayerAndroid(
- player_id,
- manager,
- base::Bind(&DoNothing),
- manager->GetLocalPlayer(player_id)->frame_url()),
+ : MediaPlayerAndroid(player_id,
+ manager,
+ base::Bind(&DoNothing),
+ manager->GetLocalPlayer(player_id)->frame_url()),
width_(0),
height_(0),
url_(manager->GetLocalPlayer(player_id)->GetUrl()),
- first_party_for_cookies_(
- manager->GetLocalPlayer(player_id)->GetFirstPartyForCookies()),
+ site_for_cookies_(
+ manager->GetLocalPlayer(player_id)->GetSiteForCookies()),
user_agent_(user_agent),
weak_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -428,8 +427,8 @@
return url_;
}
-GURL RemoteMediaPlayerBridge::GetFirstPartyForCookies() {
- return first_party_for_cookies_;
+GURL RemoteMediaPlayerBridge::GetSiteForCookies() {
+ return site_for_cookies_;
}
void RemoteMediaPlayerBridge::Initialize() {
@@ -437,7 +436,7 @@
media::MediaResourceGetter* resource_getter =
manager()->GetMediaResourceGetter();
resource_getter->GetCookies(
- url_, first_party_for_cookies_,
+ url_, site_for_cookies_,
base::Bind(&RemoteMediaPlayerBridge::OnCookiesRetrieved,
weak_factory_.GetWeakPtr()));
}
diff --git a/chrome/browser/media/android/remote/remote_media_player_bridge.h b/chrome/browser/media/android/remote/remote_media_player_bridge.h
index a30e59a..96d5ecb 100644
--- a/chrome/browser/media/android/remote/remote_media_player_bridge.h
+++ b/chrome/browser/media/android/remote/remote_media_player_bridge.h
@@ -49,7 +49,7 @@
bool CanSeekBackward() override;
bool IsPlayerReady() override;
GURL GetUrl() override;
- GURL GetFirstPartyForCookies() override;
+ GURL GetSiteForCookies() override;
// JNI functions
void OnPlaying(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
@@ -131,7 +131,7 @@
GURL url_;
// First party url for cookies.
- GURL first_party_for_cookies_;
+ GURL site_for_cookies_;
// Cookies for |url_|.
std::string cookies_;
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index d3643a0..949d0709 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -411,7 +411,7 @@
return true;
bool allow = cookie_settings_->IsCookieAccessAllowed(
- request.url(), request.first_party_for_cookies());
+ request.url(), request.site_for_cookies());
const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
if (info) {
@@ -419,7 +419,7 @@
BrowserThread::UI, FROM_HERE,
base::BindOnce(&TabSpecificContentSettings::CookiesRead,
info->GetWebContentsGetterForRequest(), request.url(),
- request.first_party_for_cookies(), cookie_list, !allow));
+ request.site_for_cookies(), cookie_list, !allow));
}
return allow;
@@ -433,7 +433,7 @@
return true;
bool allow = cookie_settings_->IsCookieAccessAllowed(
- request.url(), request.first_party_for_cookies());
+ request.url(), request.site_for_cookies());
const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
if (info) {
@@ -441,7 +441,7 @@
BrowserThread::UI, FROM_HERE,
base::BindOnce(&TabSpecificContentSettings::CookieChanged,
info->GetWebContentsGetterForRequest(), request.url(),
- request.first_party_for_cookies(), cookie_line, *options,
+ request.site_for_cookies(), cookie_line, *options,
!allow));
}
@@ -538,12 +538,12 @@
bool ChromeNetworkDelegate::OnCanEnablePrivacyMode(
const GURL& url,
- const GURL& first_party_for_cookies) const {
+ const GURL& site_for_cookies) const {
// nullptr during tests, or when we're running in the system context.
if (!cookie_settings_.get())
return false;
- return !cookie_settings_->IsCookieAccessAllowed(url, first_party_for_cookies);
+ return !cookie_settings_->IsCookieAccessAllowed(url, site_for_cookies);
}
bool ChromeNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index 597c65c..d87cbd25 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -180,9 +180,8 @@
bool OnCanAccessFile(const net::URLRequest& request,
const base::FilePath& original_path,
const base::FilePath& absolute_path) const override;
- bool OnCanEnablePrivacyMode(
- const GURL& url,
- const GURL& first_party_for_cookies) const override;
+ bool OnCanEnablePrivacyMode(const GURL& url,
+ const GURL& site_for_cookies) const override;
bool OnAreExperimentalCookieFeaturesEnabled() const override;
bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
const net::URLRequest& request,
diff --git a/chrome/browser/net/loading_predictor_observer.cc b/chrome/browser/net/loading_predictor_observer.cc
index 95ecf18..df23e61d 100644
--- a/chrome/browser/net/loading_predictor_observer.cc
+++ b/chrome/browser/net/loading_predictor_observer.cc
@@ -108,7 +108,7 @@
BrowserThread::UI, FROM_HERE,
base::BindOnce(&LoadingPredictorObserver::OnRequestStartedOnUIThread,
base::Unretained(this), base::Passed(std::move(summary)),
- web_contents_getter, request->first_party_for_cookies(),
+ web_contents_getter, request->site_for_cookies(),
request->creation_time()));
if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME)
@@ -142,7 +142,7 @@
BrowserThread::UI, FROM_HERE,
base::BindOnce(&LoadingPredictorObserver::OnRequestRedirectedOnUIThread,
base::Unretained(this), base::Passed(std::move(summary)),
- web_contents_getter, request->first_party_for_cookies(),
+ web_contents_getter, request->site_for_cookies(),
request->creation_time()));
if (request_info &&
@@ -177,7 +177,7 @@
BrowserThread::UI, FROM_HERE,
base::BindOnce(&LoadingPredictorObserver::OnResponseStartedOnUIThread,
base::Unretained(this), base::Passed(std::move(summary)),
- web_contents_getter, request->first_party_for_cookies(),
+ web_contents_getter, request->site_for_cookies(),
request->creation_time()));
ReportRequestStats(REQUEST_STATS_TOTAL_PROCESSED_RESPONSES);
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index f7ae1ee..50fea845 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -281,7 +281,7 @@
}
void Predictor::PreconnectUrlAndSubresources(const GURL& url,
- const GURL& first_party_for_cookies) {
+ const GURL& site_for_cookies) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!PredictorEnabled())
@@ -293,10 +293,10 @@
return;
UrlInfo::ResolutionMotivation motivation(UrlInfo::EARLY_LOAD_MOTIVATED);
const int kConnectionsNeeded = 1;
- PreconnectUrl(canonicalized_url, first_party_for_cookies, motivation,
+ PreconnectUrl(canonicalized_url, site_for_cookies, motivation,
kAllowCredentialsOnPreconnectByDefault, kConnectionsNeeded);
PredictFrameSubresources(canonicalized_url.GetWithEmptyPath(),
- first_party_for_cookies);
+ site_for_cookies);
}
std::vector<GURL> Predictor::GetPredictedUrlListAtStartup(
@@ -769,7 +769,7 @@
}
void Predictor::PreconnectUrl(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
UrlInfo::ResolutionMotivation motivation,
bool allow_credentials,
int count) {
@@ -778,20 +778,20 @@
DCHECK(url.is_valid());
if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- PreconnectUrlOnIOThread(url, first_party_for_cookies, motivation,
+ PreconnectUrlOnIOThread(url, site_for_cookies, motivation,
allow_credentials, count);
} else {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::BindOnce(&Predictor::PreconnectUrlOnIOThread,
- base::Unretained(this), url, first_party_for_cookies,
+ base::Unretained(this), url, site_for_cookies,
motivation, allow_credentials, count));
}
}
void Predictor::PreconnectUrlOnIOThread(
const GURL& original_url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
UrlInfo::ResolutionMotivation motivation,
bool allow_credentials,
int count) {
@@ -802,8 +802,7 @@
// for the URLRequestContextGetter. The predictor tests should be fixed to
// allow for this, as they currently expect a callback with no getter.
if (observer_) {
- observer_->OnPreconnectUrl(
- url, first_party_for_cookies, motivation, count);
+ observer_->OnPreconnectUrl(url, site_for_cookies, motivation, count);
}
net::URLRequestContextGetter* getter = url_request_context_getter_.get();
@@ -833,12 +832,12 @@
}
UMA_HISTOGRAM_ENUMERATION("Net.PreconnectMotivation", motivation,
UrlInfo::MAX_MOTIVATED);
- content::PreconnectUrl(getter, url, first_party_for_cookies, count,
+ content::PreconnectUrl(getter, url, site_for_cookies, count,
allow_credentials, request_motivation);
}
void Predictor::PredictFrameSubresources(const GURL& url,
- const GURL& first_party_for_cookies) {
+ const GURL& site_for_cookies) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!PredictorEnabled())
@@ -849,12 +848,12 @@
// Add one pass through the message loop to allow current navigation to
// proceed.
if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- PrepareFrameSubresources(url, first_party_for_cookies);
+ PrepareFrameSubresources(url, site_for_cookies);
} else {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::BindOnce(&Predictor::PrepareFrameSubresources,
- base::Unretained(this), url, first_party_for_cookies));
+ base::Unretained(this), url, site_for_cookies));
}
}
@@ -886,7 +885,7 @@
};
void Predictor::PrepareFrameSubresources(const GURL& original_url,
- const GURL& first_party_for_cookies) {
+ const GURL& site_for_cookies) {
// Apply HSTS redirect early so it is taken into account when looking up
// subresources.
GURL url = GetHSTSRedirectOnIOThread(original_url);
@@ -903,7 +902,7 @@
// size of the list with all the "Leaf" nodes in the tree (nodes that don't
// load any subresources). If we learn about this resource, we will instead
// provide a more carefully estimated preconnection count.
- PreconnectUrlOnIOThread(url, first_party_for_cookies,
+ PreconnectUrlOnIOThread(url, site_for_cookies,
UrlInfo::SELF_REFERAL_MOTIVATED,
kAllowCredentialsOnPreconnectByDefault, 2);
return;
@@ -927,8 +926,7 @@
int count = static_cast<int>(std::ceil(connection_expectation));
if (url.host_piece() == future_url->first.host_piece())
++count;
- PreconnectUrlOnIOThread(future_url->first, first_party_for_cookies,
- motivation,
+ PreconnectUrlOnIOThread(future_url->first, site_for_cookies, motivation,
kAllowCredentialsOnPreconnectByDefault, count);
} else if (connection_expectation > kDNSPreresolutionWorthyExpectedValue) {
evalution = PRERESOLUTION;
diff --git a/chrome/browser/net/predictor.h b/chrome/browser/net/predictor.h
index 627509b..9862fee7 100644
--- a/chrome/browser/net/predictor.h
+++ b/chrome/browser/net/predictor.h
@@ -72,7 +72,7 @@
virtual ~PredictorObserver() {}
virtual void OnPreconnectUrl(const GURL& original_url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
UrlInfo::ResolutionMotivation motivation,
int count) {}
virtual void OnLearnFromNavigation(const GURL& referring_url,
@@ -150,7 +150,7 @@
// Preconnect a URL and all of its subresource domains.
void PreconnectUrlAndSubresources(const GURL& url,
- const GURL& first_party_for_cookies);
+ const GURL& site_for_cookies);
static std::vector<GURL> GetPredictedUrlListAtStartup(
PrefService* user_prefs);
@@ -247,13 +247,13 @@
// May be called from either the IO or UI thread and will PostTask
// to the IO thread if necessary.
void PreconnectUrl(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
UrlInfo::ResolutionMotivation motivation,
bool allow_credentials,
int count);
void PreconnectUrlOnIOThread(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
UrlInfo::ResolutionMotivation motivation,
bool allow_credentials,
int count);
@@ -267,8 +267,7 @@
// more-embedded resources on a page). This method will actually post a task
// to do the actual work, so as not to jump ahead of the frame navigation that
// instigated this activity.
- void PredictFrameSubresources(const GURL& url,
- const GURL& first_party_for_cookies);
+ void PredictFrameSubresources(const GURL& url, const GURL& site_for_cookies);
// Put URL in canonical form, including a scheme, host, and port.
// Returns GURL::EmptyGURL() if the scheme is not http/https or if the url
@@ -372,8 +371,7 @@
// Perform actual resolution or preconnection to subresources now. This is
// an internal worker method that is reached via a post task from
// PredictFrameSubresources().
- void PrepareFrameSubresources(const GURL& url,
- const GURL& first_party_for_cookies);
+ void PrepareFrameSubresources(const GURL& url, const GURL& site_for_cookies);
// Access method for use by async lookup request to pass resolution result.
void OnLookupFinished(const GURL& url, int result);
diff --git a/chrome/browser/net/predictor_browsertest.cc b/chrome/browser/net/predictor_browsertest.cc
index fe2a9ba..507ba10 100644
--- a/chrome/browser/net/predictor_browsertest.cc
+++ b/chrome/browser/net/predictor_browsertest.cc
@@ -319,7 +319,7 @@
void OnPreconnectUrl(
const GURL& original_url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
chrome_browser_net::UrlInfo::ResolutionMotivation motivation,
int count) override {
base::AutoLock lock(lock_);
diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc
index 559ce2c..394aabb 100644
--- a/chrome/browser/net/predictor_unittest.cc
+++ b/chrome/browser/net/predictor_unittest.cc
@@ -397,7 +397,7 @@
public:
// PredictorObserver implementation:
void OnPreconnectUrl(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
UrlInfo::ResolutionMotivation motivation,
int count) override {
preconnected_urls_.push_back(url);
diff --git a/chrome/browser/predictors/loading_data_collector.cc b/chrome/browser/predictors/loading_data_collector.cc
index c4e2520..a25193a 100644
--- a/chrome/browser/predictors/loading_data_collector.cc
+++ b/chrome/browser/predictors/loading_data_collector.cc
@@ -239,7 +239,7 @@
content::ResourceType resource_type) {
const GURL& url = response->url();
bool bad_port = !g_allow_port_in_urls && url.has_port();
- if (!response->first_party_for_cookies().SchemeIsHTTPOrHTTPS() ||
+ if (!response->site_for_cookies().SchemeIsHTTPOrHTTPS() ||
!url.SchemeIsHTTPOrHTTPS() || bad_port) {
return false;
}
diff --git a/chrome/browser/predictors/loading_test_util.cc b/chrome/browser/predictors/loading_test_util.cc
index 85440b5..40067c028 100644
--- a/chrome/browser/predictors/loading_test_util.cc
+++ b/chrome/browser/predictors/loading_test_util.cc
@@ -285,7 +285,7 @@
bool is_main_frame) {
std::unique_ptr<net::URLRequest> request = url_request_context.CreateRequest(
url, priority, &g_empty_url_request_delegate);
- request->set_first_party_for_cookies(url);
+ request->set_site_for_cookies(url);
content::ResourceRequestInfo::AllocateForTesting(
request.get(), resource_type, nullptr, -1, -1, -1, is_main_frame, false,
false, true, content::PREVIEWS_OFF);
diff --git a/chrome/browser/predictors/preconnect_manager.cc b/chrome/browser/predictors/preconnect_manager.cc
index 1dfb037..995907e 100644
--- a/chrome/browser/predictors/preconnect_manager.cc
+++ b/chrome/browser/predictors/preconnect_manager.cc
@@ -78,10 +78,9 @@
it->second->was_canceled = true;
}
-void PreconnectManager::PreconnectUrl(
- const GURL& url,
- const GURL& first_party_for_cookies) const {
- content::PreconnectUrl(context_getter_.get(), url, first_party_for_cookies, 1,
+void PreconnectManager::PreconnectUrl(const GURL& url,
+ const GURL& site_for_cookies) const {
+ content::PreconnectUrl(context_getter_.get(), url, site_for_cookies, 1,
kAllowCredentialsOnPreconnectByDefault,
net::HttpRequestInfo::PRECONNECT_MOTIVATED);
}
diff --git a/chrome/browser/predictors/preconnect_manager.h b/chrome/browser/predictors/preconnect_manager.h
index 0b5287b..184b640 100644
--- a/chrome/browser/predictors/preconnect_manager.h
+++ b/chrome/browser/predictors/preconnect_manager.h
@@ -87,7 +87,7 @@
// Public for mocking in unit tests. Don't use, internal only.
virtual void PreconnectUrl(const GURL& url,
- const GURL& first_party_for_cookies) const;
+ const GURL& site_for_cookies) const;
virtual int PreresolveUrl(const GURL& url,
const net::CompletionCallback& callback) const;
diff --git a/chrome/browser/predictors/preconnect_manager_unittest.cc b/chrome/browser/predictors/preconnect_manager_unittest.cc
index 67e4566..2032a13 100644
--- a/chrome/browser/predictors/preconnect_manager_unittest.cc
+++ b/chrome/browser/predictors/preconnect_manager_unittest.cc
@@ -38,8 +38,7 @@
scoped_refptr<net::URLRequestContextGetter> context_getter);
MOCK_CONST_METHOD2(PreconnectUrl,
- void(const GURL& url,
- const GURL& first_party_for_cookies));
+ void(const GURL& url, const GURL& site_for_cookies));
MOCK_CONST_METHOD2(PreresolveUrl,
int(const GURL& url,
const net::CompletionCallback& callback));
diff --git a/chrome/browser/predictors/resource_prefetcher.cc b/chrome/browser/predictors/resource_prefetcher.cc
index 9fa90ef..0415f6ab 100644
--- a/chrome/browser/predictors/resource_prefetcher.cc
+++ b/chrome/browser/predictors/resource_prefetcher.cc
@@ -194,7 +194,7 @@
host_inflight_counts_[url.host()] += 1;
url_request->set_method("GET");
- url_request->set_first_party_for_cookies(main_frame_url_);
+ url_request->set_site_for_cookies(main_frame_url_);
url_request->set_initiator(url::Origin(main_frame_url_));
content::Referrer referrer(main_frame_url_, blink::kWebReferrerPolicyDefault);
diff --git a/chrome/test/data/extensions/api_test/webrequest/test_declarative1.js b/chrome/test/data/extensions/api_test/webrequest/test_declarative1.js
index ad96b3b..8a5b286 100644
--- a/chrome/test/data/extensions/api_test/webrequest/test_declarative1.js
+++ b/chrome/test/data/extensions/api_test/webrequest/test_declarative1.js
@@ -257,7 +257,7 @@
);
},
- function testFirstPartyForCookiesUrl() {
+ function testSiteForCookiesUrl() {
// This is an end-to-end test for firstPartyForCookies. The choice of URL to
// navigate to is purely arbitrary.
ignoreUnexpected = false;
diff --git a/components/data_usage/core/data_use.cc b/components/data_usage/core/data_use.cc
index 838b7ffa..87942617 100644
--- a/components/data_usage/core/data_use.cc
+++ b/components/data_usage/core/data_use.cc
@@ -10,8 +10,7 @@
bool AreNonByteCountFieldsEqual(const DataUse& a, const DataUse& b) {
return a.url == b.url && a.request_start == b.request_start &&
- a.first_party_for_cookies == b.first_party_for_cookies &&
- a.tab_id == b.tab_id &&
+ a.site_for_cookies == b.site_for_cookies && a.tab_id == b.tab_id &&
a.main_frame_global_request_id == b.main_frame_global_request_id &&
a.connection_type == b.connection_type && a.mcc_mnc == b.mcc_mnc;
}
@@ -28,7 +27,7 @@
DataUse::DataUse(const GURL& url,
const base::TimeTicks& request_start,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
int32_t tab_id,
net::NetworkChangeNotifier::ConnectionType connection_type,
const std::string& mcc_mnc,
@@ -36,7 +35,7 @@
int64_t rx_bytes)
: url(url),
request_start(request_start),
- first_party_for_cookies(first_party_for_cookies),
+ site_for_cookies(site_for_cookies),
tab_id(tab_id),
main_frame_global_request_id(DataUse::kInvalidMainFrameGlobalRequestID),
connection_type(connection_type),
diff --git a/components/data_usage/core/data_use.h b/components/data_usage/core/data_use.h
index c399479..27effe3 100644
--- a/components/data_usage/core/data_use.h
+++ b/components/data_usage/core/data_use.h
@@ -24,7 +24,7 @@
DataUse(const GURL& url,
const base::TimeTicks& request_start,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
int32_t tab_id,
net::NetworkChangeNotifier::ConnectionType connection_type,
const std::string& mcc_mnc,
@@ -44,7 +44,7 @@
// The TimeTicks when the request that is associated with these bytes was
// started.
base::TimeTicks request_start;
- GURL first_party_for_cookies;
+ GURL site_for_cookies;
// Tab id where the data use happens. When PlzNavigate is enabled tab id could
// be invalid(-1) for the mainframe request since tab cannot be retrieved yet.
diff --git a/components/data_usage/core/data_use_aggregator.cc b/components/data_usage/core/data_use_aggregator.cc
index 8efb20b..7f4edb0a 100644
--- a/components/data_usage/core/data_use_aggregator.cc
+++ b/components/data_usage/core/data_use_aggregator.cc
@@ -57,7 +57,7 @@
std::unique_ptr<DataUse> data_use(
new DataUse(request->url(), load_timing_info.request_start,
- request->first_party_for_cookies(), -1 /* tab_id */,
+ request->site_for_cookies(), -1 /* tab_id */,
connection_type_, mcc_mnc_, tx_bytes, rx_bytes));
if (!annotator_) {
diff --git a/components/data_usage/core/data_use_aggregator_unittest.cc b/components/data_usage/core/data_use_aggregator_unittest.cc
index 8088c531..7896f75 100644
--- a/components/data_usage/core/data_use_aggregator_unittest.cc
+++ b/components/data_usage/core/data_use_aggregator_unittest.cc
@@ -267,7 +267,7 @@
std::unique_ptr<net::URLRequest> ExecuteRequest(
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
int32_t tab_id,
net::NetworkChangeNotifier::ConnectionType connection_type,
const std::string& mcc_mnc) {
@@ -281,7 +281,7 @@
net::TestDelegate delegate;
std::unique_ptr<net::URLRequest> request = context_->CreateRequest(
url, net::IDLE, &delegate, TRAFFIC_ANNOTATION_FOR_TESTS);
- request->set_first_party_for_cookies(first_party_for_cookies);
+ request->set_site_for_cookies(site_for_cookies);
ReportingNetworkDelegate::DataUseContextMap data_use_context_map;
data_use_context_map[request.get()] =
@@ -368,7 +368,7 @@
data_use_it->url == "http://foo.com/") {
EXPECT_EQ(GetRequestStart(*foo_request), data_use_it->request_start);
EXPECT_EQ(GURL("http://foofirstparty.com"),
- data_use_it->first_party_for_cookies);
+ data_use_it->site_for_cookies);
if (test_case.expect_tab_ids)
EXPECT_EQ(kFooTabId, data_use_it->tab_id);
@@ -395,7 +395,7 @@
EXPECT_EQ(GURL("http://bar.com"), data_use_it->url);
EXPECT_EQ(GetRequestStart(*bar_request), data_use_it->request_start);
EXPECT_EQ(GURL("http://barfirstparty.com"),
- data_use_it->first_party_for_cookies);
+ data_use_it->site_for_cookies);
if (test_case.expect_tab_ids)
EXPECT_EQ(kBarTabId, data_use_it->tab_id);
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index caf8715..21394317 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -329,7 +329,7 @@
blink::WebURLRequest CreateWebURLRequest(const blink::WebDocument& document,
const GURL& gurl) {
blink::WebURLRequest request(gurl);
- request.SetFirstPartyForCookies(document.FirstPartyForCookies());
+ request.SetSiteForCookies(document.SiteForCookies());
// Follow the original behavior in the trusted plugin and
// PepperURLLoaderHost.
diff --git a/content/browser/appcache/appcache_host.cc b/content/browser/appcache/appcache_host.cc
index 10d72168..bbe53db3 100644
--- a/content/browser/appcache/appcache_host.cc
+++ b/content/browser/appcache/appcache_host.cc
@@ -331,7 +331,7 @@
if (AppCacheRequestHandler::IsMainResourceType(resource_type)) {
// Store the first party origin so that it can be used later in SelectCache
// for checking whether the creation of the appcache is allowed.
- first_party_url_ = request->GetFirstPartyForCookies();
+ first_party_url_ = request->GetSiteForCookies();
return base::WrapUnique(new AppCacheRequestHandler(
this, resource_type, should_reset_appcache, std::move(request)));
}
diff --git a/content/browser/appcache/appcache_interceptor.cc b/content/browser/appcache/appcache_interceptor.cc
index ab2ace4..95e24b0 100644
--- a/content/browser/appcache/appcache_interceptor.cc
+++ b/content/browser/appcache/appcache_interceptor.cc
@@ -104,8 +104,7 @@
if (!handler->SanityCheckIsSameService(requester_info->appcache_service())) {
// This can happen when V2 apps and web pages end up in the same storage
// partition.
- const GURL& first_party_url_for_cookies =
- request->first_party_for_cookies();
+ const GURL& first_party_url_for_cookies = request->site_for_cookies();
if (first_party_url_for_cookies.is_valid()) {
// TODO(lazyboy): Remove this once we know which extensions run into this
// issue. See https://crbug.com/612711#c25 for details.
diff --git a/content/browser/appcache/appcache_request.h b/content/browser/appcache/appcache_request.h
index 63dc5ec..b97a1e8 100644
--- a/content/browser/appcache/appcache_request.h
+++ b/content/browser/appcache/appcache_request.h
@@ -34,7 +34,7 @@
virtual const std::string& GetMethod() const = 0;
// Used for cookie policy.
- virtual const GURL& GetFirstPartyForCookies() const = 0;
+ virtual const GURL& GetSiteForCookies() const = 0;
// The referrer for this request.
virtual const GURL GetReferrer() const = 0;
diff --git a/content/browser/appcache/appcache_update_request_base.h b/content/browser/appcache/appcache_update_request_base.h
index 0c3f787..9238d0b 100644
--- a/content/browser/appcache/appcache_update_request_base.h
+++ b/content/browser/appcache/appcache_update_request_base.h
@@ -57,7 +57,7 @@
virtual std::string GetMimeType() const = 0;
// Cookie policy.
- virtual void SetFirstPartyForCookies(const GURL& first_party_for_cookies) = 0;
+ virtual void SetSiteForCookies(const GURL& site_for_cookies) = 0;
// Sets the origin of the context which initiated the request.
virtual void SetInitiator(const base::Optional<url::Origin>& initiator) = 0;
diff --git a/content/browser/appcache/appcache_update_url_fetcher.cc b/content/browser/appcache/appcache_update_url_fetcher.cc
index 2e9634eb..d91d8e63 100644
--- a/content/browser/appcache/appcache_update_url_fetcher.cc
+++ b/content/browser/appcache/appcache_update_url_fetcher.cc
@@ -40,7 +40,7 @@
AppCacheUpdateJob::URLFetcher::~URLFetcher() {}
void AppCacheUpdateJob::URLFetcher::Start() {
- request_->SetFirstPartyForCookies(job_->manifest_url_);
+ request_->SetSiteForCookies(job_->manifest_url_);
request_->SetInitiator(url::Origin(job_->manifest_url_));
if (fetch_type_ == MANIFEST_FETCH && job_->doing_full_update_check_)
request_->SetLoadFlags(request_->GetLoadFlags() | net::LOAD_BYPASS_CACHE);
diff --git a/content/browser/appcache/appcache_update_url_loader_request.cc b/content/browser/appcache/appcache_update_url_loader_request.cc
index 284e1cd..590bd6f 100644
--- a/content/browser/appcache/appcache_update_url_loader_request.cc
+++ b/content/browser/appcache/appcache_update_url_loader_request.cc
@@ -43,9 +43,9 @@
return response_->mime_type;
}
-void AppCacheUpdateJob::UpdateURLLoaderRequest::SetFirstPartyForCookies(
- const GURL& first_party_for_cookies) {
- request_.first_party_for_cookies = first_party_for_cookies;
+void AppCacheUpdateJob::UpdateURLLoaderRequest::SetSiteForCookies(
+ const GURL& site_for_cookies) {
+ request_.site_for_cookies = site_for_cookies;
}
void AppCacheUpdateJob::UpdateURLLoaderRequest::SetInitiator(
diff --git a/content/browser/appcache/appcache_update_url_loader_request.h b/content/browser/appcache/appcache_update_url_loader_request.h
index 50f81506..185f0ff 100644
--- a/content/browser/appcache/appcache_update_url_loader_request.h
+++ b/content/browser/appcache/appcache_update_url_loader_request.h
@@ -44,7 +44,7 @@
void SetLoadFlags(int flags) override;
int GetLoadFlags() const override;
std::string GetMimeType() const override;
- void SetFirstPartyForCookies(const GURL& first_party_for_cookies) override;
+ void SetSiteForCookies(const GURL& site_for_cookies) override;
void SetInitiator(const base::Optional<url::Origin>& initiator) override;
net::HttpResponseHeaders* GetResponseHeaders() const override;
int GetResponseCode() const override;
diff --git a/content/browser/appcache/appcache_update_url_request.cc b/content/browser/appcache/appcache_update_url_request.cc
index 4fdfed0..d307f34 100644
--- a/content/browser/appcache/appcache_update_url_request.cc
+++ b/content/browser/appcache/appcache_update_url_request.cc
@@ -43,9 +43,9 @@
return mime_type;
}
-void AppCacheUpdateJob::UpdateURLRequest::SetFirstPartyForCookies(
- const GURL& first_party_for_cookies) {
- request_->set_first_party_for_cookies(first_party_for_cookies);
+void AppCacheUpdateJob::UpdateURLRequest::SetSiteForCookies(
+ const GURL& site_for_cookies) {
+ request_->set_site_for_cookies(site_for_cookies);
}
void AppCacheUpdateJob::UpdateURLRequest::SetInitiator(
diff --git a/content/browser/appcache/appcache_update_url_request.h b/content/browser/appcache/appcache_update_url_request.h
index cba0cbd94..c2c55a0 100644
--- a/content/browser/appcache/appcache_update_url_request.h
+++ b/content/browser/appcache/appcache_update_url_request.h
@@ -31,7 +31,7 @@
void SetLoadFlags(int flags) override;
int GetLoadFlags() const override;
std::string GetMimeType() const override;
- void SetFirstPartyForCookies(const GURL& first_party_for_cookies) override;
+ void SetSiteForCookies(const GURL& site_for_cookies) override;
void SetInitiator(const base::Optional<url::Origin>& initiator) override;
net::HttpResponseHeaders* GetResponseHeaders() const override;
int GetResponseCode() const override;
diff --git a/content/browser/appcache/appcache_url_loader_request.cc b/content/browser/appcache/appcache_url_loader_request.cc
index 4669be9..f396e5e 100644
--- a/content/browser/appcache/appcache_url_loader_request.cc
+++ b/content/browser/appcache/appcache_url_loader_request.cc
@@ -25,8 +25,8 @@
return request_.method;
}
-const GURL& AppCacheURLLoaderRequest::GetFirstPartyForCookies() const {
- return request_.first_party_for_cookies;
+const GURL& AppCacheURLLoaderRequest::GetSiteForCookies() const {
+ return request_.site_for_cookies;
}
const GURL AppCacheURLLoaderRequest::GetReferrer() const {
diff --git a/content/browser/appcache/appcache_url_loader_request.h b/content/browser/appcache/appcache_url_loader_request.h
index d0435c7..19a893bb 100644
--- a/content/browser/appcache/appcache_url_loader_request.h
+++ b/content/browser/appcache/appcache_url_loader_request.h
@@ -28,7 +28,7 @@
// a chain of redirects.
const GURL& GetURL() const override;
const std::string& GetMethod() const override;
- const GURL& GetFirstPartyForCookies() const override;
+ const GURL& GetSiteForCookies() const override;
const GURL GetReferrer() const override;
// TODO(ananta)
// ResourceRequest only identifies the request unlike URLRequest which
diff --git a/content/browser/appcache/appcache_url_request.cc b/content/browser/appcache/appcache_url_request.cc
index da320b4..2234ff3 100644
--- a/content/browser/appcache/appcache_url_request.cc
+++ b/content/browser/appcache/appcache_url_request.cc
@@ -23,8 +23,8 @@
return url_request_->method();
}
-const GURL& AppCacheURLRequest::GetFirstPartyForCookies() const {
- return url_request_->first_party_for_cookies();
+const GURL& AppCacheURLRequest::GetSiteForCookies() const {
+ return url_request_->site_for_cookies();
}
const GURL AppCacheURLRequest::GetReferrer() const {
diff --git a/content/browser/appcache/appcache_url_request.h b/content/browser/appcache/appcache_url_request.h
index 35291588..d67143f 100644
--- a/content/browser/appcache/appcache_url_request.h
+++ b/content/browser/appcache/appcache_url_request.h
@@ -26,7 +26,7 @@
// AppCacheRequest overrides.
const GURL& GetURL() const override;
const std::string& GetMethod() const override;
- const GURL& GetFirstPartyForCookies() const override;
+ const GURL& GetSiteForCookies() const override;
const GURL GetReferrer() const override;
bool IsSuccess() const override;
bool IsCancelled() const override;
diff --git a/content/browser/download/download_request_core.cc b/content/browser/download/download_request_core.cc
index 590c99f..a57a3819 100644
--- a/content/browser/download/download_request_core.cc
+++ b/content/browser/download/download_request_core.cc
@@ -175,7 +175,7 @@
// Downloads are treated as top level navigations. Hence the first-party
// origin for cookies is always based on the target URL and is updated on
// redirects.
- request->set_first_party_for_cookies(params->url());
+ request->set_site_for_cookies(params->url());
request->set_first_party_url_policy(
net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
request->set_initiator(params->initiator());
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index a9e7b18..c4101840 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -839,7 +839,7 @@
// 'Document::firstPartyForCookies()' in Blink, which walks the ancestor tree
// and verifies that all origins are PSL-matches (and special-cases extension
// URLs).
- const GURL& first_party_for_cookies =
+ const GURL& site_for_cookies =
frame_tree_node_->IsMainFrame()
? common_params_.url
: frame_tree_node_->frame_tree()->root()->current_url();
@@ -861,7 +861,7 @@
loader_ = NavigationURLLoader::Create(
browser_context->GetResourceContext(), partition,
base::MakeUnique<NavigationRequestInfo>(
- common_params_, begin_params_, first_party_for_cookies,
+ common_params_, begin_params_, site_for_cookies,
frame_tree_node_->IsMainFrame(), parent_is_main_frame,
IsSecureFrame(frame_tree_node_->parent()),
frame_tree_node_->frame_tree_node_id(), is_for_guests_only,
diff --git a/content/browser/frame_host/navigation_request_info.cc b/content/browser/frame_host/navigation_request_info.cc
index 65d0007a..3501c37 100644
--- a/content/browser/frame_host/navigation_request_info.cc
+++ b/content/browser/frame_host/navigation_request_info.cc
@@ -10,7 +10,7 @@
NavigationRequestInfo::NavigationRequestInfo(
const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
bool is_main_frame,
bool parent_is_main_frame,
bool are_ancestors_secure,
@@ -20,7 +20,7 @@
blink::WebPageVisibilityState page_visibility_state)
: common_params(common_params),
begin_params(begin_params),
- first_party_for_cookies(first_party_for_cookies),
+ site_for_cookies(site_for_cookies),
is_main_frame(is_main_frame),
parent_is_main_frame(parent_is_main_frame),
are_ancestors_secure(are_ancestors_secure),
diff --git a/content/browser/frame_host/navigation_request_info.h b/content/browser/frame_host/navigation_request_info.h
index cdfc8dc..48c0ff4 100644
--- a/content/browser/frame_host/navigation_request_info.h
+++ b/content/browser/frame_host/navigation_request_info.h
@@ -23,7 +23,7 @@
struct CONTENT_EXPORT NavigationRequestInfo {
NavigationRequestInfo(const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
bool is_main_frame,
bool parent_is_main_frame,
bool are_ancestors_secure,
@@ -38,7 +38,7 @@
// Usually the URL of the document in the top-level window, which may be
// checked by the third-party cookie blocking policy.
- const GURL first_party_for_cookies;
+ const GURL site_for_cookies;
const bool is_main_frame;
const bool parent_is_main_frame;
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc
index a9574ec..71dbfdc3 100644
--- a/content/browser/frame_host/navigator_impl_unittest.cc
+++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -331,7 +331,7 @@
EXPECT_EQ(kUrl2, subframe_request->common_params().url);
EXPECT_EQ(kUrl2, subframe_loader->request_info()->common_params.url);
// First party for cookies url should be that of the main frame.
- EXPECT_EQ(kUrl1, subframe_loader->request_info()->first_party_for_cookies);
+ EXPECT_EQ(kUrl1, subframe_loader->request_info()->site_for_cookies);
EXPECT_FALSE(subframe_loader->request_info()->is_main_frame);
EXPECT_TRUE(subframe_loader->request_info()->parent_is_main_frame);
EXPECT_TRUE(subframe_request->browser_initiated());
@@ -363,7 +363,7 @@
GetLoaderForNavigationRequest(main_request);
EXPECT_EQ(kUrl3, main_request->common_params().url);
EXPECT_EQ(kUrl3, main_loader->request_info()->common_params.url);
- EXPECT_EQ(kUrl3, main_loader->request_info()->first_party_for_cookies);
+ EXPECT_EQ(kUrl3, main_loader->request_info()->site_for_cookies);
EXPECT_TRUE(main_loader->request_info()->is_main_frame);
EXPECT_FALSE(main_loader->request_info()->parent_is_main_frame);
EXPECT_TRUE(main_request->browser_initiated());
diff --git a/content/browser/frame_host/render_frame_message_filter.cc b/content/browser/frame_host/render_frame_message_filter.cc
index 2b5f4f8..f99aeb50 100644
--- a/content/browser/frame_host/render_frame_message_filter.cc
+++ b/content/browser/frame_host/render_frame_message_filter.cc
@@ -328,32 +328,30 @@
*new_routing_id));
}
-void RenderFrameMessageFilter::OnCookiesEnabled(
- int render_frame_id,
- const GURL& url,
- const GURL& first_party_for_cookies,
- bool* cookies_enabled) {
+void RenderFrameMessageFilter::OnCookiesEnabled(int render_frame_id,
+ const GURL& url,
+ const GURL& site_for_cookies,
+ bool* cookies_enabled) {
// TODO(ananta): If this render frame is associated with an automation
// channel, aka ChromeFrame then we need to retrieve cookie settings from the
// external host.
*cookies_enabled = GetContentClient()->browser()->AllowGetCookie(
- url, first_party_for_cookies, net::CookieList(), resource_context_,
+ url, site_for_cookies, net::CookieList(), resource_context_,
render_process_id_, render_frame_id);
}
void RenderFrameMessageFilter::CheckPolicyForCookies(
int render_frame_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
GetCookiesCallback callback,
const net::CookieList& cookie_list) {
net::URLRequestContext* context = GetRequestContextForURL(url);
// Check the policy for get cookies, and pass cookie_list to the
// TabSpecificContentSetting for logging purpose.
- if (context &&
- GetContentClient()->browser()->AllowGetCookie(
- url, first_party_for_cookies, cookie_list, resource_context_,
- render_process_id_, render_frame_id)) {
+ if (context && GetContentClient()->browser()->AllowGetCookie(
+ url, site_for_cookies, cookie_list, resource_context_,
+ render_process_id_, render_frame_id)) {
std::move(callback).Run(net::CookieStore::BuildCookieLine(cookie_list));
} else {
std::move(callback).Run(std::string());
@@ -402,7 +400,7 @@
void RenderFrameMessageFilter::SetCookie(int32_t render_frame_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& cookie) {
ChildProcessSecurityPolicyImpl* policy =
ChildProcessSecurityPolicyImpl::GetInstance();
@@ -414,8 +412,8 @@
net::CookieOptions options;
if (GetContentClient()->browser()->AllowSetCookie(
- url, first_party_for_cookies, cookie, resource_context_,
- render_process_id_, render_frame_id, options)) {
+ url, site_for_cookies, cookie, resource_context_, render_process_id_,
+ render_frame_id, options)) {
net::URLRequestContext* context = GetRequestContextForURL(url);
// Pass a null callback since we don't care about when the 'set' completes.
context->cookie_store()->SetCookieWithOptionsAsync(
@@ -425,7 +423,7 @@
void RenderFrameMessageFilter::GetCookies(int render_frame_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
GetCookiesCallback callback) {
ChildProcessSecurityPolicyImpl* policy =
ChildProcessSecurityPolicyImpl::GetInstance();
@@ -438,7 +436,7 @@
net::CookieOptions options;
if (net::registry_controlled_domains::SameDomainOrHost(
- url, first_party_for_cookies,
+ url, site_for_cookies,
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
// TODO(mkwst): This check ought to further distinguish between frames
// initiated in a strict or lax same-site context.
@@ -459,7 +457,7 @@
context->cookie_store()->GetCookieListWithOptionsAsync(
url, options,
base::Bind(&RenderFrameMessageFilter::CheckPolicyForCookies, this,
- render_frame_id, url, first_party_for_cookies,
+ render_frame_id, url, site_for_cookies,
base::Passed(&callback)));
}
diff --git a/content/browser/frame_host/render_frame_message_filter.h b/content/browser/frame_host/render_frame_message_filter.h
index 3f49cc4..7c40d15 100644
--- a/content/browser/frame_host/render_frame_message_filter.h
+++ b/content/browser/frame_host/render_frame_message_filter.h
@@ -89,13 +89,13 @@
int* new_render_frame_id);
void OnCookiesEnabled(int render_frame_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
bool* cookies_enabled);
// Check the policy for getting cookies. Gets the cookies if allowed.
void CheckPolicyForCookies(int render_frame_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
GetCookiesCallback callback,
const net::CookieList& cookie_list);
@@ -115,11 +115,11 @@
// mojom::RenderFrameMessageFilter:
void SetCookie(int32_t render_frame_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& cookie) override;
void GetCookies(int render_frame_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
GetCookiesCallback callback) override;
#if BUILDFLAG(ENABLE_PLUGINS)
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc
index c7c432fe..a412a1841e 100644
--- a/content/browser/loader/navigation_url_loader_network_service.cc
+++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -396,7 +396,7 @@
new_request->method = request_info->common_params.method;
new_request->url = request_info->common_params.url;
- new_request->first_party_for_cookies = request_info->first_party_for_cookies;
+ new_request->site_for_cookies = request_info->site_for_cookies;
new_request->priority = net::HIGHEST;
// The code below to set fields like request_initiator, referrer, etc has
diff --git a/content/browser/loader/navigation_url_loader_unittest.cc b/content/browser/loader/navigation_url_loader_unittest.cc
index 4f64481..5cb278b 100644
--- a/content/browser/loader/navigation_url_loader_unittest.cc
+++ b/content/browser/loader/navigation_url_loader_unittest.cc
@@ -197,7 +197,7 @@
delegate.redirect_info().new_url);
EXPECT_EQ("GET", delegate.redirect_info().new_method);
EXPECT_EQ(net::URLRequestTestJob::test_url_2(),
- delegate.redirect_info().new_first_party_for_cookies);
+ delegate.redirect_info().new_site_for_cookies);
EXPECT_EQ(302, delegate.redirect_response()->head.headers->response_code());
EXPECT_EQ(1, delegate.on_request_handled_counter());
diff --git a/content/browser/loader/resource_dispatcher_host_browsertest.cc b/content/browser/loader/resource_dispatcher_host_browsertest.cc
index 97044ed1..1e888ae 100644
--- a/content/browser/loader/resource_dispatcher_host_browsertest.cc
+++ b/content/browser/loader/resource_dispatcher_host_browsertest.cc
@@ -839,8 +839,7 @@
ResourceType resource_type,
std::vector<std::unique_ptr<ResourceThrottle>>* throttles) override {
requests_.push_back(base::MakeUnique<RequestDataForDelegate>(
- request->url(), request->first_party_for_cookies(),
- request->initiator()));
+ request->url(), request->site_for_cookies(), request->initiator()));
}
void SetDelegate() { ResourceDispatcherHost::Get()->SetDelegate(this); }
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 1e40d64..f7b8607d 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1310,8 +1310,7 @@
new_request->set_method(request_data.method);
- new_request->set_first_party_for_cookies(
- request_data.first_party_for_cookies);
+ new_request->set_site_for_cookies(request_data.site_for_cookies);
// The initiator should normally be present, unless this is a navigation in
// a top-level frame. It may be null for some top-level navigations (eg:
@@ -1383,7 +1382,7 @@
if (request_data.resource_type == RESOURCE_TYPE_IMAGE &&
HTTP_AUTH_RELATION_BLOCKED_CROSS ==
HttpAuthRelationTypeOf(request_data.url,
- request_data.first_party_for_cookies)) {
+ request_data.site_for_cookies)) {
// Prevent third-party image content from prompting for login, as this
// is often a scam to extract credentials for another domain from the
// user. Only block image loads, as the attack applies largely to the
@@ -2123,8 +2122,7 @@
info.common_params.url, net::HIGHEST, nullptr, kTrafficAnnotation);
new_request->set_method(info.common_params.method);
- new_request->set_first_party_for_cookies(
- info.first_party_for_cookies);
+ new_request->set_site_for_cookies(info.site_for_cookies);
new_request->set_initiator(info.begin_params.initiator_origin);
if (info.is_main_frame) {
new_request->set_first_party_url_policy(
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 0241e5d..0ba21d0 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -163,7 +163,7 @@
ResourceRequest request;
request.method = std::string(method);
request.url = url;
- request.first_party_for_cookies = url; // bypass third-party cookie blocking
+ request.site_for_cookies = url; // bypass third-party cookie blocking
request.request_initiator = url::Origin(url); // ensure initiator is set
request.referrer_policy = blink::kWebReferrerPolicyDefault;
request.load_flags = 0;
diff --git a/content/browser/loader/resource_hints_impl.cc b/content/browser/loader/resource_hints_impl.cc
index 05eb063..46faed62 100644
--- a/content/browser/loader/resource_hints_impl.cc
+++ b/content/browser/loader/resource_hints_impl.cc
@@ -47,7 +47,7 @@
void PreconnectUrl(net::URLRequestContextGetter* getter,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
int count,
bool allow_credentials,
net::HttpRequestInfo::RequestMotivation motivation) {
@@ -75,7 +75,7 @@
request_info.motivation = motivation;
net::NetworkDelegate* delegate = request_context->network_delegate();
- if (delegate->CanEnablePrivacyMode(url, first_party_for_cookies))
+ if (delegate->CanEnablePrivacyMode(url, site_for_cookies))
request_info.privacy_mode = net::PRIVACY_MODE_ENABLED;
// TODO(yoav): Fix this layering violation, since when credentials are not
diff --git a/content/browser/media/android/browser_media_player_manager.cc b/content/browser/media/android/browser_media_player_manager.cc
index f498c4c..0671a0e 100644
--- a/content/browser/media/android/browser_media_player_manager.cc
+++ b/content/browser/media/android/browser_media_player_manager.cc
@@ -93,8 +93,7 @@
const std::string user_agent = GetContentClient()->GetUserAgent();
auto media_player_bridge = base::MakeUnique<MediaPlayerBridge>(
media_player_params.player_id, media_player_params.url,
- media_player_params.first_party_for_cookies, user_agent, hide_url_log,
- this,
+ media_player_params.site_for_cookies, user_agent, hide_url_log, this,
base::Bind(&BrowserMediaPlayerManager::OnDecoderResourcesReleased,
weak_ptr_factory_.GetWeakPtr()),
media_player_params.frame_url, media_player_params.allow_credentials);
diff --git a/content/browser/media/android/media_player_renderer.cc b/content/browser/media/android/media_player_renderer.cc
index 426217d3..415a5a6 100644
--- a/content/browser/media/android/media_player_renderer.cc
+++ b/content/browser/media/android/media_player_renderer.cc
@@ -88,10 +88,11 @@
media_player_.reset(new media::MediaPlayerBridge(
kUnusedAndIrrelevantPlayerId, url_params.media_url,
- url_params.first_party_for_cookies, user_agent,
+ url_params.site_for_cookies, user_agent,
false, // hide_url_log
- this, base::Bind(&MediaPlayerRenderer::OnDecoderResourcesReleased,
- weak_factory_.GetWeakPtr()),
+ this,
+ base::Bind(&MediaPlayerRenderer::OnDecoderResourcesReleased,
+ weak_factory_.GetWeakPtr()),
GURL(), // frame_url
true)); // allow_crendentials
diff --git a/content/browser/media/android/media_resource_getter_impl.cc b/content/browser/media/android/media_resource_getter_impl.cc
index 05ff22c..ca8226d2 100644
--- a/content/browser/media/android/media_resource_getter_impl.cc
+++ b/content/browser/media/android/media_resource_getter_impl.cc
@@ -129,7 +129,7 @@
// Called by MediaResourceGetterImpl to start getting cookies for a URL.
void RequestCookies(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
media::MediaResourceGetter::GetCookieCB callback);
// Returns the task runner that all methods should be called.
@@ -140,7 +140,7 @@
virtual ~MediaResourceGetterTask();
void CheckPolicyForCookies(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
media::MediaResourceGetter::GetCookieCB callback,
const net::CookieList& cookie_list);
@@ -195,7 +195,7 @@
void MediaResourceGetterTask::RequestCookies(
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
media::MediaResourceGetter::GetCookieCB callback) {
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
ChildProcessSecurityPolicyImpl* policy =
@@ -214,7 +214,7 @@
cookie_store->GetAllCookiesForURLAsync(
url, base::BindOnce(&MediaResourceGetterTask::CheckPolicyForCookies, this,
- url, first_party_for_cookies, std::move(callback)));
+ url, site_for_cookies, std::move(callback)));
}
scoped_refptr<base::SingleThreadTaskRunner>
@@ -224,12 +224,12 @@
void MediaResourceGetterTask::CheckPolicyForCookies(
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
media::MediaResourceGetter::GetCookieCB callback,
const net::CookieList& cookie_list) {
if (GetContentClient()->browser()->AllowGetCookie(
- url, first_party_for_cookies, cookie_list,
- resource_context_, render_process_id_, render_frame_id_)) {
+ url, site_for_cookies, cookie_list, resource_context_,
+ render_process_id_, render_frame_id_)) {
net::CookieStore* cookie_store =
context_getter_->GetURLRequestContext()->cookie_store();
net::CookieOptions options;
@@ -270,7 +270,7 @@
}
void MediaResourceGetterImpl::GetCookies(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
GetCookieCB callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_refptr<MediaResourceGetterTask> task = new MediaResourceGetterTask(
@@ -282,7 +282,7 @@
task->GetTaskRunner()->PostTask(
FROM_HERE,
base::BindOnce(&MediaResourceGetterTask::RequestCookies, task, url,
- first_party_for_cookies,
+ site_for_cookies,
base::BindOnce(&ReturnResultOnUIThread, std::move(cb))));
}
diff --git a/content/browser/media/android/media_resource_getter_impl.h b/content/browser/media/android/media_resource_getter_impl.h
index 29d2c7e..abab2da 100644
--- a/content/browser/media/android/media_resource_getter_impl.h
+++ b/content/browser/media/android/media_resource_getter_impl.h
@@ -45,7 +45,7 @@
void GetAuthCredentials(const GURL& url,
GetAuthCredentialsCB callback) override;
void GetCookies(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
GetCookieCB callback) override;
void GetPlatformPathFromURL(const GURL& url,
GetPlatformPathCB callback) override;
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index 6f0ec5a..729037d7 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -137,7 +137,7 @@
ResourceRequest CreateXHRRequestWithOrigin(const char* origin) {
ResourceRequest request = CreateXHRRequest("http://bar.com/simple_page.html");
- request.first_party_for_cookies = GURL(origin);
+ request.site_for_cookies = GURL(origin);
request.headers = base::StringPrintf("Origin: %s\r\n", origin);
return request;
}
diff --git a/content/browser/service_worker/foreign_fetch_request_handler.cc b/content/browser/service_worker/foreign_fetch_request_handler.cc
index f358e13e..da36f68 100644
--- a/content/browser/service_worker/foreign_fetch_request_handler.cc
+++ b/content/browser/service_worker/foreign_fetch_request_handler.cc
@@ -270,7 +270,7 @@
web_contents_getter = request_info->GetWebContentsGetterForRequest();
if (!GetContentClient()->browser()->AllowServiceWorker(
- registration->pattern(), job->request()->first_party_for_cookies(),
+ registration->pattern(), job->request()->site_for_cookies(),
resource_context_, web_contents_getter)) {
job->FallbackToNetwork();
return;
diff --git a/content/browser/service_worker/link_header_support.cc b/content/browser/service_worker/link_header_support.cc
index 9f1fe471..d38fb21 100644
--- a/content/browser/service_worker/link_header_support.cc
+++ b/content/browser/service_worker/link_header_support.cc
@@ -111,8 +111,7 @@
return;
if (!GetContentClient()->browser()->AllowServiceWorker(
- scope_url, request->first_party_for_cookies(),
- request_info->GetContext(),
+ scope_url, request->site_for_cookies(), request_info->GetContext(),
request_info->GetWebContentsGetterForRequest()))
return;
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc
index 8196d4e..c1677885 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -171,7 +171,7 @@
resource_context_ = resource_context;
if (is_main_resource_load_)
- PrepareForMainResource(request->url(), request->first_party_for_cookies());
+ PrepareForMainResource(request->url(), request->site_for_cookies());
else
PrepareForSubResource();
@@ -228,7 +228,7 @@
resource_context_ = resource_context;
PrepareForMainResource(resource_request.url,
- resource_request.first_party_for_cookies);
+ resource_request.site_for_cookies);
if (url_job_->ShouldFallbackToNetwork()) {
// We're falling back to the next URLLoaderRequestHandler, forward
@@ -243,7 +243,7 @@
void ServiceWorkerControlleeRequestHandler::PrepareForMainResource(
const GURL& url,
- const GURL& first_party_for_cookies) {
+ const GURL& site_for_cookies) {
DCHECK(!JobWasCanceled());
DCHECK(context_);
DCHECK(provider_host_);
@@ -261,7 +261,7 @@
stripped_url_ = net::SimplifyUrlForRequest(url);
provider_host_->SetDocumentUrl(stripped_url_);
- provider_host_->SetTopmostFrameUrl(first_party_for_cookies);
+ provider_host_->SetTopmostFrameUrl(site_for_cookies);
context_->storage()->FindRegistrationForDocument(
stripped_url_, base::Bind(&self::DidLookupRegistrationForMainResource,
weak_factory_.GetWeakPtr()));
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.h b/content/browser/service_worker/service_worker_controllee_request_handler.h
index 4ff15c5..6877783 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.h
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.h
@@ -82,8 +82,7 @@
typedef ServiceWorkerControlleeRequestHandler self;
// For main resource case.
- void PrepareForMainResource(const GURL& url,
- const GURL& first_party_for_cookies);
+ void PrepareForMainResource(const GURL& url, const GURL& site_for_cookies);
void DidLookupRegistrationForMainResource(
ServiceWorkerStatusCode status,
scoped_refptr<ServiceWorkerRegistration> registration);
diff --git a/content/browser/service_worker/service_worker_fetch_dispatcher.cc b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
index 5fdfbb3..2fce02e0 100644
--- a/content/browser/service_worker/service_worker_fetch_dispatcher.cc
+++ b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
@@ -622,7 +622,7 @@
ResourceRequest request;
request.method = original_request->method();
request.url = original_request->url();
- // TODO(horo): Set first_party_for_cookies to support Same-site Cookies.
+ // TODO(horo): Set site_for_cookies to support Same-site Cookies.
request.request_initiator = original_request->initiator().has_value()
? original_request->initiator()
: url::Origin(original_request->url());
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index 9a3de11..172566ba 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -74,7 +74,7 @@
return nullptr;
const GURL stripped_url = net::SimplifyUrlForRequest(request->url());
provider_host_->SetDocumentUrl(stripped_url);
- provider_host_->SetTopmostFrameUrl(request->first_party_for_cookies());
+ provider_host_->SetTopmostFrameUrl(request->site_for_cookies());
return nullptr;
}
diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.cc b/content/browser/service_worker/service_worker_write_to_cache_job.cc
index 4dd4aac..988c3d4b 100644
--- a/content/browser/service_worker/service_worker_write_to_cache_job.cc
+++ b/content/browser/service_worker/service_worker_write_to_cache_job.cc
@@ -226,8 +226,7 @@
})");
net_request_ = request()->context()->CreateRequest(
request()->url(), request()->priority(), this, traffic_annotation);
- net_request_->set_first_party_for_cookies(
- request()->first_party_for_cookies());
+ net_request_->set_site_for_cookies(request()->site_for_cookies());
net_request_->set_initiator(request()->initiator());
net_request_->SetReferrer(request()->referrer());
net_request_->SetUserData(URLRequestServiceWorkerData::kUserDataKey,
diff --git a/content/browser/websockets/websocket_impl.cc b/content/browser/websockets/websocket_impl.cc
index a6eba4d..6c164f873 100644
--- a/content/browser/websockets/websocket_impl.cc
+++ b/content/browser/websockets/websocket_impl.cc
@@ -390,17 +390,15 @@
const GURL& socket_url,
const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& user_agent_override,
blink::mojom::WebSocketClientPtr client) {
DVLOG(3) << "WebSocketImpl::AddChannelRequest @"
- << reinterpret_cast<void*>(this)
- << " socket_url=\"" << socket_url << "\" requested_protocols=\""
- << base::JoinString(requested_protocols, ", ")
- << "\" origin=\"" << origin
- << "\" first_party_for_cookies=\"" << first_party_for_cookies
- << "\" user_agent_override=\"" << user_agent_override
- << "\"";
+ << reinterpret_cast<void*>(this) << " socket_url=\"" << socket_url
+ << "\" requested_protocols=\""
+ << base::JoinString(requested_protocols, ", ") << "\" origin=\""
+ << origin << "\" site_for_cookies=\"" << site_for_cookies
+ << "\" user_agent_override=\"" << user_agent_override << "\"";
if (client_ || !client) {
bad_message::ReceivedBadMessage(
@@ -415,16 +413,12 @@
if (delay_ > base::TimeDelta()) {
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
- base::Bind(&WebSocketImpl::AddChannel,
- weak_ptr_factory_.GetWeakPtr(),
- socket_url,
- requested_protocols,
- origin,
- first_party_for_cookies,
+ base::Bind(&WebSocketImpl::AddChannel, weak_ptr_factory_.GetWeakPtr(),
+ socket_url, requested_protocols, origin, site_for_cookies,
user_agent_override),
delay_);
} else {
- AddChannel(socket_url, requested_protocols, origin, first_party_for_cookies,
+ AddChannel(socket_url, requested_protocols, origin, site_for_cookies,
user_agent_override);
}
}
@@ -500,17 +494,13 @@
const GURL& socket_url,
const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& user_agent_override) {
- DVLOG(3) << "WebSocketImpl::AddChannel @"
- << reinterpret_cast<void*>(this)
- << " socket_url=\"" << socket_url
- << "\" requested_protocols=\""
- << base::JoinString(requested_protocols, ", ")
- << "\" origin=\"" << origin
- << "\" first_party_for_cookies=\"" << first_party_for_cookies
- << "\" user_agent_override=\"" << user_agent_override
- << "\"";
+ DVLOG(3) << "WebSocketImpl::AddChannel @" << reinterpret_cast<void*>(this)
+ << " socket_url=\"" << socket_url << "\" requested_protocols=\""
+ << base::JoinString(requested_protocols, ", ") << "\" origin=\""
+ << origin << "\" site_for_cookies=\"" << site_for_cookies
+ << "\" user_agent_override=\"" << user_agent_override << "\"";
DCHECK(!channel_);
@@ -535,7 +525,7 @@
user_agent_override.c_str());
}
channel_->SendAddChannelRequest(socket_url, requested_protocols, origin,
- first_party_for_cookies, additional_headers);
+ site_for_cookies, additional_headers);
if (quota > 0)
SendFlowControl(quota);
}
diff --git a/content/browser/websockets/websocket_impl.h b/content/browser/websockets/websocket_impl.h
index a64863c..7ca1180 100644
--- a/content/browser/websockets/websocket_impl.h
+++ b/content/browser/websockets/websocket_impl.h
@@ -59,7 +59,7 @@
void AddChannelRequest(const GURL& url,
const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& user_agent_override,
blink::mojom::WebSocketClientPtr client) override;
void SendFrame(bool fin,
@@ -78,7 +78,7 @@
void AddChannel(const GURL& socket_url,
const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& user_agent_override);
Delegate* delegate_;
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
index 9407a7f9..25953ff 100644
--- a/content/child/resource_dispatcher_unittest.cc
+++ b/content/child/resource_dispatcher_unittest.cc
@@ -146,7 +146,7 @@
redirect_info.status_code = 302;
redirect_info.new_method = "GET";
redirect_info.new_url = GURL(kTestPageUrl);
- redirect_info.new_first_party_for_cookies = GURL(kTestPageUrl);
+ redirect_info.new_site_for_cookies = GURL(kTestPageUrl);
EXPECT_EQ(true, dispatcher_->OnMessageReceived(ResourceMsg_ReceivedRedirect(
request_id, redirect_info, head)));
}
@@ -206,7 +206,7 @@
request->method = "GET";
request->url = GURL(kTestPageUrl);
- request->first_party_for_cookies = GURL(kTestPageUrl);
+ request->site_for_cookies = GURL(kTestPageUrl);
request->referrer_policy = blink::kWebReferrerPolicyDefault;
request->resource_type = RESOURCE_TYPE_SUB_RESOURCE;
request->priority = net::LOW;
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index 01bf7c4..fd674b2 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -580,7 +580,7 @@
resource_request->method = method;
resource_request->url = url_;
- resource_request->first_party_for_cookies = request.FirstPartyForCookies();
+ resource_request->site_for_cookies = request.SiteForCookies();
resource_request->request_initiator =
request.RequestorOrigin().IsNull()
? base::Optional<url::Origin>()
@@ -699,7 +699,7 @@
url_ = WebURL(redirect_info.new_url);
return client_->WillFollowRedirect(
- url_, redirect_info.new_first_party_for_cookies,
+ url_, redirect_info.new_site_for_cookies,
WebString::FromUTF8(redirect_info.new_referrer),
NetReferrerPolicyToBlinkReferrerPolicy(redirect_info.new_referrer_policy),
WebString::FromUTF8(redirect_info.new_method), response,
diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc
index 9296fd35..cc6c4e86 100644
--- a/content/child/web_url_loader_impl_unittest.cc
+++ b/content/child/web_url_loader_impl_unittest.cc
@@ -145,7 +145,7 @@
// blink::WebURLLoaderClient implementation:
bool WillFollowRedirect(const blink::WebURL& new_url,
- const blink::WebURL& new_first_party_for_cookies,
+ const blink::WebURL& new_site_for_cookies,
const blink::WebString& new_referrer,
blink::WebReferrerPolicy new_referrer_policy,
const blink::WebString& new_method,
@@ -288,7 +288,7 @@
redirect_info.status_code = 302;
redirect_info.new_method = "GET";
redirect_info.new_url = GURL(kTestURL);
- redirect_info.new_first_party_for_cookies = GURL(kTestURL);
+ redirect_info.new_site_for_cookies = GURL(kTestURL);
peer()->OnReceivedRedirect(redirect_info,
content::ResourceResponseInfo());
EXPECT_TRUE(client()->did_receive_redirect());
@@ -300,7 +300,7 @@
redirect_info.status_code = 302;
redirect_info.new_method = "GET";
redirect_info.new_url = GURL(kTestHTTPSURL);
- redirect_info.new_first_party_for_cookies = GURL(kTestHTTPSURL);
+ redirect_info.new_site_for_cookies = GURL(kTestHTTPSURL);
peer()->OnReceivedRedirect(redirect_info,
content::ResourceResponseInfo());
EXPECT_TRUE(client()->did_receive_redirect());
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 037a820a..e9ad8745 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -1259,7 +1259,7 @@
IPC_SYNC_MESSAGE_CONTROL3_1(FrameHostMsg_CookiesEnabled,
int /* render_frame_id */,
GURL /* url */,
- GURL /* first_party_for_cookies */,
+ GURL /* site_for_cookies */,
bool /* cookies_enabled */)
// Sent by the renderer process to check whether client 3D APIs
diff --git a/content/common/media/media_player_messages_android.h b/content/common/media/media_player_messages_android.h
index 713d9709..712e3d0c 100644
--- a/content/common/media/media_player_messages_android.h
+++ b/content/common/media/media_player_messages_android.h
@@ -29,7 +29,7 @@
IPC_STRUCT_MEMBER(MediaPlayerHostMsg_Initialize_Type, type)
IPC_STRUCT_MEMBER(int, player_id)
IPC_STRUCT_MEMBER(GURL, url)
- IPC_STRUCT_MEMBER(GURL, first_party_for_cookies)
+ IPC_STRUCT_MEMBER(GURL, site_for_cookies)
IPC_STRUCT_MEMBER(GURL, frame_url)
IPC_STRUCT_MEMBER(bool, allow_credentials)
IPC_STRUCT_MEMBER(int, delegate_id)
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h
index e0e0364..9d0417c 100644
--- a/content/common/resource_messages.h
+++ b/content/common/resource_messages.h
@@ -231,7 +231,7 @@
IPC_STRUCT_TRAITS_MEMBER(status_code)
IPC_STRUCT_TRAITS_MEMBER(new_method)
IPC_STRUCT_TRAITS_MEMBER(new_url)
- IPC_STRUCT_TRAITS_MEMBER(new_first_party_for_cookies)
+ IPC_STRUCT_TRAITS_MEMBER(new_site_for_cookies)
IPC_STRUCT_TRAITS_MEMBER(new_referrer)
IPC_STRUCT_TRAITS_MEMBER(new_referrer_policy)
IPC_STRUCT_TRAITS_MEMBER(referred_token_binding_host)
@@ -251,7 +251,7 @@
IPC_STRUCT_TRAITS_BEGIN(content::ResourceRequest)
IPC_STRUCT_TRAITS_MEMBER(method)
IPC_STRUCT_TRAITS_MEMBER(url)
- IPC_STRUCT_TRAITS_MEMBER(first_party_for_cookies)
+ IPC_STRUCT_TRAITS_MEMBER(site_for_cookies)
IPC_STRUCT_TRAITS_MEMBER(request_initiator)
IPC_STRUCT_TRAITS_MEMBER(referrer)
IPC_STRUCT_TRAITS_MEMBER(referrer_policy)
diff --git a/content/network/url_loader_impl.cc b/content/network/url_loader_impl.cc
index c21d17b..b244f79 100644
--- a/content/network/url_loader_impl.cc
+++ b/content/network/url_loader_impl.cc
@@ -180,7 +180,7 @@
GURL(request.url), net::DEFAULT_PRIORITY, this, traffic_annotation);
url_request_->set_method(request.method);
- url_request_->set_first_party_for_cookies(request.first_party_for_cookies);
+ url_request_->set_site_for_cookies(request.site_for_cookies);
const Referrer referrer(request.referrer, request.referrer_policy);
Referrer::SetReferrerForRequest(url_request_.get(), referrer);
diff --git a/content/network/url_loader_unittest.cc b/content/network/url_loader_unittest.cc
index 022e0263..f099480 100644
--- a/content/network/url_loader_unittest.cc
+++ b/content/network/url_loader_unittest.cc
@@ -40,7 +40,7 @@
ResourceRequest request;
request.method = std::string(method);
request.url = url;
- request.first_party_for_cookies = url; // bypass third-party cookie blocking
+ request.site_for_cookies = url; // bypass third-party cookie blocking
request.request_initiator = url::Origin(url); // ensure initiator is set
request.referrer_policy = blink::kWebReferrerPolicyDefault;
request.load_flags = 0;
diff --git a/content/ppapi_plugin/ppapi_blink_platform_impl.cc b/content/ppapi_plugin/ppapi_blink_platform_impl.cc
index 05c922ed..bf393b7 100644
--- a/content/ppapi_plugin/ppapi_blink_platform_impl.cc
+++ b/content/ppapi_plugin/ppapi_blink_platform_impl.cc
@@ -184,16 +184,15 @@
*channel2 = nullptr;
}
-void PpapiBlinkPlatformImpl::setCookies(
- const blink::WebURL& url,
- const blink::WebURL& first_party_for_cookies,
- const blink::WebString& value) {
+void PpapiBlinkPlatformImpl::setCookies(const blink::WebURL& url,
+ const blink::WebURL& site_for_cookies,
+ const blink::WebString& value) {
NOTREACHED();
}
blink::WebString PpapiBlinkPlatformImpl::cookies(
const blink::WebURL& url,
- const blink::WebURL& first_party_for_cookies) {
+ const blink::WebURL& site_for_cookies) {
NOTREACHED();
return blink::WebString();
}
diff --git a/content/ppapi_plugin/ppapi_blink_platform_impl.h b/content/ppapi_plugin/ppapi_blink_platform_impl.h
index fc83aea6..f768451 100644
--- a/content/ppapi_plugin/ppapi_blink_platform_impl.h
+++ b/content/ppapi_plugin/ppapi_blink_platform_impl.h
@@ -36,11 +36,10 @@
std::unique_ptr<blink::WebMessagePortChannel>* channel1,
std::unique_ptr<blink::WebMessagePortChannel>* channel2) override;
virtual void setCookies(const blink::WebURL& url,
- const blink::WebURL& first_party_for_cookies,
+ const blink::WebURL& site_for_cookies,
const blink::WebString& value);
- virtual blink::WebString cookies(
- const blink::WebURL& url,
- const blink::WebURL& first_party_for_cookies);
+ virtual blink::WebString cookies(const blink::WebURL& url,
+ const blink::WebURL& site_for_cookies);
blink::WebString DefaultLocale() override;
blink::WebThemeEngine* ThemeEngine() override;
std::unique_ptr<blink::WebURLLoader> CreateURLLoader(
diff --git a/content/public/browser/resource_hints.h b/content/public/browser/resource_hints.h
index 3d8092ed..0364cf0 100644
--- a/content/public/browser/resource_hints.h
+++ b/content/public/browser/resource_hints.h
@@ -30,7 +30,7 @@
CONTENT_EXPORT void PreconnectUrl(
net::URLRequestContextGetter* getter,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
int count,
bool allow_credentials,
net::HttpRequestInfo::RequestMotivation motivation);
diff --git a/content/public/common/resource_request.h b/content/public/common/resource_request.h
index 2b987cd..2f767350a 100644
--- a/content/public/common/resource_request.h
+++ b/content/public/common/resource_request.h
@@ -42,9 +42,9 @@
// checked by the third-party cookie blocking policy. This is usually the URL
// of the document in the top-level window. Leaving it empty may lead to
// undesired cookie blocking. Third-party cookie blocking can be bypassed by
- // setting first_party_for_cookies = url, but this should ideally only be
+ // setting site_for_cookies = url, but this should ideally only be
// done if there really is no way to determine the correct value.
- GURL first_party_for_cookies;
+ GURL site_for_cookies;
// The origin of the context which initiated the request, which will be used
// for cookie checks like 'First-Party-Only'.
diff --git a/content/public/test/navigation_simulator.cc b/content/public/test/navigation_simulator.cc
index f79fa43..339a2f7 100644
--- a/content/public/test/navigation_simulator.cc
+++ b/content/public/test/navigation_simulator.cc
@@ -205,7 +205,7 @@
redirect_info.status_code = 302;
redirect_info.new_method = "GET";
redirect_info.new_url = new_url;
- redirect_info.new_first_party_for_cookies = new_url;
+ redirect_info.new_site_for_cookies = new_url;
redirect_info.new_referrer = referrer_.url.spec();
redirect_info.new_referrer_policy =
Referrer::ReferrerPolicyForUrlRequest(referrer_);
diff --git a/content/public/test/test_download_request_handler.cc b/content/public/test/test_download_request_handler.cc
index 45287b19..55fd623 100644
--- a/content/public/test/test_download_request_handler.cc
+++ b/content/public/test/test_download_request_handler.cc
@@ -325,8 +325,7 @@
completed_request->initiator = request()->initiator().has_value()
? request()->initiator().value()
: url::Origin();
- completed_request->first_party_for_cookies =
- request()->first_party_for_cookies();
+ completed_request->site_for_cookies = request()->site_for_cookies();
completed_request->first_party_url_policy =
request()->first_party_url_policy();
interceptor_->AddCompletedRequest(std::move(completed_request));
diff --git a/content/public/test/test_download_request_handler.h b/content/public/test/test_download_request_handler.h
index aabd282..4025d34fb 100644
--- a/content/public/test/test_download_request_handler.h
+++ b/content/public/test/test_download_request_handler.h
@@ -215,7 +215,7 @@
net::URLRequest::ReferrerPolicy referrer_policy =
net::URLRequest::NEVER_CLEAR_REFERRER;
- GURL first_party_for_cookies;
+ GURL site_for_cookies;
net::URLRequest::FirstPartyURLPolicy first_party_url_policy =
net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
diff --git a/content/renderer/fetchers/associated_resource_fetcher_impl.cc b/content/renderer/fetchers/associated_resource_fetcher_impl.cc
index 5e16994..3fe7080 100644
--- a/content/renderer/fetchers/associated_resource_fetcher_impl.cc
+++ b/content/renderer/fetchers/associated_resource_fetcher_impl.cc
@@ -166,7 +166,7 @@
request_.SetRequestContext(request_context);
request_.SetFrameType(frame_type);
- request_.SetFirstPartyForCookies(frame->GetDocument().FirstPartyForCookies());
+ request_.SetSiteForCookies(frame->GetDocument().SiteForCookies());
request_.SetFetchRequestMode(fetch_request_mode);
request_.SetFetchCredentialsMode(fetch_credentials_mode);
diff --git a/content/renderer/fetchers/resource_fetcher_impl.cc b/content/renderer/fetchers/resource_fetcher_impl.cc
index 46b770f..dcbbb10 100644
--- a/content/renderer/fetchers/resource_fetcher_impl.cc
+++ b/content/renderer/fetchers/resource_fetcher_impl.cc
@@ -182,7 +182,7 @@
DCHECK_NE("GET", request_.HttpMethod().Utf8()) << "GETs can't have bodies.";
request_.SetRequestContext(request_context);
- request_.SetFirstPartyForCookies(frame->GetDocument().FirstPartyForCookies());
+ request_.SetSiteForCookies(frame->GetDocument().SiteForCookies());
request_.SetRequestorOrigin(frame->GetDocument().GetSecurityOrigin());
request_.AddHTTPOriginIfNeeded(blink::WebSecurityOrigin::CreateUnique());
diff --git a/content/renderer/media/android/renderer_media_player_manager.cc b/content/renderer/media/android/renderer_media_player_manager.cc
index ee71e878..9bd3c0ab 100644
--- a/content/renderer/media/android/renderer_media_player_manager.cc
+++ b/content/renderer/media/android/renderer_media_player_manager.cc
@@ -67,7 +67,7 @@
MediaPlayerHostMsg_Initialize_Type type,
int player_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const GURL& frame_url,
bool allow_credentials,
int delegate_id) {
@@ -75,7 +75,7 @@
media_player_params.type = type;
media_player_params.player_id = player_id;
media_player_params.url = url;
- media_player_params.first_party_for_cookies = first_party_for_cookies;
+ media_player_params.site_for_cookies = site_for_cookies;
media_player_params.frame_url = frame_url;
media_player_params.allow_credentials = allow_credentials;
media_player_params.delegate_id = delegate_id;
diff --git a/content/renderer/media/android/renderer_media_player_manager.h b/content/renderer/media/android/renderer_media_player_manager.h
index a2ea4fb..6c48bed7 100644
--- a/content/renderer/media/android/renderer_media_player_manager.h
+++ b/content/renderer/media/android/renderer_media_player_manager.h
@@ -39,7 +39,7 @@
void Initialize(MediaPlayerHostMsg_Initialize_Type type,
int player_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const GURL& frame_url,
bool allow_credentials,
int delegate_id) override;
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index f5762cf..ea83dcf 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -3304,7 +3304,7 @@
pp_instance_, &completed_request, frame, &web_request)) {
return PP_ERROR_FAILED;
}
- web_request.SetFirstPartyForCookies(document.FirstPartyForCookies());
+ web_request.SetSiteForCookies(document.SiteForCookies());
if (IsProcessingUserGesture())
web_request.SetHasUserGesture(true);
diff --git a/content/renderer/pepper/url_request_info_util.cc b/content/renderer/pepper/url_request_info_util.cc
index f01f0b73..c3ade42 100644
--- a/content/renderer/pepper/url_request_info_util.cc
+++ b/content/renderer/pepper/url_request_info_util.cc
@@ -176,7 +176,7 @@
if (!data->method.empty())
dest->SetHTTPMethod(WebString::FromUTF8(data->method));
- dest->SetFirstPartyForCookies(frame->GetDocument().FirstPartyForCookies());
+ dest->SetSiteForCookies(frame->GetDocument().SiteForCookies());
const std::string& headers = data->headers;
if (!headers.empty()) {
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 7a3fdd9..9c5a667 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3019,8 +3019,8 @@
base::MakeUnique<WorkerFetchContextImpl>(
worker_url_loader_factory_provider.PassInterface());
worker_fetch_context->set_parent_frame_id(routing_id_);
- worker_fetch_context->set_first_party_for_cookies(
- frame_->GetDocument().FirstPartyForCookies());
+ worker_fetch_context->set_site_for_cookies(
+ frame_->GetDocument().SiteForCookies());
worker_fetch_context->set_is_secure_context(
frame_->GetDocument().IsSecureContext());
blink::WebServiceWorkerNetworkProvider* web_provider =
@@ -6405,12 +6405,12 @@
blink::WebURLRequest& request = info.url_request;
- // Set RequestorOrigin and FirstPartyForCookies
+ // Set RequestorOrigin and SiteForCookies
WebDocument frame_document = frame_->GetDocument();
if (request.GetFrameType() == blink::WebURLRequest::kFrameTypeTopLevel)
- request.SetFirstPartyForCookies(request.Url());
+ request.SetSiteForCookies(request.Url());
else
- request.SetFirstPartyForCookies(frame_document.FirstPartyForCookies());
+ request.SetSiteForCookies(frame_document.SiteForCookies());
request.SetRequestorOrigin(frame_document.GetSecurityOrigin());
// Note: At this stage, the goal is to apply all the modifications the
diff --git a/content/renderer/renderer_webcookiejar_impl.cc b/content/renderer/renderer_webcookiejar_impl.cc
index 7478ca2e..fc25e80 100644
--- a/content/renderer/renderer_webcookiejar_impl.cc
+++ b/content/renderer/renderer_webcookiejar_impl.cc
@@ -16,29 +16,27 @@
namespace content {
void RendererWebCookieJarImpl::SetCookie(const WebURL& url,
- const WebURL& first_party_for_cookies,
+ const WebURL& site_for_cookies,
const WebString& value) {
std::string value_utf8 =
value.Utf8(WebString::UTF8ConversionMode::kStrictReplacingErrorsWithFFFD);
RenderThreadImpl::current()->render_frame_message_filter()->SetCookie(
- sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8);
+ sender_->GetRoutingID(), url, site_for_cookies, value_utf8);
}
-WebString RendererWebCookieJarImpl::Cookies(
- const WebURL& url,
- const WebURL& first_party_for_cookies) {
+WebString RendererWebCookieJarImpl::Cookies(const WebURL& url,
+ const WebURL& site_for_cookies) {
std::string value_utf8;
RenderThreadImpl::current()->render_frame_message_filter()->GetCookies(
- sender_->GetRoutingID(), url, first_party_for_cookies, &value_utf8);
+ sender_->GetRoutingID(), url, site_for_cookies, &value_utf8);
return WebString::FromUTF8(value_utf8);
}
-bool RendererWebCookieJarImpl::CookiesEnabled(
- const WebURL& url,
- const WebURL& first_party_for_cookies) {
+bool RendererWebCookieJarImpl::CookiesEnabled(const WebURL& url,
+ const WebURL& site_for_cookies) {
bool cookies_enabled = false;
sender_->Send(new FrameHostMsg_CookiesEnabled(
- sender_->GetRoutingID(), url, first_party_for_cookies, &cookies_enabled));
+ sender_->GetRoutingID(), url, site_for_cookies, &cookies_enabled));
return cookies_enabled;
}
diff --git a/content/renderer/renderer_webcookiejar_impl.h b/content/renderer/renderer_webcookiejar_impl.h
index 6722335..f15b098 100644
--- a/content/renderer/renderer_webcookiejar_impl.h
+++ b/content/renderer/renderer_webcookiejar_impl.h
@@ -21,13 +21,12 @@
private:
// blink::WebCookieJar methods:
void SetCookie(const blink::WebURL& url,
- const blink::WebURL& first_party_for_cookies,
+ const blink::WebURL& site_for_cookies,
const blink::WebString& value) override;
- blink::WebString Cookies(
- const blink::WebURL& url,
- const blink::WebURL& first_party_for_cookies) override;
+ blink::WebString Cookies(const blink::WebURL& url,
+ const blink::WebURL& site_for_cookies) override;
bool CookiesEnabled(const blink::WebURL& url,
- const blink::WebURL& first_party_for_cookies) override;
+ const blink::WebURL& site_for_cookies) override;
RenderFrameImpl* sender_;
};
diff --git a/content/renderer/service_worker/service_worker_fetch_context_impl.cc b/content/renderer/service_worker/service_worker_fetch_context_impl.cc
index 6fc427c8..b12ba76 100644
--- a/content/renderer/service_worker/service_worker_fetch_context_impl.cc
+++ b/content/renderer/service_worker/service_worker_fetch_context_impl.cc
@@ -58,11 +58,11 @@
return is_data_saver_enabled_;
}
-blink::WebURL ServiceWorkerFetchContextImpl::FirstPartyForCookies() const {
+blink::WebURL ServiceWorkerFetchContextImpl::SiteForCookies() const {
// According to the spec, we can use the |worker_script_url_| for
- // FirstPartyForCookies, because "site for cookies" for the service worker is
+ // SiteForCookies, because "site for cookies" for the service worker is
// the service worker's origin's host's registrable domain.
- // https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1.2
+ // https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-07#section-2.1.2
return worker_script_url_;
}
diff --git a/content/renderer/service_worker/service_worker_fetch_context_impl.h b/content/renderer/service_worker/service_worker_fetch_context_impl.h
index d15c1fe0..230dbad 100644
--- a/content/renderer/service_worker/service_worker_fetch_context_impl.h
+++ b/content/renderer/service_worker/service_worker_fetch_context_impl.h
@@ -33,7 +33,7 @@
bool IsControlledByServiceWorker() const override;
void SetDataSaverEnabled(bool enabled) override;
bool IsDataSaverEnabled() const override;
- blink::WebURL FirstPartyForCookies() const override;
+ blink::WebURL SiteForCookies() const override;
private:
const GURL worker_script_url_;
diff --git a/content/renderer/service_worker/worker_fetch_context_impl.cc b/content/renderer/service_worker/worker_fetch_context_impl.cc
index 70f7d5f..bb9274d 100644
--- a/content/renderer/service_worker/worker_fetch_context_impl.cc
+++ b/content/renderer/service_worker/worker_fetch_context_impl.cc
@@ -83,8 +83,8 @@
return is_on_sub_frame_;
}
-blink::WebURL WorkerFetchContextImpl::FirstPartyForCookies() const {
- return first_party_for_cookies_;
+blink::WebURL WorkerFetchContextImpl::SiteForCookies() const {
+ return site_for_cookies_;
}
void WorkerFetchContextImpl::DidRunContentWithCertificateErrors(
@@ -131,9 +131,9 @@
parent_frame_id_ = id;
}
-void WorkerFetchContextImpl::set_first_party_for_cookies(
- const blink::WebURL& first_party_for_cookies) {
- first_party_for_cookies_ = first_party_for_cookies;
+void WorkerFetchContextImpl::set_site_for_cookies(
+ const blink::WebURL& site_for_cookies) {
+ site_for_cookies_ = site_for_cookies;
}
void WorkerFetchContextImpl::set_is_secure_context(bool flag) {
diff --git a/content/renderer/service_worker/worker_fetch_context_impl.h b/content/renderer/service_worker/worker_fetch_context_impl.h
index 4da155f..1bb00d5 100644
--- a/content/renderer/service_worker/worker_fetch_context_impl.h
+++ b/content/renderer/service_worker/worker_fetch_context_impl.h
@@ -50,7 +50,7 @@
bool IsDataSaverEnabled() const override;
void SetIsOnSubframe(bool) override;
bool IsOnSubframe() const override;
- blink::WebURL FirstPartyForCookies() const override;
+ blink::WebURL SiteForCookies() const override;
void DidRunContentWithCertificateErrors(const blink::WebURL& url) override;
void DidDisplayContentWithCertificateErrors(
const blink::WebURL& url) override;
@@ -71,8 +71,7 @@
void set_service_worker_provider_id(int id);
void set_is_controlled_by_service_worker(bool flag);
void set_parent_frame_id(int id);
- void set_first_party_for_cookies(
- const blink::WebURL& first_party_for_cookies);
+ void set_site_for_cookies(const blink::WebURL& site_for_cookies);
// Sets whether the worker context is a secure context.
// https://w3c.github.io/webappsec-secure-contexts/
void set_is_secure_context(bool flag);
@@ -101,7 +100,7 @@
bool is_data_saver_enabled_ = false;
bool is_on_sub_frame_ = false;
int parent_frame_id_ = MSG_ROUTING_NONE;
- GURL first_party_for_cookies_;
+ GURL site_for_cookies_;
bool is_secure_context_ = false;
int appcache_host_id_ = blink::WebApplicationCacheHost::kAppCacheNoHostId;
};
diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.cc b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
index ea6edd6..0afbe418 100644
--- a/content/renderer/shared_worker/embedded_shared_worker_stub.cc
+++ b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
@@ -269,8 +269,8 @@
// TODO(horo): To get the correct first_party_to_cookies for the shared
// worker, we need to check the all documents bounded by the shared worker.
// (crbug.com/723553)
- // https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1.2
- worker_fetch_context->set_first_party_for_cookies(url_);
+ // https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-07#section-2.1.2
+ worker_fetch_context->set_site_for_cookies(url_);
// TODO(horo): Currently we treat the worker context as secure if the origin
// of the shared worker script url is secure. But according to the spec, if
// the creation context is not secure, we should treat the worker as
diff --git a/content/shell/browser/shell_network_delegate.cc b/content/shell/browser/shell_network_delegate.cc
index 46252eb..6f59e83 100644
--- a/content/shell/browser/shell_network_delegate.cc
+++ b/content/shell/browser/shell_network_delegate.cc
@@ -92,8 +92,7 @@
net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES :
net::StaticCookiePolicy::ALLOW_ALL_COOKIES;
net::StaticCookiePolicy policy(policy_type);
- int rv =
- policy.CanAccessCookies(request.url(), request.first_party_for_cookies());
+ int rv = policy.CanAccessCookies(request.url(), request.site_for_cookies());
return rv == net::OK;
}
@@ -104,8 +103,7 @@
net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES :
net::StaticCookiePolicy::ALLOW_ALL_COOKIES;
net::StaticCookiePolicy policy(policy_type);
- int rv =
- policy.CanAccessCookies(request.url(), request.first_party_for_cookies());
+ int rv = policy.CanAccessCookies(request.url(), request.site_for_cookies());
return rv == net::OK;
}
diff --git a/content/shell/test_runner/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc
index b09747b..7a45d68 100644
--- a/content/shell/test_runner/web_frame_test_client.cc
+++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -555,7 +555,7 @@
GURL url = request.Url();
std::string request_url = url.possibly_invalid_spec();
- GURL main_document_url = request.FirstPartyForCookies();
+ GURL main_document_url = request.SiteForCookies();
if (test_runner()->shouldDumpResourceLoadCallbacks()) {
delegate_->PrintMessage(DescriptionSuitableForTestResult(request_url));
diff --git a/content/test/test_navigation_url_loader.cc b/content/test/test_navigation_url_loader.cc
index 6a7477d..1c07a2f3 100644
--- a/content/test/test_navigation_url_loader.cc
+++ b/content/test/test_navigation_url_loader.cc
@@ -43,7 +43,7 @@
redirect_info.status_code = 302;
redirect_info.new_method = "GET";
redirect_info.new_url = redirect_url;
- redirect_info.new_first_party_for_cookies = redirect_url;
+ redirect_info.new_site_for_cookies = redirect_url;
scoped_refptr<ResourceResponse> response(new ResourceResponse);
CallOnRequestRedirected(redirect_info, response);
}
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc
index 95263dc..6fff29d 100644
--- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc
+++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc
@@ -758,8 +758,7 @@
const net::StaticCookiePolicy block_third_party_policy(
net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES);
const int can_get_cookies = block_third_party_policy.CanAccessCookies(
- request_data.request->url(),
- request_data.request->first_party_for_cookies());
+ request_data.request->url(), request_data.request->site_for_cookies());
const bool is_first_party = (can_get_cookies == net::OK);
return match_third_party_ ? !is_first_party : is_first_party;
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
index e467d33..ef7fffdc 100644
--- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
+++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
@@ -243,19 +243,19 @@
if (!(kActiveStages & i))
continue;
const RequestStage stage = static_cast<RequestStage>(i);
- url_request->set_first_party_for_cookies(url_empty);
+ url_request->set_site_for_cookies(url_empty);
EXPECT_FALSE(third_party_attribute->IsFulfilled(
WebRequestData(url_request.get(), stage)));
EXPECT_TRUE(first_party_attribute->IsFulfilled(
WebRequestData(url_request.get(), stage)));
- url_request->set_first_party_for_cookies(url_b);
+ url_request->set_site_for_cookies(url_b);
EXPECT_TRUE(third_party_attribute->IsFulfilled(
WebRequestData(url_request.get(), stage)));
EXPECT_FALSE(first_party_attribute->IsFulfilled(
WebRequestData(url_request.get(), stage)));
- url_request->set_first_party_for_cookies(url_a);
+ url_request->set_site_for_cookies(url_a);
EXPECT_FALSE(third_party_attribute->IsFulfilled(
WebRequestData(url_request.get(), stage)));
EXPECT_TRUE(first_party_attribute->IsFulfilled(
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.cc b/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.cc
index a9f370a..9f82787 100644
--- a/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.cc
+++ b/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.cc
@@ -57,8 +57,8 @@
WebRequestDataWithMatchIds request_data(&request_data_without_ids);
request_data.url_match_ids = url_matcher_.MatchURL(
request_data.data->request->url());
- request_data.first_party_url_match_ids = url_matcher_.MatchURL(
- request_data.data->request->first_party_for_cookies());
+ request_data.first_party_url_match_ids =
+ url_matcher_.MatchURL(request_data.data->request->site_for_cookies());
// 1st phase -- add all rules with some conditions without UrlFilter
// attributes.
diff --git a/extensions/browser/extension_throttle_manager.cc b/extensions/browser/extension_throttle_manager.cc
index bc3a810a..5819b57 100644
--- a/extensions/browser/extension_throttle_manager.cc
+++ b/extensions/browser/extension_throttle_manager.cc
@@ -60,8 +60,7 @@
std::unique_ptr<content::ResourceThrottle>
ExtensionThrottleManager::MaybeCreateThrottle(const net::URLRequest* request) {
- if (request->first_party_for_cookies().scheme() !=
- extensions::kExtensionScheme) {
+ if (request->site_for_cookies().scheme() != extensions::kExtensionScheme) {
return nullptr;
}
return base::MakeUnique<extensions::ExtensionRequestLimitingThrottle>(request,
diff --git a/headless/lib/headless_browser_browsertest.cc b/headless/lib/headless_browser_browsertest.cc
index 7bb186f..31515180 100644
--- a/headless/lib/headless_browser_browsertest.cc
+++ b/headless/lib/headless_browser_browsertest.cc
@@ -458,7 +458,7 @@
// See net::URLRequestHttpJob::AddCookieHeaderAndStart().
url::Origin requested_origin(request_->url());
- url::Origin site_for_cookies(request_->first_party_for_cookies());
+ url::Origin site_for_cookies(request_->site_for_cookies());
if (net::registry_controlled_domains::SameDomainOrHost(
requested_origin, site_for_cookies,
diff --git a/headless/public/util/generic_url_request_job.cc b/headless/public/util/generic_url_request_job.cc
index 316df42..216da5b 100644
--- a/headless/public/util/generic_url_request_job.cc
+++ b/headless/public/util/generic_url_request_job.cc
@@ -79,7 +79,7 @@
void GenericURLRequestJob::Start() {
PrepareCookies(request_->url(), request_->method(),
- url::Origin(request_->first_party_for_cookies()));
+ url::Origin(request_->site_for_cookies()));
}
void GenericURLRequestJob::PrepareCookies(const GURL& rewritten_url,
diff --git a/ios/chrome/browser/net/ios_chrome_network_delegate.cc b/ios/chrome/browser/net/ios_chrome_network_delegate.cc
index da8bfda..42f111a1 100644
--- a/ios/chrome/browser/net/ios_chrome_network_delegate.cc
+++ b/ios/chrome/browser/net/ios_chrome_network_delegate.cc
@@ -129,8 +129,8 @@
if (!cookie_settings_)
return true;
- return cookie_settings_->IsCookieAccessAllowed(
- request.url(), request.first_party_for_cookies());
+ return cookie_settings_->IsCookieAccessAllowed(request.url(),
+ request.site_for_cookies());
}
bool IOSChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
@@ -140,8 +140,8 @@
if (!cookie_settings_)
return true;
- return cookie_settings_->IsCookieAccessAllowed(
- request.url(), request.first_party_for_cookies());
+ return cookie_settings_->IsCookieAccessAllowed(request.url(),
+ request.site_for_cookies());
}
bool IOSChromeNetworkDelegate::OnCanAccessFile(
@@ -153,12 +153,12 @@
bool IOSChromeNetworkDelegate::OnCanEnablePrivacyMode(
const GURL& url,
- const GURL& first_party_for_cookies) const {
+ const GURL& site_for_cookies) const {
// Null during tests, or when we're running in the system context.
if (!cookie_settings_.get())
return false;
- return !cookie_settings_->IsCookieAccessAllowed(url, first_party_for_cookies);
+ return !cookie_settings_->IsCookieAccessAllowed(url, site_for_cookies);
}
bool IOSChromeNetworkDelegate::
diff --git a/ios/chrome/browser/net/ios_chrome_network_delegate.h b/ios/chrome/browser/net/ios_chrome_network_delegate.h
index 5521baa..148f3754 100644
--- a/ios/chrome/browser/net/ios_chrome_network_delegate.h
+++ b/ios/chrome/browser/net/ios_chrome_network_delegate.h
@@ -66,9 +66,8 @@
bool OnCanAccessFile(const net::URLRequest& request,
const base::FilePath& original_path,
const base::FilePath& absolute_path) const override;
- bool OnCanEnablePrivacyMode(
- const GURL& url,
- const GURL& first_party_for_cookies) const override;
+ bool OnCanEnablePrivacyMode(const GURL& url,
+ const GURL& site_for_cookies) const override;
bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
const net::URLRequest& request,
const GURL& target_url,
diff --git a/ios/net/crn_http_protocol_handler.mm b/ios/net/crn_http_protocol_handler.mm
index c1829b1..03e86b2 100644
--- a/ios/net/crn_http_protocol_handler.mm
+++ b/ios/net/crn_http_protocol_handler.mm
@@ -671,8 +671,7 @@
context->CreateRequest(url, DEFAULT_PRIORITY, this).release();
net_request_->set_method(base::SysNSStringToUTF8([request_ HTTPMethod]));
- net_request_->set_first_party_for_cookies(
- GURLWithNSURL([request_ mainDocumentURL]));
+ net_request_->set_site_for_cookies(GURLWithNSURL([request_ mainDocumentURL]));
#if !defined(NDEBUG)
DVLOG(2) << "From client:";
diff --git a/ios/web/net/request_tracker_impl.mm b/ios/web/net/request_tracker_impl.mm
index 95596145..ec527317 100644
--- a/ios/web/net/request_tracker_impl.mm
+++ b/ios/web/net/request_tracker_impl.mm
@@ -125,8 +125,8 @@
public:
TrackerCounts(const GURL& tracked_url, const net::URLRequest* tracked_request)
: url(tracked_url),
- first_party_for_cookies_origin(
- tracked_request->first_party_for_cookies().GetOrigin()),
+ site_for_cookies_origin(
+ tracked_request->site_for_cookies().GetOrigin()),
request(tracked_request),
ssl_info(net::SSLInfo()),
ssl_judgment(web::CertPolicy::ALLOWED),
@@ -135,8 +135,9 @@
processed(0),
done(false) {
DCHECK_CURRENTLY_ON(web::WebThread::IO);
- is_subrequest = tracked_request->first_party_for_cookies().is_valid() &&
- tracked_request->url() != tracked_request->first_party_for_cookies();
+ is_subrequest =
+ tracked_request->site_for_cookies().is_valid() &&
+ tracked_request->url() != tracked_request->site_for_cookies();
};
// The resource url.
@@ -144,7 +145,7 @@
// The origin of the url of the top level document of the resource. This is
// used to ignore request coming from an old document when detecting mixed
// content.
- const GURL first_party_for_cookies_origin;
+ const GURL site_for_cookies_origin;
// The request associated with this struct. As a void* to prevent access from
// the wrong thread.
const void* request;
@@ -1022,7 +1023,7 @@
auto it = counts_.begin();
while (it != counts_.end() && it->get() != split_position) {
if (!(*it)->url.SchemeIsCryptographic() &&
- origin == (*it)->first_party_for_cookies_origin) {
+ origin == (*it)->site_for_cookies_origin) {
old_url_has_mixed_content = true;
break;
}
@@ -1084,7 +1085,7 @@
auto rit = counts_.rbegin();
while (rit != counts_.rend() && (*rit)->url != url) {
if (url_scheme_is_secure && !(*rit)->url.SchemeIsCryptographic() &&
- (*rit)->first_party_for_cookies_origin == url.GetOrigin()) {
+ (*rit)->site_for_cookies_origin == url.GetOrigin()) {
new_url_has_mixed_content = true;
}
++rit;
diff --git a/media/base/android/media_player_android.cc b/media/base/android/media_player_android.cc
index 24f1800..5464274 100644
--- a/media/base/android/media_player_android.cc
+++ b/media/base/android/media_player_android.cc
@@ -70,7 +70,7 @@
return GURL();
}
-GURL MediaPlayerAndroid::GetFirstPartyForCookies() {
+GURL MediaPlayerAndroid::GetSiteForCookies() {
return GURL();
}
diff --git a/media/base/android/media_player_android.h b/media/base/android/media_player_android.h
index a8cd802c..e96728b5 100644
--- a/media/base/android/media_player_android.h
+++ b/media/base/android/media_player_android.h
@@ -89,7 +89,7 @@
virtual bool CanSeekBackward() = 0;
virtual bool IsPlayerReady() = 0;
virtual GURL GetUrl();
- virtual GURL GetFirstPartyForCookies();
+ virtual GURL GetSiteForCookies();
// Associates the |cdm| with this player.
virtual void SetCdm(const scoped_refptr<ContentDecryptionModule>& cdm);
diff --git a/media/base/android/media_player_bridge.cc b/media/base/android/media_player_bridge.cc
index 1acdd05..d37985cb 100644
--- a/media/base/android/media_player_bridge.cc
+++ b/media/base/android/media_player_bridge.cc
@@ -39,7 +39,7 @@
MediaPlayerBridge::MediaPlayerBridge(
int player_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& user_agent,
bool hide_url_log,
MediaPlayerManager* manager,
@@ -54,7 +54,7 @@
pending_play_(false),
should_seek_on_prepare_(false),
url_(url),
- first_party_for_cookies_(first_party_for_cookies),
+ site_for_cookies_(site_for_cookies),
user_agent_(user_agent),
hide_url_log_(hide_url_log),
width_(0),
@@ -111,8 +111,7 @@
return;
}
- resource_getter->GetCookies(url_,
- first_party_for_cookies_,
+ resource_getter->GetCookies(url_, site_for_cookies_,
base::Bind(&MediaPlayerBridge::OnCookiesRetrieved,
weak_factory_.GetWeakPtr()));
}
@@ -604,8 +603,8 @@
return url_;
}
-GURL MediaPlayerBridge::GetFirstPartyForCookies() {
- return first_party_for_cookies_;
+GURL MediaPlayerBridge::GetSiteForCookies() {
+ return site_for_cookies_;
}
} // namespace media
diff --git a/media/base/android/media_player_bridge.h b/media/base/android/media_player_bridge.h
index 629b201..29855ca2 100644
--- a/media/base/android/media_player_bridge.h
+++ b/media/base/android/media_player_bridge.h
@@ -46,7 +46,7 @@
MediaPlayerBridge(
int player_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& user_agent,
bool hide_url_log,
MediaPlayerManager* manager,
@@ -76,7 +76,7 @@
bool CanSeekBackward() override;
bool IsPlayerReady() override;
GURL GetUrl() override;
- GURL GetFirstPartyForCookies() override;
+ GURL GetSiteForCookies() override;
void OnDidSetDataUriDataSource(
JNIEnv* env,
@@ -166,7 +166,7 @@
GURL url_;
// First party url for cookies.
- GURL first_party_for_cookies_;
+ GURL site_for_cookies_;
// User agent string to be used for media player.
const std::string user_agent_;
diff --git a/media/base/android/media_resource_getter.h b/media/base/android/media_resource_getter.h
index 65c3aa5..a4ebf883 100644
--- a/media/base/android/media_resource_getter.h
+++ b/media/base/android/media_resource_getter.h
@@ -43,7 +43,7 @@
// Method for getting the cookies for a given URL.
virtual void GetCookies(const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
GetCookieCB callback) = 0;
// Method for getting the platform path from a file system URL.
diff --git a/media/base/media_url_demuxer.cc b/media/base/media_url_demuxer.cc
index 653d481..c6a1b4a 100644
--- a/media/base/media_url_demuxer.cc
+++ b/media/base/media_url_demuxer.cc
@@ -12,8 +12,8 @@
MediaUrlDemuxer::MediaUrlDemuxer(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
const GURL& media_url,
- const GURL& first_party_for_cookies)
- : params_{media_url, first_party_for_cookies}, task_runner_(task_runner) {}
+ const GURL& site_for_cookies)
+ : params_{media_url, site_for_cookies}, task_runner_(task_runner) {}
MediaUrlDemuxer::~MediaUrlDemuxer() {}
diff --git a/media/base/media_url_demuxer.h b/media/base/media_url_demuxer.h
index 599cf82..15173cad 100644
--- a/media/base/media_url_demuxer.h
+++ b/media/base/media_url_demuxer.h
@@ -35,7 +35,7 @@
MediaUrlDemuxer(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
const GURL& media_url,
- const GURL& first_party_for_cookies);
+ const GURL& site_for_cookies);
~MediaUrlDemuxer() override;
// MediaResource interface.
diff --git a/media/base/media_url_demuxer_unittest.cc b/media/base/media_url_demuxer_unittest.cc
index 23fa6da..3ca820793 100644
--- a/media/base/media_url_demuxer_unittest.cc
+++ b/media/base/media_url_demuxer_unittest.cc
@@ -52,7 +52,7 @@
MediaUrlParams params = demuxer_->GetMediaUrlParams();
EXPECT_EQ(default_media_url_, params.media_url);
- EXPECT_EQ(default_first_party_url_, params.first_party_for_cookies);
+ EXPECT_EQ(default_first_party_url_, params.site_for_cookies);
}
TEST_F(MediaUrlDemuxerTest, AcceptsEmptyStrings) {
@@ -60,7 +60,7 @@
MediaUrlParams params = demuxer_->GetMediaUrlParams();
EXPECT_EQ(GURL::EmptyGURL(), params.media_url);
- EXPECT_EQ(GURL::EmptyGURL(), params.first_party_for_cookies);
+ EXPECT_EQ(GURL::EmptyGURL(), params.site_for_cookies);
}
TEST_F(MediaUrlDemuxerTest, InitializeReturnsPipelineOk) {
diff --git a/media/base/media_url_params.h b/media/base/media_url_params.h
index b019651..75429d8 100644
--- a/media/base/media_url_params.h
+++ b/media/base/media_url_params.h
@@ -22,7 +22,7 @@
// In the MediaPlayerRenderer case, it will ultimately be used in
// MediaResourceGetterTask::CheckPolicyForCookies, to limit the scope of the
// cookies that the MediaPlayerRenderer has access to.
- GURL first_party_for_cookies;
+ GURL site_for_cookies;
};
} // namespace media
diff --git a/media/blink/renderer_media_player_interface.h b/media/blink/renderer_media_player_interface.h
index 6202613..3b014bc 100644
--- a/media/blink/renderer_media_player_interface.h
+++ b/media/blink/renderer_media_player_interface.h
@@ -73,7 +73,7 @@
virtual void Initialize(MediaPlayerHostMsg_Initialize_Type type,
int player_id,
const GURL& url,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const GURL& frame_url,
bool allow_credentials,
int delegate_id) = 0;
diff --git a/media/blink/webmediaplayer_cast_android.cc b/media/blink/webmediaplayer_cast_android.cc
index c2d1c750..8fadd78 100644
--- a/media/blink/webmediaplayer_cast_android.cc
+++ b/media/blink/webmediaplayer_cast_android.cc
@@ -169,7 +169,7 @@
blink::WebLocalFrame* frame,
int delegate_id) {
player_manager_->Initialize(MEDIA_PLAYER_TYPE_REMOTE_ONLY, player_id_, url,
- frame->GetDocument().FirstPartyForCookies(),
+ frame->GetDocument().SiteForCookies(),
frame->GetDocument().Url(), true, delegate_id);
is_player_initialized_ = true;
}
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index cffb6ae..0c94165 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1991,9 +1991,8 @@
// TODO(tguilbert/avayvod): Update this flag when removing |cast_impl_|.
using_media_player_renderer_ = true;
- demuxer_.reset(
- new MediaUrlDemuxer(media_task_runner_, loaded_url_,
- frame_->GetDocument().FirstPartyForCookies()));
+ demuxer_.reset(new MediaUrlDemuxer(media_task_runner_, loaded_url_,
+ frame_->GetDocument().SiteForCookies()));
pipeline_controller_.Start(demuxer_.get(), this, false, false);
return;
}
diff --git a/media/mojo/clients/mojo_renderer.cc b/media/mojo/clients/mojo_renderer.cc
index 354f1e3bd..70ddb13 100644
--- a/media/mojo/clients/mojo_renderer.cc
+++ b/media/mojo/clients/mojo_renderer.cc
@@ -124,7 +124,7 @@
std::vector<mojom::DemuxerStreamPtr> streams;
remote_renderer_->Initialize(
std::move(client_ptr_info), std::move(streams), url_params.media_url,
- url_params.first_party_for_cookies,
+ url_params.site_for_cookies,
base::Bind(&MojoRenderer::OnInitialized, base::Unretained(this), client));
}
diff --git a/media/mojo/services/mojo_renderer_service.cc b/media/mojo/services/mojo_renderer_service.cc
index 3ec3a8f..8e4fa23 100644
--- a/media/mojo/services/mojo_renderer_service.cc
+++ b/media/mojo/services/mojo_renderer_service.cc
@@ -80,7 +80,7 @@
mojom::RendererClientAssociatedPtrInfo client,
base::Optional<std::vector<mojom::DemuxerStreamPtr>> streams,
const base::Optional<GURL>& media_url,
- const base::Optional<GURL>& first_party_for_cookies,
+ const base::Optional<GURL>& site_for_cookies,
InitializeCallback callback) {
DVLOG(1) << __func__;
DCHECK_EQ(state_, STATE_UNINITIALIZED);
@@ -97,9 +97,9 @@
}
DCHECK(!media_url.value().is_empty());
- DCHECK(first_party_for_cookies);
+ DCHECK(site_for_cookies);
media_resource_.reset(new MediaUrlDemuxer(nullptr, media_url.value(),
- first_party_for_cookies.value()));
+ site_for_cookies.value()));
renderer_->Initialize(
media_resource_.get(), this,
base::Bind(&MojoRendererService::OnRendererInitializeDone, weak_this_,
diff --git a/media/mojo/services/mojo_renderer_service.h b/media/mojo/services/mojo_renderer_service.h
index 569cfc7..de32abf 100644
--- a/media/mojo/services/mojo_renderer_service.h
+++ b/media/mojo/services/mojo_renderer_service.h
@@ -65,7 +65,7 @@
void Initialize(mojom::RendererClientAssociatedPtrInfo client,
base::Optional<std::vector<mojom::DemuxerStreamPtr>> streams,
const base::Optional<GURL>& media_url,
- const base::Optional<GURL>& first_party_for_cookies,
+ const base::Optional<GURL>& site_for_cookies,
InitializeCallback callback) final;
void Flush(FlushCallback callback) final;
void StartPlayingFrom(base::TimeDelta time_delta) final;
diff --git a/net/base/layered_network_delegate.cc b/net/base/layered_network_delegate.cc
index 4718c4b..82eabd24 100644
--- a/net/base/layered_network_delegate.cc
+++ b/net/base/layered_network_delegate.cc
@@ -219,16 +219,14 @@
bool LayeredNetworkDelegate::OnCanEnablePrivacyMode(
const GURL& url,
- const GURL& first_party_for_cookies) const {
- OnCanEnablePrivacyModeInternal(url, first_party_for_cookies);
- return nested_network_delegate_->CanEnablePrivacyMode(
- url, first_party_for_cookies);
+ const GURL& site_for_cookies) const {
+ OnCanEnablePrivacyModeInternal(url, site_for_cookies);
+ return nested_network_delegate_->CanEnablePrivacyMode(url, site_for_cookies);
}
void LayeredNetworkDelegate::OnCanEnablePrivacyModeInternal(
const GURL& url,
- const GURL& first_party_for_cookies) const {
-}
+ const GURL& site_for_cookies) const {}
bool LayeredNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
OnAreExperimentalCookieFeaturesEnabledInternal();
diff --git a/net/base/layered_network_delegate.h b/net/base/layered_network_delegate.h
index 033ae357..d3d0e03 100644
--- a/net/base/layered_network_delegate.h
+++ b/net/base/layered_network_delegate.h
@@ -81,7 +81,7 @@
const base::FilePath& original_path,
const base::FilePath& absolute_path) const final;
bool OnCanEnablePrivacyMode(const GURL& url,
- const GURL& first_party_for_cookies) const final;
+ const GURL& site_for_cookies) const final;
bool OnAreExperimentalCookieFeaturesEnabled() const final;
bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
const URLRequest& request,
@@ -161,7 +161,7 @@
virtual void OnCanEnablePrivacyModeInternal(
const GURL& url,
- const GURL& first_party_for_cookies) const;
+ const GURL& site_for_cookies) const;
virtual void OnAreExperimentalCookieFeaturesEnabledInternal() const;
diff --git a/net/base/layered_network_delegate_unittest.cc b/net/base/layered_network_delegate_unittest.cc
index 3ba85add..0ec25af 100644
--- a/net/base/layered_network_delegate_unittest.cc
+++ b/net/base/layered_network_delegate_unittest.cc
@@ -134,9 +134,8 @@
return false;
}
- bool OnCanEnablePrivacyMode(
- const GURL& url,
- const GURL& first_party_for_cookies) const override {
+ bool OnCanEnablePrivacyMode(const GURL& url,
+ const GURL& site_for_cookies) const override {
IncrementAndCompareCounter("on_can_enable_privacy_mode_count");
return false;
}
@@ -321,7 +320,7 @@
void OnCanEnablePrivacyModeInternal(
const GURL& url,
- const GURL& first_party_for_cookies) const override {
+ const GURL& site_for_cookies) const override {
++(*counters_)["on_can_enable_privacy_mode_count"];
EXPECT_EQ(1, (*counters_)["on_can_enable_privacy_mode_count"]);
}
diff --git a/net/base/network_delegate.cc b/net/base/network_delegate.cc
index 6839481..2b47025 100644
--- a/net/base/network_delegate.cc
+++ b/net/base/network_delegate.cc
@@ -173,12 +173,11 @@
return OnCanAccessFile(request, original_path, absolute_path);
}
-bool NetworkDelegate::CanEnablePrivacyMode(
- const GURL& url,
- const GURL& first_party_for_cookies) const {
+bool NetworkDelegate::CanEnablePrivacyMode(const GURL& url,
+ const GURL& site_for_cookies) const {
TRACE_EVENT0(kNetTracingCategory, "NetworkDelegate::CanEnablePrivacyMode");
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
- return OnCanEnablePrivacyMode(url, first_party_for_cookies);
+ return OnCanEnablePrivacyMode(url, site_for_cookies);
}
bool NetworkDelegate::AreExperimentalCookieFeaturesEnabled() const {
diff --git a/net/base/network_delegate.h b/net/base/network_delegate.h
index 79a94d6..22d22d03 100644
--- a/net/base/network_delegate.h
+++ b/net/base/network_delegate.h
@@ -108,7 +108,7 @@
const base::FilePath& original_path,
const base::FilePath& absolute_path) const;
bool CanEnablePrivacyMode(const GURL& url,
- const GURL& first_party_for_cookies) const;
+ const GURL& site_for_cookies) const;
bool AreExperimentalCookieFeaturesEnabled() const;
@@ -293,9 +293,8 @@
// Returns true if the given |url| has to be requested over connection that
// is not tracked by the server. Usually is false, unless user privacy
// settings block cookies from being get or set.
- virtual bool OnCanEnablePrivacyMode(
- const GURL& url,
- const GURL& first_party_for_cookies) const = 0;
+ virtual bool OnCanEnablePrivacyMode(const GURL& url,
+ const GURL& site_for_cookies) const = 0;
// Returns true if the embedder has enabled the experimental features, and
// false otherwise.
diff --git a/net/base/network_delegate_impl.cc b/net/base/network_delegate_impl.cc
index 323c8bd6..3a4c1ed 100644
--- a/net/base/network_delegate_impl.cc
+++ b/net/base/network_delegate_impl.cc
@@ -101,7 +101,7 @@
bool NetworkDelegateImpl::OnCanEnablePrivacyMode(
const GURL& url,
- const GURL& first_party_for_cookies) const {
+ const GURL& site_for_cookies) const {
return false;
}
diff --git a/net/base/network_delegate_impl.h b/net/base/network_delegate_impl.h
index 0ccaf82d..2306411f 100644
--- a/net/base/network_delegate_impl.h
+++ b/net/base/network_delegate_impl.h
@@ -93,9 +93,8 @@
const base::FilePath& original_path,
const base::FilePath& absolute_path) const override;
- bool OnCanEnablePrivacyMode(
- const GURL& url,
- const GURL& first_party_for_cookies) const override;
+ bool OnCanEnablePrivacyMode(const GURL& url,
+ const GURL& site_for_cookies) const override;
bool OnAreExperimentalCookieFeaturesEnabled() const override;
diff --git a/net/base/static_cookie_policy.cc b/net/base/static_cookie_policy.cc
index 7d327c9c..28b12630 100644
--- a/net/base/static_cookie_policy.cc
+++ b/net/base/static_cookie_policy.cc
@@ -11,20 +11,19 @@
namespace net {
-int StaticCookiePolicy::CanAccessCookies(
- const GURL& url,
- const GURL& first_party_for_cookies) const {
+int StaticCookiePolicy::CanAccessCookies(const GURL& url,
+ const GURL& site_for_cookies) const {
switch (type_) {
case StaticCookiePolicy::ALLOW_ALL_COOKIES:
return OK;
case StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES:
- if (first_party_for_cookies.is_empty())
+ if (site_for_cookies.is_empty())
return OK; // Empty first-party URL indicates a first-party request.
return registry_controlled_domains::SameDomainOrHost(
- url,
- first_party_for_cookies,
- registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES) ?
- OK : ERR_ACCESS_DENIED;
+ url, site_for_cookies,
+ registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)
+ ? OK
+ : ERR_ACCESS_DENIED;
case StaticCookiePolicy::BLOCK_ALL_COOKIES:
return ERR_ACCESS_DENIED;
default:
diff --git a/net/base/static_cookie_policy.h b/net/base/static_cookie_policy.h
index 8e33d73..c2314e90 100644
--- a/net/base/static_cookie_policy.h
+++ b/net/base/static_cookie_policy.h
@@ -42,8 +42,7 @@
// Consults the user's third-party cookie blocking preferences to determine
// whether the URL's cookies can be accessed (i.e., can be get or set).
- int CanAccessCookies(const GURL& url,
- const GURL& first_party_for_cookies) const;
+ int CanAccessCookies(const GURL& url, const GURL& site_for_cookies) const;
private:
Type type_;
diff --git a/net/url_request/redirect_info.h b/net/url_request/redirect_info.h
index 727357b5..5342220 100644
--- a/net/url_request/redirect_info.h
+++ b/net/url_request/redirect_info.h
@@ -34,7 +34,7 @@
GURL new_url;
// The new first-party URL for cookies.
- GURL new_first_party_for_cookies;
+ GURL new_site_for_cookies;
// The new HTTP referrer header.
std::string new_referrer;
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index 08b1b91..c6db196 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -566,10 +566,10 @@
request_->SetLoadFlags(flags);
request_->SetReferrer(referrer_);
request_->set_referrer_policy(referrer_policy_);
- request_->set_first_party_for_cookies(initiator_.has_value() &&
- !initiator_.value().unique()
- ? initiator_.value().GetURL()
- : original_url_);
+ request_->set_site_for_cookies(initiator_.has_value() &&
+ !initiator_.value().unique()
+ ? initiator_.value().GetURL()
+ : original_url_);
request_->set_initiator(initiator_);
if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) {
request_->SetUserData(url_request_data_key_,
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 6b5d0f108..c44233a01 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -458,10 +458,9 @@
return IsHandledProtocol(url.scheme());
}
-void URLRequest::set_first_party_for_cookies(
- const GURL& first_party_for_cookies) {
+void URLRequest::set_site_for_cookies(const GURL& site_for_cookies) {
DCHECK(!is_pending_);
- first_party_for_cookies_ = first_party_for_cookies;
+ site_for_cookies_ = site_for_cookies;
}
void URLRequest::set_first_party_url_policy(
@@ -975,7 +974,7 @@
referrer_ = redirect_info.new_referrer;
referrer_policy_ = redirect_info.new_referrer_policy;
- first_party_for_cookies_ = redirect_info.new_first_party_for_cookies;
+ site_for_cookies_ = redirect_info.new_site_for_cookies;
token_binding_referrer_ = redirect_info.referred_token_binding_host;
url_chain_.push_back(redirect_info.new_url);
@@ -1106,8 +1105,7 @@
bool URLRequest::CanEnablePrivacyMode() const {
if (network_delegate_) {
- return network_delegate_->CanEnablePrivacyMode(url(),
- first_party_for_cookies_);
+ return network_delegate_->CanEnablePrivacyMode(url(), site_for_cookies_);
}
return !g_default_can_use_cookies;
}
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index e529c370..e20a948 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -259,7 +259,7 @@
// The URL that should be consulted for the third-party cookie blocking
// policy, as defined in Section 2.1.1 and 2.1.2 of
- // https://tools.ietf.org/html/draft-west-first-party-cookies.
+ // https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site.
//
// WARNING: This URL must only be used for the third-party cookie blocking
// policy. It MUST NEVER be used for any kind of SECURITY check.
@@ -275,11 +275,9 @@
// this value as a proxy for the "top-level frame URL", which is simply
// incorrect and fragile. We don't need the full URL for any //net checks,
// so we should drop the pieces we don't need. https://crbug.com/577565
- const GURL& first_party_for_cookies() const {
- return first_party_for_cookies_;
- }
+ const GURL& site_for_cookies() const { return site_for_cookies_; }
// This method may only be called before Start().
- void set_first_party_for_cookies(const GURL& first_party_for_cookies);
+ void set_site_for_cookies(const GURL& site_for_cookies);
// The first-party URL policy to apply when updating the first party URL
// during redirects. The first-party URL policy may only be changed before
@@ -304,7 +302,7 @@
// initiator remains `https://example.com/`.
//
// This value is used to perform the cross-origin check specified in Section
- // 4.3 of https://tools.ietf.org/html/draft-west-first-party-cookies.
+ // 4.3 of https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site.
//
// Note: the initiator can be null for browser-initiated top level
// navigations. This is different from a unique Origin (e.g. in sandboxed
@@ -772,7 +770,7 @@
std::unique_ptr<UploadDataStream> upload_data_stream_;
std::vector<GURL> url_chain_;
- GURL first_party_for_cookies_;
+ GURL site_for_cookies_;
base::Optional<url::Origin> initiator_;
GURL delegate_redirect_url_;
std::string method_; // "GET", "POST", etc. Should be all uppercase.
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 27844b29..ee49c34 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -181,7 +181,7 @@
base::TimeDelta delta = base::Time::Now() - oldest;
if (net::registry_controlled_domains::SameDomainOrHost(
- request.url(), request.first_party_for_cookies(),
+ request.url(), request.site_for_cookies(),
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
UMA_HISTOGRAM_COUNTS_1000("Cookie.AgeForNonSecureSameSiteRequest",
delta.InDays());
@@ -704,16 +704,16 @@
options.set_include_httponly();
// Set SameSiteCookieMode according to the rules laid out in
- // https://tools.ietf.org/html/draft-west-first-party-cookies:
+ // https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site:
//
// * Include both "strict" and "lax" same-site cookies if the request's
- // |url|, |initiator|, and |first_party_for_cookies| all have the same
+ // |url|, |initiator|, and |site_for_cookies| all have the same
// registrable domain. Note: this also covers the case of a request
// without an initiator (only happens for browser-initiated main frame
// navigations).
//
// * Include only "lax" same-site cookies if the request's |URL| and
- // |first_party_for_cookies| have the same registrable domain, _and_ the
+ // |site_for_cookies| have the same registrable domain, _and_ the
// request's |method| is "safe" ("GET" or "HEAD").
//
// Note that this will generally be the case only for cross-site requests
@@ -721,7 +721,7 @@
//
// * Otherwise, do not include same-site cookies.
if (registry_controlled_domains::SameDomainOrHost(
- request_->url(), request_->first_party_for_cookies(),
+ request_->url(), request_->site_for_cookies(),
registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
if (!request_->initiator() ||
registry_controlled_domains::SameDomainOrHost(
diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc
index 7a776d3..5c8ec92b 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -855,10 +855,9 @@
// Update the first-party URL if appropriate.
if (request_->first_party_url_policy() ==
URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT) {
- redirect_info.new_first_party_for_cookies = redirect_info.new_url;
+ redirect_info.new_site_for_cookies = redirect_info.new_url;
} else {
- redirect_info.new_first_party_for_cookies =
- request_->first_party_for_cookies();
+ redirect_info.new_site_for_cookies = request_->site_for_cookies();
}
redirect_info.new_referrer_policy =
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index accef39..8b2314b 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -2976,7 +2976,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
+ req->set_site_for_cookies(test_server.GetURL(kHost, "/"));
req->set_initiator(url::Origin(test_server.GetURL(kHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -2995,7 +2995,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
+ req->set_site_for_cookies(test_server.GetURL(kHost, "/"));
req->Start();
base::RunLoop().Run();
@@ -3012,7 +3012,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(test_server.GetURL(kSubHost, "/"));
+ req->set_site_for_cookies(test_server.GetURL(kSubHost, "/"));
req->set_initiator(url::Origin(test_server.GetURL(kSubHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -3030,7 +3030,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(test_server.GetURL(kCrossHost, "/"));
+ req->set_site_for_cookies(test_server.GetURL(kCrossHost, "/"));
req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -3049,7 +3049,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
+ req->set_site_for_cookies(test_server.GetURL(kHost, "/"));
req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
req->set_method("GET");
req->Start();
@@ -3069,7 +3069,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
+ req->set_site_for_cookies(test_server.GetURL(kHost, "/"));
req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
req->set_method("POST");
req->Start();
@@ -3333,7 +3333,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
http_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(http_server.GetURL(kHost, "/"));
+ req->set_site_for_cookies(http_server.GetURL(kHost, "/"));
req->set_initiator(url::Origin(http_server.GetURL(kHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -3347,7 +3347,7 @@
std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
http_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
TRAFFIC_ANNOTATION_FOR_TESTS));
- req->set_first_party_for_cookies(http_server.GetURL(kCrossHost, "/"));
+ req->set_site_for_cookies(http_server.GetURL(kCrossHost, "/"));
req->set_initiator(url::Origin(http_server.GetURL(kCrossHost, "/")));
req->Start();
base::RunLoop().Run();
@@ -8220,14 +8220,14 @@
{
std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
- r->set_first_party_for_cookies(first_party_url);
+ r->set_site_for_cookies(first_party_url);
r->Start();
base::RunLoop().Run();
EXPECT_EQ(2U, r->url_chain().size());
EXPECT_EQ(OK, d.request_status());
- EXPECT_EQ(first_party_url, r->first_party_for_cookies());
+ EXPECT_EQ(first_party_url, r->site_for_cookies());
}
}
@@ -8242,7 +8242,7 @@
{
std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
- r->set_first_party_for_cookies(original_first_party_url);
+ r->set_site_for_cookies(original_first_party_url);
r->set_first_party_url_policy(
URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
@@ -8251,7 +8251,7 @@
EXPECT_EQ(2U, r->url_chain().size());
EXPECT_EQ(OK, d.request_status());
- EXPECT_EQ(expected_first_party_url, r->first_party_for_cookies());
+ EXPECT_EQ(expected_first_party_url, r->site_for_cookies());
}
}
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 8310aece..5c4bf68 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -352,10 +352,10 @@
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers) {
SendAddChannelRequestWithSuppliedCallback(
- socket_url, requested_subprotocols, origin, first_party_for_cookies,
+ socket_url, requested_subprotocols, origin, site_for_cookies,
additional_headers, base::Bind(&WebSocketStream::CreateAndConnectStream));
}
@@ -561,11 +561,11 @@
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
const WebSocketStreamRequestCreationCallback& callback) {
SendAddChannelRequestWithSuppliedCallback(socket_url, requested_subprotocols,
- origin, first_party_for_cookies,
+ origin, site_for_cookies,
additional_headers, callback);
}
@@ -583,7 +583,7 @@
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
const WebSocketStreamRequestCreationCallback& callback) {
DCHECK_EQ(FRESHLY_CONSTRUCTED, state_);
@@ -600,10 +600,10 @@
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper(
new WebSocketHandshakeStreamCreateHelper(connect_delegate.get(),
requested_subprotocols));
- stream_request_ = callback.Run(socket_url_, std::move(create_helper), origin,
- first_party_for_cookies, additional_headers,
- url_request_context_, NetLogWithSource(),
- std::move(connect_delegate));
+ stream_request_ =
+ callback.Run(socket_url_, std::move(create_helper), origin,
+ site_for_cookies, additional_headers, url_request_context_,
+ NetLogWithSource(), std::move(connect_delegate));
SetState(CONNECTING);
}
diff --git a/net/websockets/websocket_channel.h b/net/websockets/websocket_channel.h
index 2f68b14..e763d15bf 100644
--- a/net/websockets/websocket_channel.h
+++ b/net/websockets/websocket_channel.h
@@ -76,7 +76,7 @@
const GURL& socket_url,
const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers);
// Sends a data frame to the remote side. It is the responsibility of the
@@ -128,7 +128,7 @@
const GURL& socket_url,
const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
const WebSocketStreamRequestCreationCallback& callback);
@@ -223,7 +223,7 @@
const GURL& socket_url,
const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
const WebSocketStreamRequestCreationCallback& callback);
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc
index 47e73dd..6c64eaf 100644
--- a/net/websockets/websocket_channel_test.cc
+++ b/net/websockets/websocket_channel_test.cc
@@ -721,7 +721,7 @@
const GURL& socket_url,
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
URLRequestContext* url_request_context,
const NetLogWithSource& net_log,
@@ -729,7 +729,7 @@
this->socket_url = socket_url;
this->create_helper = std::move(create_helper);
this->origin = origin;
- this->first_party_for_cookies = first_party_for_cookies;
+ this->site_for_cookies = site_for_cookies;
this->url_request_context = url_request_context;
this->net_log = net_log;
this->connect_delegate = std::move(connect_delegate);
@@ -739,7 +739,7 @@
GURL socket_url;
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper;
url::Origin origin;
- GURL first_party_for_cookies;
+ GURL site_for_cookies;
URLRequestContext* url_request_context;
NetLogWithSource net_log;
std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate;
@@ -777,7 +777,7 @@
&connect_data_.url_request_context));
channel_->SendAddChannelRequestForTesting(
connect_data_.socket_url, connect_data_.requested_subprotocols,
- connect_data_.origin, connect_data_.first_party_for_cookies, "",
+ connect_data_.origin, connect_data_.site_for_cookies, "",
base::Bind(&WebSocketStreamCreationCallbackArgumentSaver::Create,
base::Unretained(&connect_data_.argument_saver)));
}
@@ -814,7 +814,7 @@
ConnectData()
: socket_url("ws://ws/"),
origin(GURL("http://ws")),
- first_party_for_cookies("http://ws/") {}
+ site_for_cookies("http://ws/") {}
// URLRequestContext object.
URLRequestContext url_request_context;
@@ -826,7 +826,7 @@
// Origin of the request
url::Origin origin;
// First party for cookies for the request.
- GURL first_party_for_cookies;
+ GURL site_for_cookies;
WebSocketStreamCreationCallbackArgumentSaver argument_saver;
};
@@ -1042,7 +1042,7 @@
TEST_F(WebSocketChannelTest, EverythingIsPassedToTheCreatorFunction) {
connect_data_.socket_url = GURL("ws://example.com/test");
connect_data_.origin = url::Origin(GURL("http://example.com"));
- connect_data_.first_party_for_cookies = GURL("http://example.com/");
+ connect_data_.site_for_cookies = GURL("http://example.com/");
connect_data_.requested_subprotocols.push_back("Sinbad");
CreateChannelAndConnect();
@@ -1054,8 +1054,7 @@
EXPECT_EQ(connect_data_.socket_url, actual.socket_url);
EXPECT_EQ(connect_data_.origin.Serialize(), actual.origin.Serialize());
- EXPECT_EQ(connect_data_.first_party_for_cookies,
- actual.first_party_for_cookies);
+ EXPECT_EQ(connect_data_.site_for_cookies, actual.site_for_cookies);
}
// Verify that calling SendFlowControl before the connection is established does
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index ababfe40..2f34aef 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -277,12 +277,12 @@
InitialiseContext();
}
url::Origin origin(GURL("http://localhost"));
- GURL first_party_for_cookies("http://localhost/");
+ GURL site_for_cookies("http://localhost/");
event_interface_ = new ConnectTestingEventInterface;
channel_.reset(
new WebSocketChannel(base::WrapUnique(event_interface_), &context_));
channel_->SendAddChannelRequest(GURL(socket_url), sub_protocols_, origin,
- first_party_for_cookies, "");
+ site_for_cookies, "");
event_interface_->WaitForResponse();
return !event_interface_->failed();
}
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc
index 7c60e04..9812bfaf7 100644
--- a/net/websockets/websocket_stream.cc
+++ b/net/websockets/websocket_stream.cc
@@ -115,7 +115,7 @@
const GURL& url,
const URLRequestContext* context,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate,
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper)
@@ -138,7 +138,7 @@
url_request_->SetExtraRequestHeaders(headers);
url_request_->set_initiator(origin);
- url_request_->set_first_party_for_cookies(first_party_for_cookies);
+ url_request_->set_site_for_cookies(site_for_cookies);
url_request_->SetUserData(
WebSocketHandshakeStreamBase::CreateHelper::DataKey(),
@@ -399,16 +399,16 @@
const GURL& socket_url,
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
URLRequestContext* url_request_context,
const NetLogWithSource& net_log,
std::unique_ptr<ConnectDelegate> connect_delegate) {
std::unique_ptr<WebSocketStreamRequestImpl> request(
- new WebSocketStreamRequestImpl(
- socket_url, url_request_context, origin, first_party_for_cookies,
- additional_headers, std::move(connect_delegate),
- std::move(create_helper)));
+ new WebSocketStreamRequestImpl(socket_url, url_request_context, origin,
+ site_for_cookies, additional_headers,
+ std::move(connect_delegate),
+ std::move(create_helper)));
request->Start(std::unique_ptr<base::Timer>(new base::Timer(false, false)));
return std::move(request);
}
@@ -418,17 +418,17 @@
const GURL& socket_url,
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
URLRequestContext* url_request_context,
const NetLogWithSource& net_log,
std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate,
std::unique_ptr<base::Timer> timer) {
std::unique_ptr<WebSocketStreamRequestImpl> request(
- new WebSocketStreamRequestImpl(
- socket_url, url_request_context, origin, first_party_for_cookies,
- additional_headers, std::move(connect_delegate),
- std::move(create_helper)));
+ new WebSocketStreamRequestImpl(socket_url, url_request_context, origin,
+ site_for_cookies, additional_headers,
+ std::move(connect_delegate),
+ std::move(create_helper)));
request->Start(std::move(timer));
return std::move(request);
}
diff --git a/net/websockets/websocket_stream.h b/net/websockets/websocket_stream.h
index e960f3d..aa8c3d4 100644
--- a/net/websockets/websocket_stream.h
+++ b/net/websockets/websocket_stream.h
@@ -117,7 +117,7 @@
const GURL& socket_url,
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
URLRequestContext* url_request_context,
const NetLogWithSource& net_log,
@@ -130,7 +130,7 @@
const GURL& socket_url,
std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
URLRequestContext* url_request_context,
const NetLogWithSource& net_log,
diff --git a/net/websockets/websocket_stream_cookie_test.cc b/net/websockets/websocket_stream_cookie_test.cc
index fbbee22..b013119 100644
--- a/net/websockets/websocket_stream_cookie_test.cc
+++ b/net/websockets/websocket_stream_cookie_test.cc
@@ -32,7 +32,7 @@
public:
void CreateAndConnect(const GURL& url,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& cookie_header,
const std::string& response_body) {
// We assume cookie_header ends with CRLF if not empty, as
@@ -46,8 +46,8 @@
cookie_header, std::string(),
std::string()),
response_body);
- CreateAndConnectStream(url, NoSubProtocols(), origin,
- first_party_for_cookies, "", nullptr);
+ CreateAndConnectStream(url, NoSubProtocols(), origin, site_for_cookies, "",
+ nullptr);
}
std::string AddCRLFIfNotEmpty(const std::string& s) {
@@ -130,7 +130,7 @@
const GURL url(GetParam().url);
const GURL cookie_url(GetParam().cookie_url);
const url::Origin origin(GURL("http://www.example.com"));
- const GURL first_party_for_cookies("http://www.example.com/");
+ const GURL site_for_cookies("http://www.example.com/");
const std::string cookie_line(GetParam().cookie_line);
const std::string cookie_header(AddCRLFIfNotEmpty(GetParam().cookie_header));
@@ -149,7 +149,7 @@
ASSERT_TRUE(is_called);
ASSERT_TRUE(set_cookie_result);
- CreateAndConnect(url, origin, first_party_for_cookies, cookie_header,
+ CreateAndConnect(url, origin, site_for_cookies, cookie_header,
WebSocketStandardResponse(""));
WaitUntilConnectDone();
EXPECT_FALSE(has_failed());
@@ -162,7 +162,7 @@
const GURL url(GetParam().url);
const GURL cookie_url(GetParam().cookie_url);
const url::Origin origin(GURL("http://www.example.com"));
- const GURL first_party_for_cookies("http://www.example.com/");
+ const GURL site_for_cookies("http://www.example.com/");
const std::string cookie_line(GetParam().cookie_line);
const std::string cookie_header(AddCRLFIfNotEmpty(GetParam().cookie_header));
@@ -178,7 +178,7 @@
CookieStore* store =
url_request_context_host_.GetURLRequestContext()->cookie_store();
- CreateAndConnect(url, origin, first_party_for_cookies, "", response);
+ CreateAndConnect(url, origin, site_for_cookies, "", response);
WaitUntilConnectDone();
EXPECT_FALSE(has_failed());
diff --git a/net/websockets/websocket_stream_create_test_base.cc b/net/websockets/websocket_stream_create_test_base.cc
index d3b1668..099d4ef 100644
--- a/net/websockets/websocket_stream_create_test_base.cc
+++ b/net/websockets/websocket_stream_create_test_base.cc
@@ -105,7 +105,7 @@
const GURL& socket_url,
const std::vector<std::string>& sub_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
std::unique_ptr<base::Timer> timer) {
for (size_t i = 0; i < ssl_data_.size(); ++i) {
@@ -119,7 +119,7 @@
new DeterministicKeyWebSocketHandshakeStreamCreateHelper(delegate,
sub_protocols));
stream_request_ = WebSocketStream::CreateAndConnectStreamForTesting(
- socket_url, std::move(create_helper), origin, first_party_for_cookies,
+ socket_url, std::move(create_helper), origin, site_for_cookies,
additional_headers, url_request_context_host_.GetURLRequestContext(),
NetLogWithSource(), std::move(connect_delegate),
timer ? std::move(timer)
diff --git a/net/websockets/websocket_stream_create_test_base.h b/net/websockets/websocket_stream_create_test_base.h
index 5805b50..aab93c7 100644
--- a/net/websockets/websocket_stream_create_test_base.h
+++ b/net/websockets/websocket_stream_create_test_base.h
@@ -42,7 +42,7 @@
void CreateAndConnectStream(const GURL& socket_url,
const std::vector<std::string>& sub_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& additional_headers,
std::unique_ptr<base::Timer> timer);
diff --git a/net/websockets/websocket_stream_test.cc b/net/websockets/websocket_stream_test.cc
index 5945e24..14a64d2 100644
--- a/net/websockets/websocket_stream_test.cc
+++ b/net/websockets/websocket_stream_test.cc
@@ -104,7 +104,7 @@
const std::string& socket_path,
const std::vector<std::string>& sub_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& send_additional_request_headers,
const std::string& extra_request_headers,
const std::string& response_body,
@@ -115,8 +115,8 @@
extra_request_headers),
response_body);
CreateAndConnectStream(GURL(socket_url), sub_protocols, origin,
- first_party_for_cookies,
- send_additional_request_headers, std::move(timer));
+ site_for_cookies, send_additional_request_headers,
+ std::move(timer));
}
// |extra_request_headers| and |extra_response_headers| must end in "\r\n" or
@@ -127,14 +127,14 @@
const std::string& socket_path,
const std::vector<std::string>& sub_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& send_additional_request_headers,
const std::string& extra_request_headers,
const std::string& extra_response_headers,
std::unique_ptr<base::Timer> timer = std::unique_ptr<base::Timer>()) {
CreateAndConnectCustomResponse(
socket_url, socket_host, socket_path, sub_protocols, origin,
- first_party_for_cookies, send_additional_request_headers,
+ site_for_cookies, send_additional_request_headers,
extra_request_headers,
WebSocketStandardResponse(extra_response_headers), std::move(timer));
}
@@ -143,14 +143,14 @@
const std::string& socket_url,
const std::vector<std::string>& sub_protocols,
const url::Origin& origin,
- const GURL& first_party_for_cookies,
+ const GURL& site_for_cookies,
const std::string& send_additional_request_headers,
std::unique_ptr<SequencedSocketData> socket_data,
std::unique_ptr<base::Timer> timer = std::unique_ptr<base::Timer>()) {
AddRawExpectations(std::move(socket_data));
CreateAndConnectStream(GURL(socket_url), sub_protocols, origin,
- first_party_for_cookies,
- send_additional_request_headers, std::move(timer));
+ site_for_cookies, send_additional_request_headers,
+ std::move(timer));
}
// Add additional raw expectations for sockets created before the final one.
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index c19b38f..3d1d8c1 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5041,13 +5041,13 @@
date.Minute(), date.Second());
}
-const KURL Document::FirstPartyForCookies() const {
+const KURL Document::SiteForCookies() const {
// TODO(mkwst): This doesn't properly handle HTML Import documents.
// If this is an imported document, grab its master document's first-party:
if (ImportsController() && ImportsController()->Master() &&
ImportsController()->Master() != this)
- return ImportsController()->Master()->FirstPartyForCookies();
+ return ImportsController()->Master()->SiteForCookies();
if (!GetFrame())
return SecurityOrigin::UrlWithUniqueSecurityOrigin();
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h
index 4e6a02a..4617465 100644
--- a/third_party/WebKit/Source/core/dom/Document.h
+++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -885,7 +885,7 @@
const KURL& CookieURL() const { return cookie_url_; }
void SetCookieURL(const KURL& url) { cookie_url_ = url; }
- const KURL FirstPartyForCookies() const;
+ const KURL SiteForCookies() const;
// The following implements the rule from HTML 4 for what valid names are.
// To get this right for all the XML cases, we probably have to improve this
diff --git a/third_party/WebKit/Source/core/exported/WebDocument.cpp b/third_party/WebKit/Source/core/exported/WebDocument.cpp
index 5215afd3..c791932 100644
--- a/third_party/WebKit/Source/core/exported/WebDocument.cpp
+++ b/third_party/WebKit/Source/core/exported/WebDocument.cpp
@@ -122,8 +122,8 @@
return ConstUnwrap<Document>()->BaseURL();
}
-WebURL WebDocument::FirstPartyForCookies() const {
- return ConstUnwrap<Document>()->FirstPartyForCookies();
+WebURL WebDocument::SiteForCookies() const {
+ return ConstUnwrap<Document>()->SiteForCookies();
}
WebElement WebDocument::DocumentElement() const {
diff --git a/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp b/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp
index e3613f0b..2872936 100644
--- a/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp
+++ b/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp
@@ -272,103 +272,98 @@
TEST_F(WebDocumentFirstPartyTest, Empty) {
Load(g_empty_file);
- ASSERT_EQ(ToOriginA(g_empty_file), TopDocument()->FirstPartyForCookies());
+ ASSERT_EQ(ToOriginA(g_empty_file), TopDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginA) {
Load(g_nested_origin_a);
- ASSERT_EQ(ToOriginA(g_nested_origin_a),
- TopDocument()->FirstPartyForCookies());
- ASSERT_EQ(ToOriginA(g_nested_origin_a),
- NestedDocument()->FirstPartyForCookies());
+ ASSERT_EQ(ToOriginA(g_nested_origin_a), TopDocument()->SiteForCookies());
+ ASSERT_EQ(ToOriginA(g_nested_origin_a), NestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginSubA) {
Load(g_nested_origin_sub_a);
+ ASSERT_EQ(ToOriginA(g_nested_origin_sub_a), TopDocument()->SiteForCookies());
ASSERT_EQ(ToOriginA(g_nested_origin_sub_a),
- TopDocument()->FirstPartyForCookies());
- ASSERT_EQ(ToOriginA(g_nested_origin_sub_a),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginSecureA) {
Load(g_nested_origin_secure_a);
ASSERT_EQ(ToOriginA(g_nested_origin_secure_a),
- TopDocument()->FirstPartyForCookies());
+ TopDocument()->SiteForCookies());
ASSERT_EQ(ToOriginA(g_nested_origin_secure_a),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginAInOriginA) {
Load(g_nested_origin_a_in_origin_a);
ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_a),
- TopDocument()->FirstPartyForCookies());
+ TopDocument()->SiteForCookies());
ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_a),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_a),
- NestedNestedDocument()->FirstPartyForCookies());
+ NestedNestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginAInOriginB) {
Load(g_nested_origin_a_in_origin_b);
ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b),
- TopDocument()->FirstPartyForCookies());
+ TopDocument()->SiteForCookies());
ASSERT_EQ(SecurityOrigin::UrlWithUniqueSecurityOrigin(),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
ASSERT_EQ(SecurityOrigin::UrlWithUniqueSecurityOrigin(),
- NestedNestedDocument()->FirstPartyForCookies());
+ NestedNestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginB) {
Load(g_nested_origin_b);
- ASSERT_EQ(ToOriginA(g_nested_origin_b),
- TopDocument()->FirstPartyForCookies());
+ ASSERT_EQ(ToOriginA(g_nested_origin_b), TopDocument()->SiteForCookies());
ASSERT_EQ(SecurityOrigin::UrlWithUniqueSecurityOrigin(),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginBInOriginA) {
Load(g_nested_origin_b_in_origin_a);
ASSERT_EQ(ToOriginA(g_nested_origin_b_in_origin_a),
- TopDocument()->FirstPartyForCookies());
+ TopDocument()->SiteForCookies());
ASSERT_EQ(ToOriginA(g_nested_origin_b_in_origin_a),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
ASSERT_EQ(SecurityOrigin::UrlWithUniqueSecurityOrigin(),
- NestedNestedDocument()->FirstPartyForCookies());
+ NestedNestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedOriginBInOriginB) {
Load(g_nested_origin_b_in_origin_b);
ASSERT_EQ(ToOriginA(g_nested_origin_b_in_origin_b),
- TopDocument()->FirstPartyForCookies());
+ TopDocument()->SiteForCookies());
ASSERT_EQ(SecurityOrigin::UrlWithUniqueSecurityOrigin(),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
ASSERT_EQ(SecurityOrigin::UrlWithUniqueSecurityOrigin(),
- NestedNestedDocument()->FirstPartyForCookies());
+ NestedNestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedSrcdoc) {
Load(g_nested_src_doc);
- ASSERT_EQ(ToOriginA(g_nested_src_doc), TopDocument()->FirstPartyForCookies());
- ASSERT_EQ(ToOriginA(g_nested_src_doc),
- NestedDocument()->FirstPartyForCookies());
+ ASSERT_EQ(ToOriginA(g_nested_src_doc), TopDocument()->SiteForCookies());
+ ASSERT_EQ(ToOriginA(g_nested_src_doc), NestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest, NestedData) {
Load(g_nested_data);
- ASSERT_EQ(ToOriginA(g_nested_data), TopDocument()->FirstPartyForCookies());
+ ASSERT_EQ(ToOriginA(g_nested_data), TopDocument()->SiteForCookies());
ASSERT_EQ(SecurityOrigin::UrlWithUniqueSecurityOrigin(),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
}
TEST_F(WebDocumentFirstPartyTest,
@@ -378,11 +373,11 @@
SchemeRegistry::RegisterURLSchemeAsFirstPartyWhenTopLevel("http");
ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b),
- TopDocument()->FirstPartyForCookies());
+ TopDocument()->SiteForCookies());
ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b),
- NestedDocument()->FirstPartyForCookies());
+ NestedDocument()->SiteForCookies());
ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b),
- NestedNestedDocument()->FirstPartyForCookies());
+ NestedNestedDocument()->SiteForCookies());
}
} // namespace blink
diff --git a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
index c72b5e5..d7e13ab1 100644
--- a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
@@ -7258,7 +7258,7 @@
client.Reset();
}
-TEST_P(ParameterizedWebFrameTest, FirstPartyForCookiesForRedirect) {
+TEST_P(ParameterizedWebFrameTest, SiteForCookiesForRedirect) {
String file_path = testing::CoreTestDataPath("first_party.html");
WebURL test_url(ToKURL("http://internal.test/first_party_redirect.html"));
@@ -7281,7 +7281,7 @@
EXPECT_TRUE(web_view_helper.WebView()
->MainFrameImpl()
->GetDocument()
- .FirstPartyForCookies() == redirect_url);
+ .SiteForCookies() == redirect_url);
}
class TestNavigationPolicyWebFrameClient
@@ -9973,8 +9973,7 @@
FrameTestHelpers::LoadFrame(local_frame, base_url_ + "send_beacon.html");
}
-TEST_P(ParameterizedWebFrameTest,
- FirstPartyForCookiesFromChildWithRemoteMainFrame) {
+TEST_P(ParameterizedWebFrameTest, SiteForCookiesFromChildWithRemoteMainFrame) {
FrameTestHelpers::WebViewHelper helper;
helper.InitializeRemote(nullptr,
SecurityOrigin::Create(ToKURL(not_base_url_)));
@@ -9985,11 +9984,11 @@
RegisterMockedHttpURLLoad("foo.html");
FrameTestHelpers::LoadFrame(local_frame, base_url_ + "foo.html");
EXPECT_EQ(WebURL(SecurityOrigin::UrlWithUniqueSecurityOrigin()),
- local_frame->GetDocument().FirstPartyForCookies());
+ local_frame->GetDocument().SiteForCookies());
SchemeRegistry::RegisterURLSchemeAsFirstPartyWhenTopLevel("http");
EXPECT_EQ(WebURL(ToKURL(not_base_url_)),
- local_frame->GetDocument().FirstPartyForCookies());
+ local_frame->GetDocument().SiteForCookies());
SchemeRegistry::RemoveURLSchemeAsFirstPartyWhenTopLevel("http");
}
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.h b/third_party/WebKit/Source/core/loader/BaseFetchContext.h
index 254de8e3..b1a748ac 100644
--- a/third_party/WebKit/Source/core/loader/BaseFetchContext.h
+++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.h
@@ -46,7 +46,7 @@
DECLARE_VIRTUAL_TRACE();
- virtual KURL GetFirstPartyForCookies() const = 0;
+ virtual KURL GetSiteForCookies() const = 0;
virtual void CountUsage(WebFeature) const = 0;
virtual void CountDeprecation(WebFeature) const = 0;
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
index 728a560..d82e03798 100644
--- a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
@@ -44,7 +44,7 @@
~MockBaseFetchContext() override {}
// BaseFetchContext overrides:
- KURL GetFirstPartyForCookies() const override { return KURL(); }
+ KURL GetSiteForCookies() const override { return KURL(); }
bool AllowScriptFromSource(const KURL&) const { return false; }
SubresourceFilter* GetSubresourceFilter() const override { return nullptr; }
bool ShouldBlockRequestByInspector(const KURL&) const override {
diff --git a/third_party/WebKit/Source/core/loader/CookieJar.cpp b/third_party/WebKit/Source/core/loader/CookieJar.cpp
index 14e9b2b0..2dc1b40 100644
--- a/third_party/WebKit/Source/core/loader/CookieJar.cpp
+++ b/third_party/WebKit/Source/core/loader/CookieJar.cpp
@@ -52,7 +52,7 @@
return String();
SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.CookieJar.SyncCookiesTime");
- return cookie_jar->Cookies(url, document->FirstPartyForCookies());
+ return cookie_jar->Cookies(url, document->SiteForCookies());
}
void SetCookies(Document* document,
@@ -61,7 +61,7 @@
WebCookieJar* cookie_jar = ToCookieJar(document);
if (!cookie_jar)
return;
- cookie_jar->SetCookie(url, document->FirstPartyForCookies(), cookie_string);
+ cookie_jar->SetCookie(url, document->SiteForCookies(), cookie_string);
}
bool CookiesEnabled(const Document* document) {
@@ -69,7 +69,7 @@
if (!cookie_jar)
return false;
return cookie_jar->CookiesEnabled(document->CookieURL(),
- document->FirstPartyForCookies());
+ document->SiteForCookies());
}
} // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index deb4331..cb89b231 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -180,7 +180,7 @@
RefPtr<const SecurityOrigin> parent_security_origin,
const Optional<WebAddressSpace>& address_space,
const ContentSecurityPolicy* content_security_policy,
- KURL first_party_for_cookies,
+ KURL site_for_cookies,
RefPtr<SecurityOrigin> requestor_origin,
RefPtr<SecurityOrigin> requestor_origin_for_frame_loading,
const ClientHintsPreferences& client_hints_preferences,
@@ -195,7 +195,7 @@
parent_security_origin(std::move(parent_security_origin)),
address_space(address_space),
content_security_policy(content_security_policy),
- first_party_for_cookies(first_party_for_cookies),
+ site_for_cookies(site_for_cookies),
requestor_origin(requestor_origin),
requestor_origin_for_frame_loading(requestor_origin_for_frame_loading),
client_hints_preferences(client_hints_preferences),
@@ -211,7 +211,7 @@
const RefPtr<const SecurityOrigin> parent_security_origin;
const Optional<WebAddressSpace> address_space;
const Member<const ContentSecurityPolicy> content_security_policy;
- const KURL first_party_for_cookies;
+ const KURL site_for_cookies;
const RefPtr<SecurityOrigin> requestor_origin;
const RefPtr<SecurityOrigin> requestor_origin_for_frame_loading;
const ClientHintsPreferences client_hints_preferences;
@@ -276,14 +276,14 @@
return GetFrame()->FrameScheduler();
}
-KURL FrameFetchContext::GetFirstPartyForCookies() const {
+KURL FrameFetchContext::GetSiteForCookies() const {
if (IsDetached())
- return frozen_state_->first_party_for_cookies;
+ return frozen_state_->site_for_cookies;
// Use document_ for subresource or nested frame cases,
// GetFrame()->GetDocument() otherwise.
Document* document = document_ ? document_.Get() : GetFrame()->GetDocument();
- return document->FirstPartyForCookies();
+ return document->SiteForCookies();
}
LocalFrame* FrameFetchContext::GetFrame() const {
@@ -837,11 +837,11 @@
// Set the first party for cookies url if it has not been set yet (new
// requests). This value will be updated during redirects, consistent with
// https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1.1?
- if (request.FirstPartyForCookies().IsNull()) {
+ if (request.SiteForCookies().IsNull()) {
if (request.GetFrameType() == WebURLRequest::kFrameTypeTopLevel) {
- request.SetFirstPartyForCookies(request.Url());
+ request.SetSiteForCookies(request.Url());
} else {
- request.SetFirstPartyForCookies(GetFirstPartyForCookies());
+ request.SetSiteForCookies(GetSiteForCookies());
}
}
@@ -1150,16 +1150,16 @@
frozen_state_ = new FrozenState(
GetReferrerPolicy(), GetOutgoingReferrer(), Url(), GetSecurityOrigin(),
GetParentSecurityOrigin(), GetAddressSpace(),
- GetContentSecurityPolicy(), GetFirstPartyForCookies(),
- GetRequestorOrigin(), GetRequestorOriginForFrameLoading(),
- GetClientHintsPreferences(), GetDevicePixelRatio(), GetUserAgent(),
- IsMainFrame(), IsSVGImageChromeClient());
+ GetContentSecurityPolicy(), GetSiteForCookies(), GetRequestorOrigin(),
+ GetRequestorOriginForFrameLoading(), GetClientHintsPreferences(),
+ GetDevicePixelRatio(), GetUserAgent(), IsMainFrame(),
+ IsSVGImageChromeClient());
} else {
// Some getters are unavailable in this case.
frozen_state_ = new FrozenState(
kReferrerPolicyDefault, String(), NullURL(), GetSecurityOrigin(),
GetParentSecurityOrigin(), GetAddressSpace(),
- GetContentSecurityPolicy(), GetFirstPartyForCookies(),
+ GetContentSecurityPolicy(), GetSiteForCookies(),
SecurityOrigin::CreateUnique(), SecurityOrigin::CreateUnique(),
GetClientHintsPreferences(), GetDevicePixelRatio(), GetUserAgent(),
IsMainFrame(), IsSVGImageChromeClient());
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h
index 89bfdf9..b20d3f8 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h
@@ -181,7 +181,7 @@
WebFrameScheduler* GetFrameScheduler() override;
// BaseFetchContext overrides:
- KURL GetFirstPartyForCookies() const override;
+ KURL GetSiteForCookies() const override;
bool AllowScriptFromSource(const KURL&) const override;
SubresourceFilter* GetSubresourceFilter() const override;
bool ShouldBlockRequestByInspector(const KURL&) const override;
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
index 6b51759..ec61426 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -814,7 +814,7 @@
request.RequestorOrigin()->ToString());
}
- EXPECT_EQ(document->FirstPartyForCookies(), request.FirstPartyForCookies());
+ EXPECT_EQ(document->SiteForCookies(), request.SiteForCookies());
}
}
@@ -1285,7 +1285,7 @@
fetch_context->SetFirstPartyCookieAndRequestorOrigin(request);
- EXPECT_EQ(document_url, request.FirstPartyForCookies());
+ EXPECT_EQ(document_url, request.SiteForCookies());
EXPECT_EQ(origin, request.RequestorOrigin());
}
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
index b48a93d..105c7837 100644
--- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -96,8 +96,8 @@
}
}
-KURL WorkerFetchContext::GetFirstPartyForCookies() const {
- return web_context_->FirstPartyForCookies();
+KURL WorkerFetchContext::GetSiteForCookies() const {
+ return web_context_->SiteForCookies();
}
bool WorkerFetchContext::AllowScriptFromSource(const KURL&) const {
@@ -331,8 +331,8 @@
void WorkerFetchContext::SetFirstPartyCookieAndRequestorOrigin(
ResourceRequest& out_request) {
- if (out_request.FirstPartyForCookies().IsNull())
- out_request.SetFirstPartyForCookies(GetFirstPartyForCookies());
+ if (out_request.SiteForCookies().IsNull())
+ out_request.SetSiteForCookies(GetSiteForCookies());
if (!out_request.RequestorOrigin())
out_request.SetRequestorOrigin(GetSecurityOrigin());
}
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
index a240e3e..cace18a8 100644
--- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
+++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
@@ -35,7 +35,7 @@
RefPtr<WebTaskRunner> GetTaskRunner() { return loading_task_runner_; }
// BaseFetchContext implementation:
- KURL GetFirstPartyForCookies() const override;
+ KURL GetSiteForCookies() const override;
bool AllowScriptFromSource(const KURL&) const override;
SubresourceFilter* GetSubresourceFilter() const override;
bool ShouldBlockRequestByInspector(const KURL&) const override;
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
index 3dd6f8b..a9a8cf2 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -246,10 +246,10 @@
}
handle_->Initialize(std::move(socket_ptr));
- handle_->Connect(
- url, protocols, loading_context_->GetFetchContext()->GetSecurityOrigin(),
- loading_context_->GetFetchContext()->GetFirstPartyForCookies(),
- loading_context_->GetExecutionContext()->UserAgent(), this);
+ handle_->Connect(url, protocols,
+ loading_context_->GetFetchContext()->GetSecurityOrigin(),
+ loading_context_->GetFetchContext()->GetSiteForCookies(),
+ loading_context_->GetExecutionContext()->UserAgent(), this);
// TODO(ricea): Maybe lookup GetDocument()->GetFrame() less often?
if (handshake_throttle_ && GetDocument() && GetDocument()->GetFrame() &&
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
index 8b57763..d5ec310 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
@@ -227,7 +227,7 @@
document.SetURL(page_url);
// Make sure that firstPartyForCookies() is set to the given value.
EXPECT_STREQ("http://example.com/",
- document.FirstPartyForCookies().GetString().Utf8().data());
+ document.SiteForCookies().GetString().Utf8().data());
EXPECT_TRUE(Channel()->Connect(KURL(NullURL(), "ws://localhost/"), "x"));
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h b/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h
index bb79f22..9371534 100644
--- a/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandle.h
@@ -64,7 +64,7 @@
virtual void Connect(const KURL&,
const Vector<String>& protocols,
SecurityOrigin*,
- const KURL& first_party_for_cookies,
+ const KURL& site_for_cookies,
const String& user_agent_override,
WebSocketHandleClient*) = 0;
virtual void Send(bool fin, MessageType, const char* data, size_t) = 0;
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
index bd3556a..54d418c 100644
--- a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
@@ -48,7 +48,7 @@
void WebSocketHandleImpl::Connect(const KURL& url,
const Vector<String>& protocols,
SecurityOrigin* origin,
- const KURL& first_party_for_cookies,
+ const KURL& site_for_cookies,
const String& user_agent_override,
WebSocketHandleClient* client) {
DCHECK(websocket_);
@@ -68,7 +68,7 @@
->LoadingTaskRunner()
->ToSingleThreadTaskRunner()));
websocket_->AddChannelRequest(
- url, protocols, origin, first_party_for_cookies,
+ url, protocols, origin, site_for_cookies,
user_agent_override.IsNull() ? g_empty_string : user_agent_override,
std::move(client_proxy));
}
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h
index e89ce81..7e454e3b 100644
--- a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.h
@@ -47,7 +47,7 @@
void Connect(const KURL&,
const Vector<String>& protocols,
SecurityOrigin*,
- const KURL& first_party_for_cookies,
+ const KURL& site_for_cookies,
const String& user_agent_override,
WebSocketHandleClient*) override;
void Send(bool fin, MessageType, const char* data, size_t) override;
diff --git a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
index 8b71b183..1b5e54e 100644
--- a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
@@ -114,13 +114,12 @@
resource_request_->SetURL(url);
}
-WebURL WebURLRequest::FirstPartyForCookies() const {
- return resource_request_->FirstPartyForCookies();
+WebURL WebURLRequest::SiteForCookies() const {
+ return resource_request_->SiteForCookies();
}
-void WebURLRequest::SetFirstPartyForCookies(
- const WebURL& first_party_for_cookies) {
- resource_request_->SetFirstPartyForCookies(first_party_for_cookies);
+void WebURLRequest::SetSiteForCookies(const WebURL& site_for_cookies) {
+ resource_request_->SetSiteForCookies(site_for_cookies);
}
WebSecurityOrigin WebURLRequest::RequestorOrigin() const {
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
index 75f28c2..3448e240 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
@@ -187,7 +187,7 @@
bool ResourceLoader::WillFollowRedirect(
const WebURL& new_url,
- const WebURL& new_first_party_for_cookies,
+ const WebURL& new_site_for_cookies,
const WebString& new_referrer,
WebReferrerPolicy new_referrer_policy,
const WebString& new_method,
@@ -204,7 +204,7 @@
const ResourceRequest& last_request = resource_->LastResourceRequest();
ResourceRequest new_request(new_url);
- new_request.SetFirstPartyForCookies(new_first_party_for_cookies);
+ new_request.SetSiteForCookies(new_site_for_cookies);
new_request.SetDownloadToFile(last_request.DownloadToFile());
new_request.SetUseStreamOnResponse(last_request.UseStreamOnResponse());
new_request.SetRequestContext(last_request.GetRequestContext());
@@ -346,8 +346,7 @@
// First-party cookie logic moved from DocumentLoader in Blink to
// net::URLRequest in the browser. Assert that Blink didn't try to change it
// to something else.
- DCHECK(KURL(new_first_party_for_cookies) ==
- new_request.FirstPartyForCookies());
+ DCHECK(KURL(new_site_for_cookies) == new_request.SiteForCookies());
// The following parameters never change during the lifetime of a request.
DCHECK_EQ(new_request.GetRequestContext(), request_context);
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h
index 275d101c3..4e29a39 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h
@@ -98,7 +98,7 @@
// before DidFinishLoading(), including synchronous inside one of the other
// callbacks via ResourceLoader::cancel()
bool WillFollowRedirect(const WebURL& new_url,
- const WebURL& new_first_party_for_cookies,
+ const WebURL& new_site_for_cookies,
const WebString& new_referrer,
WebReferrerPolicy new_referrer_policy,
const WebString& new_method,
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
index d5c3600..0cb87da2 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
@@ -87,7 +87,7 @@
ResourceRequest::ResourceRequest(CrossThreadResourceRequestData* data)
: ResourceRequest(data->url_) {
SetTimeoutInterval(data->timeout_interval_);
- SetFirstPartyForCookies(data->first_party_for_cookies_);
+ SetSiteForCookies(data->site_for_cookies_);
SetRequestorOrigin(data->requestor_origin_);
SetHTTPMethod(AtomicString(data->http_method_));
SetPriority(data->priority_, data->intra_priority_value_);
@@ -135,7 +135,7 @@
WTF::MakeUnique<CrossThreadResourceRequestData>();
data->url_ = Url().Copy();
data->timeout_interval_ = TimeoutInterval();
- data->first_party_for_cookies_ = FirstPartyForCookies().Copy();
+ data->site_for_cookies_ = SiteForCookies().Copy();
data->requestor_origin_ =
RequestorOrigin() ? RequestorOrigin()->IsolatedCopy() : nullptr;
data->http_method_ = HttpMethod().GetString().IsolatedCopy();
@@ -213,13 +213,12 @@
timeout_interval_ = timout_interval_seconds;
}
-const KURL& ResourceRequest::FirstPartyForCookies() const {
- return first_party_for_cookies_;
+const KURL& ResourceRequest::SiteForCookies() const {
+ return site_for_cookies_;
}
-void ResourceRequest::SetFirstPartyForCookies(
- const KURL& first_party_for_cookies) {
- first_party_for_cookies_ = first_party_for_cookies;
+void ResourceRequest::SetSiteForCookies(const KURL& site_for_cookies) {
+ site_for_cookies_ = site_for_cookies;
}
RefPtr<SecurityOrigin> ResourceRequest::RequestorOrigin() const {
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
index e1f8530..ae038fe2 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
@@ -106,8 +106,8 @@
double TimeoutInterval() const; // May return 0 when using platform default.
void SetTimeoutInterval(double);
- const KURL& FirstPartyForCookies() const;
- void SetFirstPartyForCookies(const KURL&);
+ const KURL& SiteForCookies() const;
+ void SetSiteForCookies(const KURL&);
RefPtr<SecurityOrigin> RequestorOrigin() const;
void SetRequestorOrigin(RefPtr<SecurityOrigin>);
@@ -344,7 +344,7 @@
KURL url_;
double timeout_interval_; // 0 is a magic value for platform default on
// platforms that have one.
- KURL first_party_for_cookies_;
+ KURL site_for_cookies_;
RefPtr<SecurityOrigin> requestor_origin_;
AtomicString http_method_;
HTTPHeaderMap http_header_fields_;
@@ -408,7 +408,7 @@
WebCachePolicy cache_policy_;
double timeout_interval_;
- KURL first_party_for_cookies_;
+ KURL site_for_cookies_;
RefPtr<SecurityOrigin> requestor_origin_;
String http_method_;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp
index 68a9d8a..a8cdf35b 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequestTest.cpp
@@ -20,7 +20,7 @@
original.SetURL(KURL(kParsedURLString, "http://www.example.com/test.htm"));
original.SetCachePolicy(WebCachePolicy::kUseProtocolCachePolicy);
original.SetTimeoutInterval(10);
- original.SetFirstPartyForCookies(
+ original.SetSiteForCookies(
KURL(kParsedURLString, "http://www.example.com/first_party.htm"));
original.SetRequestorOrigin(SecurityOrigin::Create(
KURL(kParsedURLString, "http://www.example.com/first_party.htm")));
@@ -52,7 +52,7 @@
EXPECT_EQ(WebCachePolicy::kUseProtocolCachePolicy, original.GetCachePolicy());
EXPECT_EQ(10, original.TimeoutInterval());
EXPECT_STREQ("http://www.example.com/first_party.htm",
- original.FirstPartyForCookies().GetString().Utf8().data());
+ original.SiteForCookies().GetString().Utf8().data());
EXPECT_STREQ("www.example.com",
original.RequestorOrigin()->Host().Utf8().data());
EXPECT_STREQ("GET", original.HttpMethod().Utf8().data());
@@ -88,7 +88,7 @@
EXPECT_EQ(WebCachePolicy::kUseProtocolCachePolicy, copy1.GetCachePolicy());
EXPECT_EQ(10, copy1.TimeoutInterval());
EXPECT_STREQ("http://www.example.com/first_party.htm",
- copy1.FirstPartyForCookies().GetString().Utf8().data());
+ copy1.SiteForCookies().GetString().Utf8().data());
EXPECT_STREQ("www.example.com",
copy1.RequestorOrigin()->Host().Utf8().data());
EXPECT_STREQ("GET", copy1.HttpMethod().Utf8().data());
diff --git a/third_party/WebKit/public/platform/WebCookieJar.h b/third_party/WebKit/public/platform/WebCookieJar.h
index d09df54..bd0a1aba 100644
--- a/third_party/WebKit/public/platform/WebCookieJar.h
+++ b/third_party/WebKit/public/platform/WebCookieJar.h
@@ -40,14 +40,12 @@
class WebCookieJar {
public:
virtual void SetCookie(const WebURL&,
- const WebURL& first_party_for_cookies,
+ const WebURL& site_for_cookies,
const WebString& cookie) {}
- virtual WebString Cookies(const WebURL&,
- const WebURL& first_party_for_cookies) {
+ virtual WebString Cookies(const WebURL&, const WebURL& site_for_cookies) {
return WebString();
}
- virtual bool CookiesEnabled(const WebURL&,
- const WebURL& first_party_for_cookies) {
+ virtual bool CookiesEnabled(const WebURL&, const WebURL& site_for_cookies) {
return true;
}
diff --git a/third_party/WebKit/public/platform/WebURLLoaderClient.h b/third_party/WebKit/public/platform/WebURLLoaderClient.h
index 955cbdc..c6e9787 100644
--- a/third_party/WebKit/public/platform/WebURLLoaderClient.h
+++ b/third_party/WebKit/public/platform/WebURLLoaderClient.h
@@ -54,7 +54,7 @@
// redirect, or false otherwise.
virtual bool WillFollowRedirect(
const WebURL& new_url,
- const WebURL& new_first_party_for_cookies,
+ const WebURL& new_site_for_cookies,
const WebString& new_referrer,
WebReferrerPolicy new_referrer_policy,
const WebString& new_method,
diff --git a/third_party/WebKit/public/platform/WebURLRequest.h b/third_party/WebKit/public/platform/WebURLRequest.h
index ce3057d1..c473e3a 100644
--- a/third_party/WebKit/public/platform/WebURLRequest.h
+++ b/third_party/WebKit/public/platform/WebURLRequest.h
@@ -204,8 +204,8 @@
BLINK_PLATFORM_EXPORT void SetURL(const WebURL&);
// Used to implement third-party cookie blocking.
- BLINK_PLATFORM_EXPORT WebURL FirstPartyForCookies() const;
- BLINK_PLATFORM_EXPORT void SetFirstPartyForCookies(const WebURL&);
+ BLINK_PLATFORM_EXPORT WebURL SiteForCookies() const;
+ BLINK_PLATFORM_EXPORT void SetSiteForCookies(const WebURL&);
// The origin of the execution context which originated the request. Used to
// implement First-Party-Only cookie restrictions.
diff --git a/third_party/WebKit/public/platform/WebWorkerFetchContext.h b/third_party/WebKit/public/platform/WebWorkerFetchContext.h
index 5c5e811f..648d745f 100644
--- a/third_party/WebKit/public/platform/WebWorkerFetchContext.h
+++ b/third_party/WebKit/public/platform/WebWorkerFetchContext.h
@@ -56,9 +56,9 @@
// The URL that should be consulted for the third-party cookie blocking
// policy, as defined in Section 2.1.1 and 2.1.2 of
- // https://tools.ietf.org/html/draft-west-first-party-cookies.
- // See content::URLRequest::first_party_for_cookies() for details.
- virtual WebURL FirstPartyForCookies() const = 0;
+ // https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site.
+ // See content::URLRequest::site_for_cookies() for details.
+ virtual WebURL SiteForCookies() const = 0;
// Reports the certificate error to the browser process.
virtual void DidRunContentWithCertificateErrors(const WebURL& url) {}
diff --git a/third_party/WebKit/public/web/WebDocument.h b/third_party/WebKit/public/web/WebDocument.h
index fe40942..cb934ef 100644
--- a/third_party/WebKit/public/web/WebDocument.h
+++ b/third_party/WebKit/public/web/WebDocument.h
@@ -93,7 +93,7 @@
// The firstPartyForCookies is used to compute whether this document
// appears in a "third-party" context for the purpose of third-party
// cookie blocking.
- BLINK_EXPORT WebURL FirstPartyForCookies() const;
+ BLINK_EXPORT WebURL SiteForCookies() const;
BLINK_EXPORT WebElement DocumentElement() const;
BLINK_EXPORT WebElement Body() const;