Title: [134936] trunk/Source/WebCore
Revision
134936
Author
pilg...@chromium.org
Date
2012-11-16 05:35:47 -0800 (Fri, 16 Nov 2012)

Log Message

Expand PlatformCookieJar interface to allow for other ports
https://bugs.webkit.org/show_bug.cgi?id=102456

Reviewed by Adam Barth.

Add firstParty and cookieURL arguments to several functions to
prepare for integrating Chromium port into new PlatformCookieJar
interface.

* loader/CookieJar.cpp:
(WebCore::cookiesEnabled):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::getRawCookies):
* platform/network/PlatformCookieJar.h:
(WebCore):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
* platform/network/qt/CookieJarQt.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
* platform/network/win/CookieJarWin.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134935 => 134936)


--- trunk/Source/WebCore/ChangeLog	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/ChangeLog	2012-11-16 13:35:47 UTC (rev 134936)
@@ -1,3 +1,45 @@
+2012-11-16  Mark Pilgrim  <pilg...@chromium.org>
+
+        Expand PlatformCookieJar interface to allow for other ports
+        https://bugs.webkit.org/show_bug.cgi?id=102456
+
+        Reviewed by Adam Barth.
+
+        Add firstParty and cookieURL arguments to several functions to
+        prepare for integrating Chromium port into new PlatformCookieJar
+        interface.
+
+        * loader/CookieJar.cpp:
+        (WebCore::cookiesEnabled):
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::getRawCookies):
+        * platform/network/PlatformCookieJar.h:
+        (WebCore):
+        * platform/network/cf/CookieJarCFNet.cpp:
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        * platform/network/curl/CookieJarCurl.cpp:
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        * platform/network/mac/CookieJarMac.mm:
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        * platform/network/qt/CookieJarQt.cpp:
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        * platform/network/soup/CookieJarSoup.cpp:
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        * platform/network/win/CookieJarWin.cpp:
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+
 2012-11-16  Julien Chaffraix  <jchaffr...@webkit.org>
 
         RenderGrid should have a function to resolve grid position

Modified: trunk/Source/WebCore/loader/CookieJar.cpp (134935 => 134936)


--- trunk/Source/WebCore/loader/CookieJar.cpp	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/loader/CookieJar.cpp	2012-11-16 13:35:47 UTC (rev 134936)
@@ -61,17 +61,17 @@
 
 bool cookiesEnabled(const Document* document)
 {
-    return cookiesEnabled(networkingContext(document));
+    return cookiesEnabled(networkingContext(document), document->firstPartyForCookies(), document->cookieURL());
 }
 
 String cookieRequestHeaderFieldValue(const Document* document, const KURL& url)
 {
-    return cookieRequestHeaderFieldValue(networkingContext(document), url);
+    return cookieRequestHeaderFieldValue(networkingContext(document), document->firstPartyForCookies(), url);
 }
 
 bool getRawCookies(const Document* document, const KURL& url, Vector<Cookie>& cookies)
 {
-    return getRawCookies(networkingContext(document), url, cookies);
+    return getRawCookies(networkingContext(document), document->firstPartyForCookies(), url, cookies);
 }
 
 void deleteCookie(const Document* document, const KURL& url, const String& cookieName)

Modified: trunk/Source/WebCore/platform/network/PlatformCookieJar.h (134935 => 134936)


--- trunk/Source/WebCore/platform/network/PlatformCookieJar.h	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/platform/network/PlatformCookieJar.h	2012-11-16 13:35:47 UTC (rev 134936)
@@ -40,9 +40,9 @@
 // If networking context is null, default cookie storage is used.
 String cookiesForDOM(NetworkingContext*, const KURL& firstParty, const KURL&);
 void setCookiesFromDOM(NetworkingContext*, const KURL& firstParty, const KURL&, const String&);
-bool cookiesEnabled(NetworkingContext*);
-String cookieRequestHeaderFieldValue(NetworkingContext*, const KURL&);
-bool getRawCookies(NetworkingContext*, const KURL&, Vector<Cookie>&);
+bool cookiesEnabled(NetworkingContext*, const KURL& firstParty, const KURL&);
+String cookieRequestHeaderFieldValue(NetworkingContext*, const KURL& firstParty, const KURL&);
+bool getRawCookies(NetworkingContext*, const KURL& firstParty, const KURL&, Vector<Cookie>&);
 void deleteCookie(NetworkingContext*, const KURL&, const String&);
 void getHostnamesWithCookies(NetworkingContext*, HashSet<String>& hostnames);
 void deleteCookiesForHostname(NetworkingContext*, const String& hostname);

Modified: trunk/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp (134935 => 134936)


--- trunk/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/platform/network/cf/CookieJarCFNet.cpp	2012-11-16 13:35:47 UTC (rev 134936)
@@ -136,7 +136,7 @@
     return (CFStringRef)CFDictionaryGetValue(headerCF.get(), s_cookieCF);
 }
 
-String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& url)
+String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url)
 {
     RetainPtr<CFHTTPCookieStorageRef> cookieStorage = context ? currentCFHTTPCookieStorage() : defaultCFHTTPCookieStorage();
     if (!cookieStorage)
@@ -150,7 +150,7 @@
     return (CFStringRef)CFDictionaryGetValue(headerCF.get(), s_cookieCF);
 }
 
