Title: [136058] trunk/Source
Revision
136058
Author
[email protected]
Date
2012-11-28 14:37:06 -0800 (Wed, 28 Nov 2012)

Log Message

[BlackBerry] CookieJarBlackBerry will use document settings for cookiesEnabled
https://bugs.webkit.org/show_bug.cgi?id=103560

Patch by Otto Derek Cheung <[email protected]> on 2012-11-28
Reviewed by Rob Buis.

PR 253490

Source/WebCore:

CookieJarBlackBerry will now use page settings to check whether
cookie is enabled.

Tested setting/reading cookies on different client cookie settings using
_javascript_ and HTTP. Cookie behaviour is now back to spec.

* loader/blackberry/CookieJarBlackBerry.cpp:
(WebCore::cookies):
(WebCore::cookieRequestHeaderFieldValue):

Source/WebKit/blackberry:

Syncing platform Websetting's cookieEnabled value with Page->setting's cookieEnabled
value.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::didChangeSettings):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136057 => 136058)


--- trunk/Source/WebCore/ChangeLog	2012-11-28 22:35:36 UTC (rev 136057)
+++ trunk/Source/WebCore/ChangeLog	2012-11-28 22:37:06 UTC (rev 136058)
@@ -1,3 +1,22 @@
+2012-11-28  Otto Derek Cheung  <[email protected]>
+
+        [BlackBerry] CookieJarBlackBerry will use document settings for cookiesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=103560
+
+        Reviewed by Rob Buis.
+
+        PR 253490
+
+        CookieJarBlackBerry will now use page settings to check whether
+        cookie is enabled.
+
+        Tested setting/reading cookies on different client cookie settings using
+        _javascript_ and HTTP. Cookie behaviour is now back to spec.
+
+        * loader/blackberry/CookieJarBlackBerry.cpp:
+        (WebCore::cookies):
+        (WebCore::cookieRequestHeaderFieldValue):
+
 2012-11-28  Mark Pilgrim  <[email protected]>
 
         [Chromium][Win] Remove ensureFontLoaded from PlatformSupport

Modified: trunk/Source/WebCore/loader/blackberry/CookieJarBlackBerry.cpp (136057 => 136058)


--- trunk/Source/WebCore/loader/blackberry/CookieJarBlackBerry.cpp	2012-11-28 22:35:36 UTC (rev 136057)
+++ trunk/Source/WebCore/loader/blackberry/CookieJarBlackBerry.cpp	2012-11-28 22:37:06 UTC (rev 136058)
@@ -39,6 +39,9 @@
 
 String cookies(Document const* document, KURL const& url)
 {
+    if (!document->settings()->cookieEnabled())
+        return String();
+
     // 'HttpOnly' cookies should no be accessible from scripts, so we filter them out here
     return cookieManager().getCookie(url, NoHttpOnlyCookie);
 }
@@ -75,14 +78,9 @@
 
 String cookieRequestHeaderFieldValue(const Document* document, const KURL &url)
 {
-    ASSERT(document);
-
-    if (!(document->frame() && document->frame()->loader() && document->frame()->loader()->client()))
+    if (!document->settings()->cookieEnabled())
         return String();
 
-    if (!static_cast<FrameLoaderClientBlackBerry*>(document->frame()->loader()->client())->cookiesEnabled())
-        return String();
-
     return cookieManager().getCookie(url, WithHttpOnlyCookies);
 }
 

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (136057 => 136058)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-11-28 22:35:36 UTC (rev 136057)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-11-28 22:37:06 UTC (rev 136058)
@@ -5799,6 +5799,7 @@
 
     coreSettings->setFirstScheduledLayoutDelay(webSettings->firstScheduledLayoutDelay());
     coreSettings->setUseCache(webSettings->useWebKitCache());
+    coreSettings->setCookieEnabled(webSettings->areCookiesEnabled());
 
 #if ENABLE(SQL_DATABASE)
     // DatabaseTracker can only be initialized for once, so it doesn't

Modified: trunk/Source/WebKit/blackberry/ChangeLog (136057 => 136058)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-11-28 22:35:36 UTC (rev 136057)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-11-28 22:37:06 UTC (rev 136058)
@@ -1,3 +1,18 @@
+2012-11-28  Otto Derek Cheung  <[email protected]>
+
+        [BlackBerry] CookieJarBlackBerry will use document settings for cookiesEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=103560
+
+        Reviewed by Rob Buis.
+
+        PR 253490
+
+        Syncing platform Websetting's cookieEnabled value with Page->setting's cookieEnabled
+        value.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
+
 2012-11-27  James Simonsen  <[email protected]>
 
         Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to