summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-04-25 14:46:36 -0700
committerGeorge Mount <mount@google.com>2012-04-25 14:46:36 -0700
commitdea81519c4952136ae22d26e3d7395535d39691c (patch)
tree63d05456fd55969284aff433c5770d091456fead
parent2ad54828a335c8e7337ab1f1077253689630a6d2 (diff)
downloadexternal_webkit-dea81519c4952136ae22d26e3d7395535d39691c.zip
external_webkit-dea81519c4952136ae22d26e3d7395535d39691c.tar.gz
external_webkit-dea81519c4952136ae22d26e3d7395535d39691c.tar.bz2
Disallow cookies for JavaScript when disabled.
Bug 6363497 Change-Id: I97d6e7caf1820a624f92a12b69bd4ccfab80e0b9
-rw-r--r--Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
index 04b487a..9b8aac8 100644
--- a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
+++ b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
@@ -78,15 +78,21 @@ void PlatformBridge::setCookies(const Document* document, const KURL& url, const
std::string cookieValue(value.utf8().data());
GURL cookieGurl(url.string().utf8().data());
bool isPrivateBrowsing = document->settings() && document->settings()->privateBrowsingEnabled();
- WebCookieJar::get(isPrivateBrowsing)->cookieStore()->SetCookie(cookieGurl, cookieValue);
+ WebCookieJar* cookieJar = WebCookieJar::get(isPrivateBrowsing);
+ if (cookieJar->allowCookies())
+ cookieJar->cookieStore()->SetCookie(cookieGurl, cookieValue);
}
String PlatformBridge::cookies(const Document* document, const KURL& url)
{
GURL cookieGurl(url.string().utf8().data());
bool isPrivateBrowsing = document->settings() && document->settings()->privateBrowsingEnabled();
- std::string cookies = WebCookieJar::get(isPrivateBrowsing)->cookieStore()->GetCookies(cookieGurl);
- String cookieString(cookies.c_str());
+ WebCookieJar* cookieJar = WebCookieJar::get(isPrivateBrowsing);
+ String cookieString;
+ if (cookieJar->allowCookies()) {
+ std::string cookies = cookieJar->cookieStore()->GetCookies(cookieGurl);
+ cookieString = cookies.c_str();
+ }
return cookieString;
}