summaryrefslogtreecommitdiffstats
path: root/net/base/static_cookie_policy.cc
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-31 20:30:28 +0100
committerKristian Monsen <kristianm@google.com>2011-06-14 20:31:41 -0700
commit72a454cd3513ac24fbdd0e0cb9ad70b86a99b801 (patch)
tree382278a54ce7a744d62fa510a9a80688cc12434b /net/base/static_cookie_policy.cc
parentc4becdd46e31d261b930e4b5a539cbc1d45c23a6 (diff)
downloadexternal_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.zip
external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.gz
external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.bz2
Merge Chromium.org at r11.0.672.0: Initial merge by git.
Change-Id: I8b4aaf611a2a405fe3fe10e8a94ea7658645c192
Diffstat (limited to 'net/base/static_cookie_policy.cc')
-rw-r--r--net/base/static_cookie_policy.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/base/static_cookie_policy.cc b/net/base/static_cookie_policy.cc
index 0ff6ead..19e0a16 100644
--- a/net/base/static_cookie_policy.cc
+++ b/net/base/static_cookie_policy.cc
@@ -16,9 +16,13 @@ int StaticCookiePolicy::CanGetCookies(const GURL& url,
CompletionCallback* callback) {
switch (type_) {
case StaticCookiePolicy::ALLOW_ALL_COOKIES:
+ case StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES:
return OK;
- case StaticCookiePolicy::BLOCK_THIRD_PARTY_COOKIES:
- return OK;
+ case StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES:
+ if (first_party_for_cookies.is_empty())
+ return OK; // Empty first-party URL indicates a first-party request.
+ return RegistryControlledDomainService::SameDomainOrHost(
+ url, first_party_for_cookies) ? OK : ERR_ACCESS_DENIED;
case StaticCookiePolicy::BLOCK_ALL_COOKIES:
return ERR_ACCESS_DENIED;
default:
@@ -34,7 +38,8 @@ int StaticCookiePolicy::CanSetCookie(const GURL& url,
switch (type_) {
case StaticCookiePolicy::ALLOW_ALL_COOKIES:
return OK;
- case StaticCookiePolicy::BLOCK_THIRD_PARTY_COOKIES:
+ case StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES:
+ case StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES:
if (first_party_for_cookies.is_empty())
return OK; // Empty first-party URL indicates a first-party request.
return RegistryControlledDomainService::SameDomainOrHost(