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

Unified Diff: android_webview/native/cookie_manager.cc

Issue 241143002: Allows AwCookieManager to block ThirdParty cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed toThirdPartyUrl use Created 6 years, 8 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
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/CookieManagerTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/cookie_manager.cc
diff --git a/android_webview/native/cookie_manager.cc b/android_webview/native/cookie_manager.cc
index 310cb431c89559958ed31a68228f666f3c8d13da..adb0ec87b5a804c53b906c3aec64e684552e8f55 100644
--- a/android_webview/native/cookie_manager.cc
+++ b/android_webview/native/cookie_manager.cc
@@ -96,6 +96,8 @@ class CookieManager {
void SetAcceptCookie(bool accept);
bool AcceptCookie();
+ void SetAcceptThirdPartyCookie(bool accept);
+ bool AcceptThirdPartyCookie();
void SetCookie(const GURL& host, const std::string& cookie_value);
std::string GetCookie(const GURL& host);
void RemoveSessionCookie();
@@ -273,6 +275,14 @@ bool CookieManager::AcceptCookie() {
return AwCookieAccessPolicy::GetInstance()->GetGlobalAllowAccess();
}
+void CookieManager::SetAcceptThirdPartyCookie(bool accept) {
+ AwCookieAccessPolicy::GetInstance()->SetThirdPartyAllowAccess(accept);
+}
+
+bool CookieManager::AcceptThirdPartyCookie() {
+ return AwCookieAccessPolicy::GetInstance()->GetThirdPartyAllowAccess();
+}
+
void CookieManager::SetCookie(const GURL& host,
const std::string& cookie_value) {
ExecCookieTask(base::Bind(&CookieManager::SetCookieAsyncHelper,
@@ -447,6 +457,16 @@ static jboolean AcceptCookie(JNIEnv* env, jobject obj) {
return CookieManager::GetInstance()->AcceptCookie();
}
+static void SetAcceptThirdPartyCookie(JNIEnv* env,
+ jobject obj,
+ jboolean accept) {
+ CookieManager::GetInstance()->SetAcceptThirdPartyCookie(accept);
+}
+
+static jboolean AcceptThirdPartyCookie(JNIEnv* env, jobject obj) {
+ return CookieManager::GetInstance()->AcceptThirdPartyCookie();
+}
+
static void SetCookie(JNIEnv* env, jobject obj, jstring url, jstring value) {
GURL host(ConvertJavaStringToUTF16(env, url));
std::string cookie_value(ConvertJavaStringToUTF8(env, value));
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/CookieManagerTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698