summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/cookies
diff options
context:
space:
mode:
authorestark <estark@chromium.org>2015-10-16 23:42:07 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-17 06:43:10 +0000
commit467a098174e062d4380eb0ad8f7b2f0b0b7ed5fa (patch)
treeebb9b150d8b482127e8ec33803500a7e61114acd /chrome/browser/extensions/api/cookies
parent79b646f146c5d89aab1efc3fcd974b5ec710314e (diff)
downloadchromium_src-467a098174e062d4380eb0ad8f7b2f0b0b7ed5fa.zip
chromium_src-467a098174e062d4380eb0ad8f7b2f0b0b7ed5fa.tar.gz
chromium_src-467a098174e062d4380eb0ad8f7b2f0b0b7ed5fa.tar.bz2
Implement $Secure- cookie prefix
This CL implements the rule that cookies whose names start with $Secure- can only be set if the Secure attribute is enabled. The implementation is a runtime-enabled web platform feature for now. Intent to Implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/IU5t6eLuS2Y/Uq-7Kat9BwAJ BUG=541511 TBR=droger@chromium.org Review URL: https://codereview.chromium.org/1393193005 Cr-Commit-Position: refs/heads/master@{#354676}
Diffstat (limited to 'chrome/browser/extensions/api/cookies')
-rw-r--r--chrome/browser/extensions/api/cookies/cookies_api.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc
index 8f020919..558f90d 100644
--- a/chrome/browser/extensions/api/cookies/cookies_api.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -382,9 +382,8 @@ void CookiesSetFunction::SetCookieOnIOThread() {
}
cookie_monster->SetCookieWithDetailsAsync(
- url_,
- parsed_args_->details.name.get() ? *parsed_args_->details.name
- : std::string(),
+ url_, parsed_args_->details.name.get() ? *parsed_args_->details.name
+ : std::string(),
parsed_args_->details.value.get() ? *parsed_args_->details.value
: std::string(),
parsed_args_->details.domain.get() ? *parsed_args_->details.domain
@@ -399,7 +398,9 @@ void CookiesSetFunction::SetCookieOnIOThread() {
// TODO(mkwst): If we decide to ship First-party-only cookies, we'll need
// to extend the extension API to support them. For the moment, we'll set
// all cookies as non-First-party-only.
- false,
+ false, store_browser_context_->GetURLRequestContext()
+ ->network_delegate()
+ ->AreExperimentalCookieFeaturesEnabled(),
net::COOKIE_PRIORITY_DEFAULT,
base::Bind(&CookiesSetFunction::PullCookie, this));
}