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

Side by Side Diff: chrome/browser/android/cookies/cookies_fetcher.cc

Issue 2633663003: Implements strict secure cookies as the default behavior in //net (Closed)
Patch Set: Rebase on ToT Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/android/jni_android.h" 5 #include "base/android/jni_android.h"
6 #include "base/android/jni_string.h" 6 #include "base/android/jni_string.h"
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/android/cookies/cookies_fetcher.h" 10 #include "chrome/browser/android/cookies/cookies_fetcher.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 // Assume HTTPS - since the cookies are being restored from another store, 120 // Assume HTTPS - since the cookies are being restored from another store,
121 // they have already gone through the strict secure check. 121 // they have already gone through the strict secure check.
122 GURL url(std::string(url::kHttpsScheme) + url::kStandardSchemeSeparator + 122 GURL url(std::string(url::kHttpsScheme) + url::kStandardSchemeSeparator +
123 host + "/"); 123 host + "/");
124 124
125 store->SetCookieWithDetailsAsync( 125 store->SetCookieWithDetailsAsync(
126 url, cookie.Name(), cookie.Value(), effective_domain, cookie.Path(), 126 url, cookie.Name(), cookie.Value(), effective_domain, cookie.Path(),
127 base::Time(), cookie.ExpiryDate(), cookie.LastAccessDate(), 127 base::Time(), cookie.ExpiryDate(), cookie.LastAccessDate(),
128 cookie.IsSecure(), cookie.IsHttpOnly(), cookie.SameSite(), false, 128 cookie.IsSecure(), cookie.IsHttpOnly(), cookie.SameSite(),
129 cookie.Priority(), cb); 129 cookie.Priority(), cb);
130 } 130 }
131 131
132 static void RestoreCookies(JNIEnv* env, 132 static void RestoreCookies(JNIEnv* env,
133 const JavaParamRef<jclass>& jcaller, 133 const JavaParamRef<jclass>& jcaller,
134 const JavaParamRef<jstring>& name, 134 const JavaParamRef<jstring>& name,
135 const JavaParamRef<jstring>& value, 135 const JavaParamRef<jstring>& value,
136 const JavaParamRef<jstring>& domain, 136 const JavaParamRef<jstring>& domain,
137 const JavaParamRef<jstring>& path, 137 const JavaParamRef<jstring>& path,
138 jlong creation, 138 jlong creation,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 // JNI functions 173 // JNI functions
174 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 174 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
175 return reinterpret_cast<intptr_t>(new CookiesFetcher(env, obj, 0)); 175 return reinterpret_cast<intptr_t>(new CookiesFetcher(env, obj, 0));
176 } 176 }
177 177
178 // Register native methods 178 // Register native methods
179 bool RegisterCookiesFetcher(JNIEnv* env) { 179 bool RegisterCookiesFetcher(JNIEnv* env) {
180 return RegisterNativesImpl(env); 180 return RegisterNativesImpl(env);
181 } 181 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698