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

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

Issue 876973003: Implement the "first-party-only" cookie flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FirstPartyOnly. Created 5 years, 10 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 16cfbaf79e3710c4dbc130bd1ce30896eb7bf00c..25f55e7f19332de261d280ea13e2ec36b7b889fb 100644
--- a/chrome/browser/android/cookies/cookies_fetcher.cc
+++ b/chrome/browser/android/cookies/cookies_fetcher.cc
@@ -76,20 +76,16 @@ void CookiesFetcher::OnCookiesFetchFinished(const net::CookieList& cookies) {
int index = 0;
for (net::CookieList::const_iterator i = cookies.begin();
i != cookies.end(); ++i) {
- ScopedJavaLocalRef<jobject> java_cookie =
- Java_CookiesFetcher_createCookie(
- env, jobject_.obj(),
- base::android::ConvertUTF8ToJavaString(env, i->Source()).obj(),
- base::android::ConvertUTF8ToJavaString(env, i->Name()).obj(),
- base::android::ConvertUTF8ToJavaString(env, i->Value()).obj(),
- base::android::ConvertUTF8ToJavaString(env, i->Domain()).obj(),
- base::android::ConvertUTF8ToJavaString(env, i->Path()).obj(),
- i->CreationDate().ToInternalValue(),
- i->ExpiryDate().ToInternalValue(),
- i->LastAccessDate().ToInternalValue(),
- i->IsSecure(),
- i->IsHttpOnly(),
- i->Priority());
+ ScopedJavaLocalRef<jobject> java_cookie = Java_CookiesFetcher_createCookie(
+ env, jobject_.obj(),
+ base::android::ConvertUTF8ToJavaString(env, i->Source()).obj(),
+ base::android::ConvertUTF8ToJavaString(env, i->Name()).obj(),
+ base::android::ConvertUTF8ToJavaString(env, i->Value()).obj(),
+ base::android::ConvertUTF8ToJavaString(env, i->Domain()).obj(),
+ base::android::ConvertUTF8ToJavaString(env, i->Path()).obj(),
+ i->CreationDate().ToInternalValue(), i->ExpiryDate().ToInternalValue(),
+ i->LastAccessDate().ToInternalValue(), i->IsSecure(), i->IsHttpOnly(),
+ i->IsFirstPartyOnly(), i->Priority());
env->SetObjectArrayElement(joa.obj(), index++, java_cookie.obj());
}
@@ -111,6 +107,7 @@ void CookiesFetcher::RestoreCookies(JNIEnv* env,
int64 last_access,
bool secure,
bool httponly,
+ bool firstpartyonly,
int priority) {
Profile* profile = ProfileManager::GetPrimaryUserProfile();
if (!profile->HasOffTheRecordProfile()) {
@@ -129,8 +126,8 @@ void CookiesFetcher::RestoreCookies(JNIEnv* env,
base::android::ConvertJavaStringToUTF8(env, path),
base::Time::FromInternalValue(creation),
base::Time::FromInternalValue(expiration),
- base::Time::FromInternalValue(last_access),
- secure, httponly, static_cast<net::CookiePriority>(priority));
+ base::Time::FromInternalValue(last_access), secure, httponly,
+ firstpartyonly, static_cast<net::CookiePriority>(priority));
// The rest must be done from the IO thread.
content::BrowserThread::PostTask(
@@ -158,17 +155,9 @@ void CookiesFetcher::RestoreToCookieJarInternal(
base::Callback<void(bool success)> cb;
monster->SetCookieWithDetailsAsync(
- GURL(cookie.Source()),
- cookie.Name(),
- cookie.Value(),
- cookie.Domain(),
- cookie.Path(),
- cookie.ExpiryDate(),
- cookie.IsSecure(),
- cookie.IsHttpOnly(),
- cookie.Priority(),
- cb
- );
+ GURL(cookie.Source()), cookie.Name(), cookie.Value(), cookie.Domain(),
+ cookie.Path(), cookie.ExpiryDate(), cookie.IsSecure(),
+ cookie.IsHttpOnly(), cookie.IsFirstPartyOnly(), cookie.Priority(), cb);
}
// JNI functions
« no previous file with comments | « chrome/browser/android/cookies/cookies_fetcher.h ('k') | chrome/browser/chromeos/login/profile_auth_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698