Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4162)

Unified Diff: chrome/browser/android/cookies/cookies_fetcher.cc

Issue 1393193005: Implement $Secure- cookie prefix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/cookies/cookies_fetcher.cc
diff --git a/chrome/browser/android/cookies/cookies_fetcher.cc b/chrome/browser/android/cookies/cookies_fetcher.cc
index d8c4bf154b499258147bd51a9270d4593f0b6263..29a6a64aa9384d9cfce69705fbdeb49f2ff88bd0 100644
--- a/chrome/browser/android/cookies/cookies_fetcher.cc
+++ b/chrome/browser/android/cookies/cookies_fetcher.cc
@@ -5,10 +5,12 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/time/time.h"
#include "chrome/browser/android/cookies/cookies_fetcher.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_switches.h"
#include "jni/CookiesFetcher_jni.h"
#include "net/cookies/cookie_monster.h"
#include "net/cookies/cookie_store.h"
@@ -154,10 +156,16 @@ void CookiesFetcher::RestoreToCookieJarInternal(
net::CookieMonster* monster = store->GetCookieMonster();
base::Callback<void(bool success)> cb;
+ // TODO(estark): Remove kEnableExperimentalWebPlatformFeatures check
+ // when we decide whether to ship cookie
+ // prefixes. https://crbug.com/541511
monster->SetCookieWithDetailsAsync(
cookie.Source(), cookie.Name(), cookie.Value(), cookie.Domain(),
cookie.Path(), cookie.ExpiryDate(), cookie.IsSecure(),
- cookie.IsHttpOnly(), cookie.IsFirstPartyOnly(), cookie.Priority(), cb);
+ cookie.IsHttpOnly(), cookie.IsFirstPartyOnly(),
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExperimentalWebPlatformFeatures),
+ cookie.Priority(), cb);
}
// JNI functions
« no previous file with comments | « no previous file | chrome/browser/extensions/api/cookies/cookies_api.cc » ('j') | net/url_request/url_request_http_job.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698