-bool cookiesEnabled(NetworkingContext* context)
+bool cookiesEnabled(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/)
 {
     CFHTTPCookieStorageAcceptPolicy policy = CFHTTPCookieStorageAcceptPolicyOnlyFromMainDocumentDomain;
     RetainPtr<CFHTTPCookieStorageRef> cookieStorage = context ? currentCFHTTPCookieStorage() : defaultCFHTTPCookieStorage();
@@ -159,7 +159,7 @@
     return policy == CFHTTPCookieStorageAcceptPolicyOnlyFromMainDocumentDomain || policy == CFHTTPCookieStorageAcceptPolicyAlways;
 }
 
-bool getRawCookies(NetworkingContext* context, const KURL& url, Vector<Cookie>& rawCookies)
+bool getRawCookies(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url, Vector<Cookie>& rawCookies)
 {
     rawCookies.clear();
     RetainPtr<CFHTTPCookieStorageRef> cookieStorage = context ? currentCFHTTPCookieStorage() : defaultCFHTTPCookieStorage();

Modified: trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp (134935 => 134936)


--- trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp	2012-11-16 13:35:47 UTC (rev 134936)
@@ -37,18 +37,18 @@
     return cookieJar.get(url.string());
 }
 
-String cookieRequestHeaderFieldValue(NetworkingContext*, const KURL& url)
+String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url)
 {
     // FIXME: include HttpOnly cookie.
     return cookieJar.get(url.string());
 }
 
-bool cookiesEnabled(NetworkingContext*)
+bool cookiesEnabled(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/)
 {
     return true;
 }
 
-bool getRawCookies(NetworkingContext*, const KURL&, Vector<Cookie>& rawCookies)
+bool getRawCookies(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/, Vector<Cookie>& rawCookies)
 {
     // FIXME: Not yet implemented
     rawCookies.clear();

Modified: trunk/Source/WebCore/platform/network/mac/CookieJarMac.mm (134935 => 134936)


--- trunk/Source/WebCore/platform/network/mac/CookieJarMac.mm	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/platform/network/mac/CookieJarMac.mm	2012-11-16 13:35:47 UTC (rev 134936)
@@ -73,7 +73,7 @@
     return String();
 }
 
-String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& url)
+String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
@@ -108,7 +108,7 @@
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-bool cookiesEnabled(NetworkingContext* context)
+bool cookiesEnabled(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
@@ -120,7 +120,7 @@
     return false;
 }
 
-bool getRawCookies(NetworkingContext* context, const KURL& url, Vector<Cookie>& rawCookies)
+bool getRawCookies(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url, Vector<Cookie>& rawCookies)
 {
     rawCookies.clear();
     BEGIN_BLOCK_OBJC_EXCEPTIONS;

Modified: trunk/Source/WebCore/platform/network/qt/CookieJarQt.cpp (134935 => 134936)


--- trunk/Source/WebCore/platform/network/qt/CookieJarQt.cpp	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/platform/network/qt/CookieJarQt.cpp	2012-11-16 13:35:47 UTC (rev 134936)
@@ -94,7 +94,7 @@
     return resultCookies.join(QLatin1String("; "));
 }
 
-String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL &url)
+String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url)
 {
     QNetworkCookieJar* jar = context ? context->networkAccessManager()->cookieJar() : SharedCookieJarQt::shared();
     if (!jar)
@@ -111,13 +111,13 @@
     return resultCookies.join(QLatin1String("; "));
 }
 
-bool cookiesEnabled(NetworkingContext* context)
+bool cookiesEnabled(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/)
 {
     QNetworkCookieJar* jar = context ? context->networkAccessManager()->cookieJar() : SharedCookieJarQt::shared();
     return !!jar;
 }
 
-bool getRawCookies(NetworkingContext*, const KURL&, Vector<Cookie>& rawCookies)
+bool getRawCookies(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/, Vector<Cookie>& rawCookies)
 {
     // FIXME: Not yet implemented
     rawCookies.clear();

Modified: trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp (134935 => 134936)


--- trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp	2012-11-16 13:35:47 UTC (rev 134936)
@@ -123,17 +123,17 @@
     return cookiesForContext(context, url, false);
 }
 
-String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& url)
+String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url)
 {
     return cookiesForContext(context, url, true);
 }
 
-bool cookiesEnabled(NetworkingContext* context)
+bool cookiesEnabled(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/)
 {
     return !!cookieJarForContext(context);
 }
 
-bool getRawCookies(NetworkingContext* context, const KURL& url, Vector<Cookie>& rawCookies)
+bool getRawCookies(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url, Vector<Cookie>& rawCookies)
 {
     rawCookies.clear();
     SoupCookieJar* jar = context ? cookieJarForContext(context) : soupCookieJar();

Modified: trunk/Source/WebCore/platform/network/win/CookieJarWin.cpp (134935 => 134936)


--- trunk/Source/WebCore/platform/network/win/CookieJarWin.cpp	2012-11-16 13:32:18 UTC (rev 134935)
+++ trunk/Source/WebCore/platform/network/win/CookieJarWin.cpp	2012-11-16 13:35:47 UTC (rev 134936)
@@ -64,18 +64,18 @@
     return String::adopt(buffer);
 }
 
-String cookieRequestHeaderFieldValue(NetworkingContext*, const KURL& url)
+String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& url)
 {
     // FIXME: include HttpOnly cookie
     return cookiesForDOM(context, url);
 }
 
-bool cookiesEnabled(NetworkingContext*)
+bool cookiesEnabled(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/)
 {
     return true;
 }
 
-bool getRawCookies(NetworkingContext*, const KURL&, Vector<Cookie>& rawCookies)
+bool getRawCookies(NetworkingContext* context, const KURL& /*firstParty*/, const KURL& /*url*/, Vector<Cookie>& rawCookies)
 {
     // FIXME: Not yet implemented
     rawCookies.clear();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to