summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/WebCoreSupport
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-04-26 14:39:46 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-26 14:39:46 -0700
commit0cc9bd18cde7294402b1803ceb92f92fa5f8fc0b (patch)
tree8f0c485c1720a6c3aae2612b36578856ef4ffeb7 /Source/WebKit/android/WebCoreSupport
parent683dfb132ae658ac59233082263ccfc47f6acf56 (diff)
parentdea81519c4952136ae22d26e3d7395535d39691c (diff)
downloadexternal_webkit-0cc9bd18cde7294402b1803ceb92f92fa5f8fc0b.zip
external_webkit-0cc9bd18cde7294402b1803ceb92f92fa5f8fc0b.tar.gz
external_webkit-0cc9bd18cde7294402b1803ceb92f92fa5f8fc0b.tar.bz2
Merge "Disallow cookies for JavaScript when disabled." into jb-dev
Diffstat (limited to 'Source/WebKit/android/WebCoreSupport')
-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;
}