[WK2] Forward cookie jar calls to NetworkProcess
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2012 02:32:51 +0000 (02:32 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2012 02:32:51 +0000 (02:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=103457

Reviewed by Darin Adler.

Source/WebCore:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
PlatformCookieJar.h functions are now used in WebKit2.

* loader/CookieJar.cpp:
(WebCore::cookies):
(WebCore::setCookies):
(WebCore::cookiesEnabled):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
(WebCore::getHostnamesWithCookies):
(WebCore::deleteCookiesForHostname):
(WebCore::deleteAllCookies):
Use a strategy instead of going to PlatformCookieJar directly.

* platform/Cookie.h: (Cookie): Added a default constructor, so that Cookie could be
sent over IPC.

* platform/CookiesStrategy.h: Added functions for cookie jar.

Source/WebKit/efl:

* WebCoreSupport/PlatformStrategiesEfl.cpp:
(PlatformStrategiesEfl::cookiesForDOM):
(PlatformStrategiesEfl::setCookiesFromDOM):
(PlatformStrategiesEfl::cookiesEnabled):
(PlatformStrategiesEfl::cookieRequestHeaderFieldValue):
(PlatformStrategiesEfl::getRawCookies):
(PlatformStrategiesEfl::deleteCookie):
(PlatformStrategiesEfl::getHostnamesWithCookies):
(PlatformStrategiesEfl::deleteCookiesForHostname):
(PlatformStrategiesEfl::deleteAllCookies):

Source/WebKit/gtk:

* WebCoreSupport/PlatformStrategiesGtk.cpp:
(PlatformStrategiesGtk::cookiesForDOM):
(PlatformStrategiesGtk::setCookiesFromDOM):
(PlatformStrategiesGtk::cookiesEnabled):
(PlatformStrategiesGtk::cookieRequestHeaderFieldValue):
(PlatformStrategiesGtk::getRawCookies):
(PlatformStrategiesGtk::deleteCookie):
(PlatformStrategiesGtk::getHostnamesWithCookies):
(PlatformStrategiesGtk::deleteCookiesForHostname):
(PlatformStrategiesGtk::deleteAllCookies):

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookiesEnabled):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):
(WebPlatformStrategies::deleteCookie):
(WebPlatformStrategies::getHostnamesWithCookies):
(WebPlatformStrategies::deleteCookiesForHostname):
(WebPlatformStrategies::deleteAllCookies):
(WebPlatformStrategies::getPluginInfo):
(WebPlatformStrategies::bufferForType):
WebKit1 strategy just uses PlatformCookieJar.

Source/WebKit/qt:

* WebCoreSupport/PlatformStrategiesQt.cpp:
(PlatformStrategiesQt::cookiesForDOM):
(PlatformStrategiesQt::setCookiesFromDOM):
(PlatformStrategiesQt::cookiesEnabled):
(PlatformStrategiesQt::cookieRequestHeaderFieldValue):
(PlatformStrategiesQt::getRawCookies):
(PlatformStrategiesQt::deleteCookie):
(PlatformStrategiesQt::getHostnamesWithCookies):
(PlatformStrategiesQt::deleteCookiesForHostname):
(PlatformStrategiesQt::deleteAllCookies):

Source/WebKit/win:

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookiesEnabled):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):
(WebPlatformStrategies::deleteCookie):
(WebPlatformStrategies::getHostnamesWithCookies):
(WebPlatformStrategies::deleteCookiesForHostname):
(WebPlatformStrategies::deleteAllCookies):

Source/WebKit/wince:

* WebCoreSupport/PlatformStrategiesWinCE.cpp:
(PlatformStrategiesWinCE::cookiesForDOM):
(PlatformStrategiesWinCE::setCookiesFromDOM):
(PlatformStrategiesWinCE::cookiesEnabled):
(PlatformStrategiesWinCE::cookieRequestHeaderFieldValue):
(PlatformStrategiesWinCE::getRawCookies):
(PlatformStrategiesWinCE::deleteCookie):
(PlatformStrategiesWinCE::getHostnamesWithCookies):
(PlatformStrategiesWinCE::deleteCookiesForHostname):
(PlatformStrategiesWinCE::deleteAllCookies):

Source/WebKit2:

* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
Added messages to maniputate CookieJar in network process.

* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp: Removed unnecessary WebCore:: prefixes,
this file has a using direcive.
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):
(WebKit::NetworkConnectionToWebProcess::getHostnamesWithCookies):
(WebKit::NetworkConnectionToWebProcess::deleteCookiesForHostname):
(WebKit::NetworkConnectionToWebProcess::deleteAllCookies):
Added implementations that use PlatformCookieJar in the network process.

* Scripts/webkit2/messages.py: (struct_or_class):
* Shared/WebCoreArgumentCoders.h:
* Shared/WebCoreArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):
Added support for Cookie.

* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookiesEnabled):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
(WebKit::WebPlatformStrategies::deleteCookie):
(WebKit::WebPlatformStrategies::getHostnamesWithCookies):
(WebKit::WebPlatformStrategies::deleteCookiesForHostname):
(WebKit::WebPlatformStrategies::deleteAllCookies):
When using the network process, forward cookie calls to it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136197 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/CookieJar.cpp
Source/WebCore/platform/Cookie.h
Source/WebCore/platform/CookiesStrategy.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp
Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.cpp
Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp
Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit2/Scripts/webkit2/messages.py
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
Source/WebKit2/Shared/WebCoreArgumentCoders.h
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

index 1a66e44..4af4f82 100644 (file)
@@ -1,3 +1,31 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+        PlatformCookieJar.h functions are now used in WebKit2.
+
+        * loader/CookieJar.cpp:
+        (WebCore::cookies):
+        (WebCore::setCookies):
+        (WebCore::cookiesEnabled):
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::getRawCookies):
+        (WebCore::deleteCookie):
+        (WebCore::getHostnamesWithCookies):
+        (WebCore::deleteCookiesForHostname):
+        (WebCore::deleteAllCookies):
+        Use a strategy instead of going to PlatformCookieJar directly.
+
+        * platform/Cookie.h: (Cookie): Added a default constructor, so that Cookie could be
+        sent over IPC.
+
+        * platform/CookiesStrategy.h: Added functions for cookie jar.
+
 2012-11-29  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r136167.
index af91d3d..abbe0fd 100644 (file)
@@ -206,6 +206,7 @@ __ZN7WebCore12TextIteratorD1Ev
 __ZN7WebCore12cacheStorageEv
 __ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsEPNS5_INS_13QualifiedNameELm0EEE
 __ZN7WebCore12createMarkupEPKNS_5RangeEPN3WTF6VectorIPNS_4NodeELm0EEENS_23EAnnotateForInterchangeEbNS_13EAbsoluteURLsE
+__ZN7WebCore12deleteCookieEPNS_17NetworkingContextERKNS_4KURLERKN3WTF6StringE
 __ZN7WebCore12gcControllerEv
 __ZN7WebCore12iconDatabaseEv
 __ZN7WebCore13AXObjectCache10rootObjectEv
@@ -231,8 +232,10 @@ __ZN7WebCore13ResourceErrorC1EP7NSError
 __ZN7WebCore13ResourceErrorC1EP9__CFError
 __ZN7WebCore13StyledElement22setInlineStylePropertyENS_13CSSPropertyIDERKN3WTF6StringEb
 __ZN7WebCore13StyledElement22setInlineStylePropertyENS_13CSSPropertyIDEdNS_17CSSPrimitiveValue9UnitTypesEb
+__ZN7WebCore13cookiesForDOMEPNS_17NetworkingContextERKNS_4KURLES4_
 __ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE
 __ZN7WebCore13directoryNameERKN3WTF6StringE
+__ZN7WebCore13getRawCookiesEPNS_17NetworkingContextERKNS_4KURLES4_RN3WTF6VectorINS_6CookieELm0EEE
 __ZN7WebCore13toArrayBufferEN3JSC7JSValueE
 __ZN7WebCore13toHTMLElementEPNS_21FormAssociatedElementE
 __ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
@@ -279,6 +282,7 @@ __ZN7WebCore14FrameSelection9selectAllEv
 __ZN7WebCore14FrameSelectionC1EPNS_5FrameE
 __ZN7WebCore14LoaderStrategy21resourceLoadSchedulerEv
 __ZN7WebCore14PluginDocument10pluginNodeEv
+__ZN7WebCore14cookiesEnabledEPNS_17NetworkingContextERKNS_4KURLES4_
 __ZNK7WebCore5Frame25trackedRepaintRectsAsTextEv
 __ZN7WebCore9FrameView17setTracksRepaintsEb
 __ZN7WebCore9FrameView20resetTrackedRepaintsEv
@@ -480,6 +484,7 @@ __ZN7WebCore16VisibleSelectionC1ERKNS_15VisiblePositionES3_b
 __ZN7WebCore16VisibleSelectionC1ERKNS_15VisiblePositionEb
 __ZN7WebCore16createFullMarkupEPKNS_4NodeE
 __ZN7WebCore16createFullMarkupEPKNS_5RangeE
+__ZN7WebCore16deleteAllCookiesEPNS_17NetworkingContextE
 __ZN7WebCore16deleteAllCookiesEv
 __ZN7WebCore16enclosingIntRectERKNS_9FloatRectE
 __ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
@@ -503,6 +508,7 @@ __ZN7WebCore17SubresourceLoader6createEPNS_5FrameEPNS_14CachedResourceERKNS_15Re
 __ZN7WebCore17ViewportArguments19deprecatedTargetDPIE
 __ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE
 __ZN7WebCore17openTemporaryFileERKN3WTF6StringERi
+__ZN7WebCore17setCookiesFromDOMEPNS_17NetworkingContextERKNS_4KURLES4_RKN3WTF6StringE
 __ZN7WebCore17userVisibleStringEP5NSURL
 __ZN7WebCore18DOMWindowExtensionC1EPNS_5FrameEPNS_15DOMWrapperWorldE
 __ZN7WebCore18HTMLContentElement6createEPNS_8DocumentE
@@ -642,6 +648,7 @@ __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0
 __ZN7WebCore23dataForURLComponentTypeEP5NSURLl
 __ZN7WebCore23decodeHostNameWithRangeEP8NSString8_NSRange
 __ZN7WebCore23encodeHostNameWithRangeEP8NSString8_NSRange
+__ZN7WebCore23getHostnamesWithCookiesEPNS_17NetworkingContextERN3WTF7HashSetINS2_6StringENS2_10StringHashENS2_10HashTraitsIS4_EEEE
 __ZN7WebCore23getHostnamesWithCookiesERN3WTF7HashSetINS0_6StringENS0_10StringHashENS0_10HashTraitsIS2_EEEE
 __ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
 __ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE
@@ -661,6 +668,7 @@ __ZN7WebCore24FrameDestructionObserverC2EPNS_5FrameE
 __ZN7WebCore24FrameDestructionObserverD2Ev
 __ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKN3WTF6StringES5_NS_27FragmentScriptingPermissionE
 __ZN7WebCore24decodeURLEscapeSequencesERKN3WTF6StringE
+__ZN7WebCore24deleteCookiesForHostnameEPNS_17NetworkingContextERKN3WTF6StringE
 __ZN7WebCore24deleteCookiesForHostnameERKN3WTF6StringE
 __ZN7WebCore24fileSystemRepresentationERKN3WTF6StringE
 __ZN7WebCore24notifyHistoryItemChangedE
@@ -690,6 +698,7 @@ __ZN7WebCore27startObservingCookieChangesEv
 __ZN7WebCore26defaultCFHTTPCookieStorageEv
 __ZN7WebCore28encodeWithURLEscapeSequencesERKN3WTF6StringE
 __ZN7WebCore28removeLanguageChangeObserverEPv
+__ZN7WebCore29cookieRequestHeaderFieldValueEPNS_17NetworkingContextERKNS_4KURLES4_
 __ZN7WebCore29isCharacterSmartReplaceExemptEib
 __ZN7WebCore30hostNameNeedsDecodingWithRangeEP8NSString8_NSRange
 __ZN7WebCore30hostNameNeedsEncodingWithRangeEP8NSString8_NSRange
index 842788a..03146c8 100644 (file)
                E139866315478474001E3F65 /* StyleResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E139866115478474001E3F65 /* StyleResolver.cpp */; };
                E139866415478474001E3F65 /* StyleResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E139866215478474001E3F65 /* StyleResolver.h */; };
                E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */; };
-               E1424C8A164B3B4E00F32D40 /* PlatformCookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = E1424C89164B3B4E00F32D40 /* PlatformCookieJar.h */; };
+               E1424C8A164B3B4E00F32D40 /* PlatformCookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = E1424C89164B3B4E00F32D40 /* PlatformCookieJar.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E1424C90164B460B00F32D40 /* CookieJarMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1424C8F164B460B00F32D40 /* CookieJarMac.mm */; };
                E1424C93164B52C800F32D40 /* CookieJar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1424C91164B52C800F32D40 /* CookieJar.cpp */; };
                E1424C94164B52C800F32D40 /* CookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = E1424C92164B52C800F32D40 /* CookieJar.h */; settings = {ATTRIBUTES = (Private, ); }; };
index 80ff5fb..f4f3a7a 100644 (file)
 #include "Frame.h"
 #include "PlatformCookieJar.h"
 
+#if USE(PLATFORM_STRATEGIES)
+#include "CookiesStrategy.h"
+#include "PlatformStrategies.h"
+#endif
+
 #if PLATFORM(BLACKBERRY)
 #error Blackberry currently uses a fork of this file because of layering violations
 #endif
@@ -51,47 +56,83 @@ static NetworkingContext* networkingContext(const Document* document)
 
 String cookies(const Document* document, const KURL& url)
 {
+#if USE(PLATFORM_STRATEGIES)
+    return platformStrategies()->cookiesStrategy()->cookiesForDOM(networkingContext(document), document->firstPartyForCookies(), url);
+#else
     return cookiesForDOM(networkingContext(document), document->firstPartyForCookies(), url);
+#endif
 }
 
 void setCookies(Document* document, const KURL& url, const String& cookieString)
 {
+#if USE(PLATFORM_STRATEGIES)
+    platformStrategies()->cookiesStrategy()->setCookiesFromDOM(networkingContext(document), document->firstPartyForCookies(), url, cookieString);
+#else
     setCookiesFromDOM(networkingContext(document), document->firstPartyForCookies(), url, cookieString);
+#endif
 }
 
 bool cookiesEnabled(const Document* document)
 {
+#if USE(PLATFORM_STRATEGIES)
+    return platformStrategies()->cookiesStrategy()->cookiesEnabled(networkingContext(document), document->firstPartyForCookies(), document->cookieURL());
+#else
     return cookiesEnabled(networkingContext(document), document->firstPartyForCookies(), document->cookieURL());
+#endif
 }
 
 String cookieRequestHeaderFieldValue(const Document* document, const KURL& url)
 {
+#if USE(PLATFORM_STRATEGIES)
+    return platformStrategies()->cookiesStrategy()->cookieRequestHeaderFieldValue(networkingContext(document), document->firstPartyForCookies(), url);
+#else
     return cookieRequestHeaderFieldValue(networkingContext(document), document->firstPartyForCookies(), url);
+#endif
 }
 
 bool getRawCookies(const Document* document, const KURL& url, Vector<Cookie>& cookies)
 {
+#if USE(PLATFORM_STRATEGIES)
+    return platformStrategies()->cookiesStrategy()->getRawCookies(networkingContext(document), document->firstPartyForCookies(), url, cookies);
+#else
     return getRawCookies(networkingContext(document), document->firstPartyForCookies(), url, cookies);
+#endif
 }
 
 void deleteCookie(const Document* document, const KURL& url, const String& cookieName)
 {
+#if USE(PLATFORM_STRATEGIES)
+    platformStrategies()->cookiesStrategy()->deleteCookie(networkingContext(document), url, cookieName);
+#else
     deleteCookie(networkingContext(document), url, cookieName);
+#endif
 }
 
 void getHostnamesWithCookies(HashSet<String>& hostnames)
 {
+#if USE(PLATFORM_STRATEGIES)
+    platformStrategies()->cookiesStrategy()->getHostnamesWithCookies(0, hostnames);
+#else
     getHostnamesWithCookies(0, hostnames);
+#endif
 }
 
 void deleteCookiesForHostname(const String& hostname)
 {
+#if USE(PLATFORM_STRATEGIES)
+    platformStrategies()->cookiesStrategy()->deleteCookiesForHostname(0, hostname);
+#else
     deleteCookiesForHostname(0, hostname);
+#endif
 }
 
 void deleteAllCookies()
 {
+#if USE(PLATFORM_STRATEGIES)
+    platformStrategies()->cookiesStrategy()->deleteAllCookies(0);
+#else
     deleteAllCookies(0);
+#endif
 }
 
 }
index cf35342..27f670d 100644 (file)
@@ -35,6 +35,8 @@ namespace WebCore {
     // to the Web Inspector.
 
     struct Cookie {
+        Cookie() { }
+
         Cookie(const String& name, const String& value, const String& domain,
                 const String& path, double expires, bool httpOnly, bool secure,
                 bool session)
index 6028257..158d8b6 100644 (file)
 
 #if USE(PLATFORM_STRATEGIES)
 
+#include <wtf/HashSet.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
 
 #if PLATFORM(MAC) || USE(CFNETWORK)
 typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
@@ -36,6 +39,10 @@ typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
 
 namespace WebCore {
 
+class KURL;
+class NetworkingContext;
+struct Cookie;
+
 class CookiesStrategy {
 public:
     virtual void notifyCookiesChanged() = 0;
@@ -44,6 +51,16 @@ public:
     virtual RetainPtr<CFHTTPCookieStorageRef> defaultCookieStorage() = 0;
 #endif
 
+    virtual String cookiesForDOM(NetworkingContext*, const KURL& firstParty, const KURL&) = 0;
+    virtual void setCookiesFromDOM(NetworkingContext*, const KURL& firstParty, const KURL&, const String& cookieString) = 0;
+    virtual bool cookiesEnabled(NetworkingContext*, const KURL& firstParty, const KURL&) = 0;
+    virtual String cookieRequestHeaderFieldValue(NetworkingContext*, const KURL& firstParty, const KURL&) = 0;
+    virtual bool getRawCookies(NetworkingContext*, const KURL& firstParty, const KURL&, Vector<Cookie>&) = 0;
+    virtual void deleteCookie(NetworkingContext*, const KURL&, const String& cookieName) = 0;
+    virtual void getHostnamesWithCookies(NetworkingContext*, HashSet<String>& hostnames) = 0;
+    virtual void deleteCookiesForHostname(NetworkingContext*, const String& hostname) = 0;
+    virtual void deleteAllCookies(NetworkingContext*) = 0;
+
 protected:
     virtual ~CookiesStrategy() { }
 };
index 0310650..2eecf3e 100644 (file)
@@ -1,3 +1,21 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/PlatformStrategiesEfl.cpp:
+        (PlatformStrategiesEfl::cookiesForDOM):
+        (PlatformStrategiesEfl::setCookiesFromDOM):
+        (PlatformStrategiesEfl::cookiesEnabled):
+        (PlatformStrategiesEfl::cookieRequestHeaderFieldValue):
+        (PlatformStrategiesEfl::getRawCookies):
+        (PlatformStrategiesEfl::deleteCookie):
+        (PlatformStrategiesEfl::getHostnamesWithCookies):
+        (PlatformStrategiesEfl::deleteCookiesForHostname):
+        (PlatformStrategiesEfl::deleteAllCookies):
+
 2012-11-29  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Broken rendering occurs when scrolling in ewk_view_single.
index 7138aa8..ca19486 100644 (file)
@@ -29,6 +29,7 @@
 #include "NotImplemented.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include "PlatformCookieJar.h"
 #include "PluginDatabase.h"
 #include "PluginPackage.h"
 
@@ -80,6 +81,51 @@ void PlatformStrategiesEfl::notifyCookiesChanged()
 {
 }
 
+String PlatformStrategiesEfl::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesForDOM(context, firstParty, url);
+}
+
+void PlatformStrategiesEfl::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
+}
+
+bool PlatformStrategiesEfl::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesEnabled(context, firstParty, url);
+}
+
+String PlatformStrategiesEfl::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
+}
+
+bool PlatformStrategiesEfl::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
+}
+
+void PlatformStrategiesEfl::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
+{
+    WebCore::deleteCookie(context, url, cookieName);
+}
+
+void PlatformStrategiesEfl::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
+{
+    WebCore::getHostnamesWithCookies(context, hostnames);
+}
+
+void PlatformStrategiesEfl::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
+{
+    WebCore::deleteCookiesForHostname(context, hostname);
+}
+
+void PlatformStrategiesEfl::deleteAllCookies(NetworkingContext* context)
+{
+    WebCore::deleteAllCookies(context);
+}
+
 void PlatformStrategiesEfl::refreshPlugins()
 {
 #if ENABLE(NETSCAPE_PLUGIN_API)
index 01e6115..baa7d05 100644 (file)
@@ -45,6 +45,15 @@ private:
 
     // WebCore::CookiesStrategy
     virtual void notifyCookiesChanged();
+    virtual String cookiesForDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual void setCookiesFromDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+    virtual bool cookiesEnabled(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual String cookieRequestHeaderFieldValue(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual bool getRawCookies(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+    virtual void deleteCookie(WebCore::NetworkingContext*, const WebCore::KURL&, const String&);
+    virtual void getHostnamesWithCookies(WebCore::NetworkingContext*, HashSet<String>& hostnames);
+    virtual void deleteCookiesForHostname(WebCore::NetworkingContext*, const String& hostname);
+    virtual void deleteAllCookies(WebCore::NetworkingContext*);
 
     // WebCore::PluginStrategy
     virtual void refreshPlugins();
index e56a9f5..9a8c0f2 100644 (file)
@@ -1,3 +1,21 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/PlatformStrategiesGtk.cpp:
+        (PlatformStrategiesGtk::cookiesForDOM):
+        (PlatformStrategiesGtk::setCookiesFromDOM):
+        (PlatformStrategiesGtk::cookiesEnabled):
+        (PlatformStrategiesGtk::cookieRequestHeaderFieldValue):
+        (PlatformStrategiesGtk::getRawCookies):
+        (PlatformStrategiesGtk::deleteCookie):
+        (PlatformStrategiesGtk::getHostnamesWithCookies):
+        (PlatformStrategiesGtk::deleteCookiesForHostname):
+        (PlatformStrategiesGtk::deleteAllCookies):
+
 2012-11-27  James Simonsen  <simonjam@chromium.org>
 
         Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
index 00a7062..8661300 100644 (file)
@@ -22,6 +22,7 @@
 #include "NotImplemented.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include "PlatformCookieJar.h"
 #include "PluginDatabase.h"
 #include "PluginPackage.h"
 
@@ -74,6 +75,51 @@ void PlatformStrategiesGtk::notifyCookiesChanged()
 {
 }
 
+String PlatformStrategiesGtk::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesForDOM(context, firstParty, url);
+}
+
+void PlatformStrategiesGtk::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
+}
+
+bool PlatformStrategiesGtk::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesEnabled(context, firstParty, url);
+}
+
+String PlatformStrategiesGtk::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
+}
+
+bool PlatformStrategiesGtk::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
+}
+
+void PlatformStrategiesGtk::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
+{
+    WebCore::deleteCookie(context, url, cookieName);
+}
+
+void PlatformStrategiesGtk::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
+{
+    WebCore::getHostnamesWithCookies(context, hostnames);
+}
+
+void PlatformStrategiesGtk::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
+{
+    WebCore::deleteCookiesForHostname(context, hostname);
+}
+
+void PlatformStrategiesGtk::deleteAllCookies(NetworkingContext* context)
+{
+    WebCore::deleteAllCookies(context);
+}
+
 // PluginStrategy
 void PlatformStrategiesGtk::refreshPlugins()
 {
index cf34ae2..c4536f1 100644 (file)
@@ -44,6 +44,15 @@ private:
 
     // WebCore::CookiesStrategy
     virtual void notifyCookiesChanged();
+    virtual String cookiesForDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual void setCookiesFromDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+    virtual bool cookiesEnabled(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual String cookieRequestHeaderFieldValue(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual bool getRawCookies(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+    virtual void deleteCookie(WebCore::NetworkingContext*, const WebCore::KURL&, const String&);
+    virtual void getHostnamesWithCookies(WebCore::NetworkingContext*, HashSet<String>& hostnames);
+    virtual void deleteCookiesForHostname(WebCore::NetworkingContext*, const String& hostname);
+    virtual void deleteAllCookies(WebCore::NetworkingContext*);
 
     // WebCore::PluginStrategy
     virtual void refreshPlugins();
index 50e12ae..a0d12e4 100644 (file)
@@ -1,3 +1,26 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebPlatformStrategies.h:
+        (WebPlatformStrategies):
+        * WebCoreSupport/WebPlatformStrategies.mm:
+        (WebPlatformStrategies::cookiesForDOM):
+        (WebPlatformStrategies::setCookiesFromDOM):
+        (WebPlatformStrategies::cookiesEnabled):
+        (WebPlatformStrategies::cookieRequestHeaderFieldValue):
+        (WebPlatformStrategies::getRawCookies):
+        (WebPlatformStrategies::deleteCookie):
+        (WebPlatformStrategies::getHostnamesWithCookies):
+        (WebPlatformStrategies::deleteCookiesForHostname):
+        (WebPlatformStrategies::deleteAllCookies):
+        (WebPlatformStrategies::getPluginInfo):
+        (WebPlatformStrategies::bufferForType):
+        WebKit1 strategy just uses PlatformCookieJar.
+
 2012-11-28  Beth Dakin  <bdakin@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=102970
index f9d8c77..9c5f511 100644 (file)
@@ -52,6 +52,15 @@ private:
     // WebCore::CookiesStrategy
     virtual void notifyCookiesChanged() OVERRIDE;
     virtual RetainPtr<CFHTTPCookieStorageRef> defaultCookieStorage() OVERRIDE;
+    virtual String cookiesForDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&) OVERRIDE;
+    virtual void setCookiesFromDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&) OVERRIDE;
+    virtual bool cookiesEnabled(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&) OVERRIDE;
+    virtual String cookieRequestHeaderFieldValue(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&) OVERRIDE;
+    virtual bool getRawCookies(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&) OVERRIDE;
+    virtual void deleteCookie(WebCore::NetworkingContext*, const WebCore::KURL&, const String&) OVERRIDE;
+    virtual void getHostnamesWithCookies(WebCore::NetworkingContext*, HashSet<String>& hostnames) OVERRIDE;
+    virtual void deleteCookiesForHostname(WebCore::NetworkingContext*, const String& hostname) OVERRIDE;
+    virtual void deleteAllCookies(WebCore::NetworkingContext*) OVERRIDE;
 
     // WebCore::PluginStrategy
     virtual void refreshPlugins() OVERRIDE;
index c79b089..1591718 100644 (file)
@@ -32,6 +32,7 @@
 #import <WebCore/Color.h>
 #import <WebCore/Page.h>
 #import <WebCore/PageGroup.h>
+#import <WebCore/PlatformCookieJar.h>
 #import <WebCore/PlatformPasteboard.h>
 #import <WebKitSystemInterface.h>
 
@@ -94,12 +95,57 @@ RetainPtr<CFHTTPCookieStorageRef> WebPlatformStrategies::defaultCookieStorage()
 #endif
 }
 
+String WebPlatformStrategies::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesForDOM(context, firstParty, url);
+}
+
+void WebPlatformStrategies::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
+}
+
+bool WebPlatformStrategies::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesEnabled(context, firstParty, url);
+}
+
+String WebPlatformStrategies::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
+}
+
+bool WebPlatformStrategies::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
+}
+
+void WebPlatformStrategies::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
+{
+    WebCore::deleteCookie(context, url, cookieName);
+}
+
+void WebPlatformStrategies::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
+{
+    WebCore::getHostnamesWithCookies(context, hostnames);
+}
+
+void WebPlatformStrategies::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
+{
+    WebCore::deleteCookiesForHostname(context, hostname);
+}
+
+void WebPlatformStrategies::deleteAllCookies(NetworkingContext* context)
+{
+    WebCore::deleteAllCookies(context);
+}
+
 void WebPlatformStrategies::refreshPlugins()
 {
     [[WebPluginDatabase sharedDatabase] refresh];
 }
 
-void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>& plugins)
+void WebPlatformStrategies::getPluginInfo(const Page*, Vector<PluginInfo>& plugins)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
@@ -128,7 +174,7 @@ void WebPlatformStrategies::getTypes(Vector<String>& types, const String& pasteb
     PlatformPasteboard(pasteboardName).getTypes(types);
 }
 
-PassRefPtr<WebCore::SharedBuffer> WebPlatformStrategies::bufferForType(const String& pasteboardType, const String& pasteboardName)
+PassRefPtr<SharedBuffer> WebPlatformStrategies::bufferForType(const String& pasteboardType, const String& pasteboardName)
 {
     return PlatformPasteboard(pasteboardName).bufferForType(pasteboardType);
 }
index 7ec8fbc..1df626e 100644 (file)
@@ -1,3 +1,21 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/PlatformStrategiesQt.cpp:
+        (PlatformStrategiesQt::cookiesForDOM):
+        (PlatformStrategiesQt::setCookiesFromDOM):
+        (PlatformStrategiesQt::cookiesEnabled):
+        (PlatformStrategiesQt::cookieRequestHeaderFieldValue):
+        (PlatformStrategiesQt::getRawCookies):
+        (PlatformStrategiesQt::deleteCookie):
+        (PlatformStrategiesQt::getHostnamesWithCookies):
+        (PlatformStrategiesQt::deleteCookiesForHostname):
+        (PlatformStrategiesQt::deleteAllCookies):
+
 2012-11-28  Huang Dongsung  <luxtella@company100.net>
 
         [Texmap] REGRESSION(r135620) QtTestBrowser crashes on Google-gravity.
index 5d9e755..07e8460 100644 (file)
@@ -40,6 +40,7 @@
 #include <NotImplemented.h>
 #include <Page.h>
 #include <PageGroup.h>
+#include <PlatformCookieJar.h>
 #include <PluginDatabase.h>
 #include <QCoreApplication>
 #include <QLocale>
@@ -93,6 +94,51 @@ void PlatformStrategiesQt::notifyCookiesChanged()
 {
 }
 
+String PlatformStrategiesQt::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesForDOM(context, firstParty, url);
+}
+
+void PlatformStrategiesQt::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
+}
+
+bool PlatformStrategiesQt::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesEnabled(context, firstParty, url);
+}
+
+String PlatformStrategiesQt::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
+}
+
+bool PlatformStrategiesQt::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
+}
+
+void PlatformStrategiesQt::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
+{
+    WebCore::deleteCookie(context, url, cookieName);
+}
+
+void PlatformStrategiesQt::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
+{
+    WebCore::getHostnamesWithCookies(context, hostnames);
+}
+
+void PlatformStrategiesQt::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
+{
+    WebCore::deleteCookiesForHostname(context, hostname);
+}
+
+void PlatformStrategiesQt::deleteAllCookies(NetworkingContext* context)
+{
+    WebCore::deleteAllCookies(context);
+}
+
 void PlatformStrategiesQt::refreshPlugins()
 {
     PluginDatabase::installedPlugins()->refresh();
index 2fe8fe6..7ba16cf 100644 (file)
@@ -56,6 +56,15 @@ private:
     
     // WebCore::CookiesStrategy
     virtual void notifyCookiesChanged();
+    virtual String cookiesForDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual void setCookiesFromDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+    virtual bool cookiesEnabled(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual String cookieRequestHeaderFieldValue(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual bool getRawCookies(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+    virtual void deleteCookie(WebCore::NetworkingContext*, const WebCore::KURL&, const String&);
+    virtual void getHostnamesWithCookies(WebCore::NetworkingContext*, HashSet<String>& hostnames);
+    virtual void deleteCookiesForHostname(WebCore::NetworkingContext*, const String& hostname);
+    virtual void deleteAllCookies(WebCore::NetworkingContext*);
 
     // WebCore::PluginStrategy
     virtual void refreshPlugins();
index 74d351c..31bed5f 100644 (file)
@@ -1,3 +1,21 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebPlatformStrategies::cookiesForDOM):
+        (WebPlatformStrategies::setCookiesFromDOM):
+        (WebPlatformStrategies::cookiesEnabled):
+        (WebPlatformStrategies::cookieRequestHeaderFieldValue):
+        (WebPlatformStrategies::getRawCookies):
+        (WebPlatformStrategies::deleteCookie):
+        (WebPlatformStrategies::getHostnamesWithCookies):
+        (WebPlatformStrategies::deleteCookiesForHostname):
+        (WebPlatformStrategies::deleteAllCookies):
+
 2012-11-27  James Simonsen  <simonjam@chromium.org>
 
         Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
index 75a03e2..c3d69da 100644 (file)
@@ -29,6 +29,7 @@
 #include "WebFrameNetworkingContext.h"
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
+#include <WebCore/PlatformCookieJar.h>
 #include <WebCore/PluginDatabase.h>
 #if USE(CFNETWORK)
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
@@ -90,6 +91,51 @@ RetainPtr<CFHTTPCookieStorageRef> WebPlatformStrategies::defaultCookieStorage()
 }
 #endif
 
+String WebPlatformStrategies::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesForDOM(context, firstParty, url);
+}
+
+void WebPlatformStrategies::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
+}
+
+bool WebPlatformStrategies::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesEnabled(context, firstParty, url);
+}
+
+String WebPlatformStrategies::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
+}
+
+bool WebPlatformStrategies::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
+}
+
+void WebPlatformStrategies::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
+{
+    WebCore::deleteCookie(context, url, cookieName);
+}
+
+void WebPlatformStrategies::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
+{
+    WebCore::getHostnamesWithCookies(context, hostnames);
+}
+
+void WebPlatformStrategies::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
+{
+    WebCore::deleteCookiesForHostname(context, hostname);
+}
+
+void WebPlatformStrategies::deleteAllCookies(NetworkingContext* context)
+{
+    WebCore::deleteAllCookies(context);
+}
+
 void WebPlatformStrategies::refreshPlugins()
 {
     PluginDatabase::installedPlugins()->refresh();
index 9777b84..c2eb6ef 100644 (file)
@@ -53,6 +53,15 @@ private:
 #if USE(CFNETWORK)
     virtual RetainPtr<CFHTTPCookieStorageRef> defaultCookieStorage();
 #endif
+    virtual String cookiesForDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual void setCookiesFromDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+    virtual bool cookiesEnabled(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual String cookieRequestHeaderFieldValue(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual bool getRawCookies(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+    virtual void deleteCookie(WebCore::NetworkingContext*, const WebCore::KURL&, const String&);
+    virtual void getHostnamesWithCookies(WebCore::NetworkingContext*, HashSet<String>& hostnames);
+    virtual void deleteCookiesForHostname(WebCore::NetworkingContext*, const String& hostname);
+    virtual void deleteAllCookies(WebCore::NetworkingContext*);
 
     // WebCore::PluginStrategy
     virtual void refreshPlugins();
index d46a654..cabdd95 100644 (file)
@@ -1,3 +1,21 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/PlatformStrategiesWinCE.cpp:
+        (PlatformStrategiesWinCE::cookiesForDOM):
+        (PlatformStrategiesWinCE::setCookiesFromDOM):
+        (PlatformStrategiesWinCE::cookiesEnabled):
+        (PlatformStrategiesWinCE::cookieRequestHeaderFieldValue):
+        (PlatformStrategiesWinCE::getRawCookies):
+        (PlatformStrategiesWinCE::deleteCookie):
+        (PlatformStrategiesWinCE::getHostnamesWithCookies):
+        (PlatformStrategiesWinCE::deleteCookiesForHostname):
+        (PlatformStrategiesWinCE::deleteAllCookies):
+
 2012-11-27  James Simonsen  <simonjam@chromium.org>
 
         Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
index 425b0f3..51eda76 100644 (file)
@@ -29,6 +29,7 @@
 #include "IntSize.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include "PlatformCookieJar.h"
 #include "PluginDatabase.h"
 
 using namespace WebCore;
@@ -77,6 +78,51 @@ void PlatformStrategiesWinCE::notifyCookiesChanged()
 {
 }
 
+String PlatformStrategiesWinCE::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesForDOM(context, firstParty, url);
+}
+
+void PlatformStrategiesWinCE::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
+}
+
+bool PlatformStrategiesWinCE::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesEnabled(context, firstParty, url);
+}
+
+String PlatformStrategiesWinCE::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
+}
+
+bool PlatformStrategiesWinCE::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
+}
+
+void PlatformStrategiesWinCE::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
+{
+    WebCore::deleteCookie(context, url, cookieName);
+}
+
+void PlatformStrategiesWinCE::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
+{
+    WebCore::getHostnamesWithCookies(context, hostnames);
+}
+
+void PlatformStrategiesWinCE::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
+{
+    WebCore::deleteCookiesForHostname(context, hostname);
+}
+
+void PlatformStrategiesWinCE::deleteAllCookies(NetworkingContext* context)
+{
+    WebCore::deleteAllCookies(context);
+}
+
 void PlatformStrategiesWinCE::refreshPlugins()
 {
     PluginDatabase::installedPlugins()->refresh();
index 2ce4820..306e569 100644 (file)
@@ -49,6 +49,15 @@ private:
 
     // WebCore::CookiesStrategy
     virtual void notifyCookiesChanged();
+    virtual String cookiesForDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual void setCookiesFromDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+    virtual bool cookiesEnabled(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual String cookieRequestHeaderFieldValue(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual bool getRawCookies(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+    virtual void deleteCookie(WebCore::NetworkingContext*, const WebCore::KURL&, const String&);
+    virtual void getHostnamesWithCookies(WebCore::NetworkingContext*, HashSet<String>& hostnames);
+    virtual void deleteCookiesForHostname(WebCore::NetworkingContext*, const String& hostname);
+    virtual void deleteAllCookies(WebCore::NetworkingContext*);
 
     // WebCore::PluginStrategy
     virtual void refreshPlugins();
index 27cc82a..486a1f5 100644 (file)
@@ -1,3 +1,47 @@
+2012-11-29  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Forward cookie jar calls to NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=103457
+
+        Reviewed by Darin Adler.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        Added messages to maniputate CookieJar in network process.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp: Removed unnecessary WebCore:: prefixes,
+        this file has a using direcive.
+        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
+        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
+        (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
+        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
+        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
+        (WebKit::NetworkConnectionToWebProcess::deleteCookie):
+        (WebKit::NetworkConnectionToWebProcess::getHostnamesWithCookies):
+        (WebKit::NetworkConnectionToWebProcess::deleteCookiesForHostname):
+        (WebKit::NetworkConnectionToWebProcess::deleteAllCookies):
+        Added implementations that use PlatformCookieJar in the network process.
+
+        * Scripts/webkit2/messages.py: (struct_or_class):
+        * Shared/WebCoreArgumentCoders.h:
+        * Shared/WebCoreArgumentCoders.cpp:
+        (CoreIPC::::encode):
+        (CoreIPC::::decode):
+        Added support for Cookie.
+        
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::cookiesForDOM):
+        (WebKit::WebPlatformStrategies::setCookiesFromDOM):
+        (WebKit::WebPlatformStrategies::cookiesEnabled):
+        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
+        (WebKit::WebPlatformStrategies::getRawCookies):
+        (WebKit::WebPlatformStrategies::deleteCookie):
+        (WebKit::WebPlatformStrategies::getHostnamesWithCookies):
+        (WebKit::WebPlatformStrategies::deleteCookiesForHostname):
+        (WebKit::WebPlatformStrategies::deleteAllCookies):
+        When using the network process, forward cookie calls to it.
+
 2012-11-29  Kiran Muppala  <cmuppala@apple.com>
 
         Instantiate snapshot plugins in a PluginProcess with muted audio
index 50ce734..f071651 100644 (file)
@@ -29,6 +29,8 @@
 #include "ConnectionStack.h"
 #include "NetworkProcess.h"
 #include "NetworkResourceLoader.h"
+#include "RemoteNetworkingContext.h"
+#include <WebCore/PlatformCookieJar.h>
 #include <WebCore/ResourceLoaderOptions.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/RunLoop.h>
@@ -122,7 +124,7 @@ void NetworkConnectionToWebProcess::scheduleResourceLoad(const NetworkResourceLo
     resourceLoadIdentifier = NetworkProcess::shared().networkResourceLoadScheduler().scheduleResourceLoad(loadParameters, this);
 }
 
-void NetworkConnectionToWebProcess::addLoadInProgress(const WebCore::KURL& url, ResourceLoadIdentifier& identifier)
+void NetworkConnectionToWebProcess::addLoadInProgress(const KURL& url, ResourceLoadIdentifier& identifier)
 {
     identifier = NetworkProcess::shared().networkResourceLoadScheduler().addLoadInProgress(url);
 }
@@ -152,6 +154,62 @@ void NetworkConnectionToWebProcess::setSerialLoadingEnabled(bool enabled)
     m_serialLoadingEnabled = enabled;
 }
 
+void NetworkConnectionToWebProcess::cookiesForDOM(const KURL& firstParty, const KURL& url, String& result)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    result = WebCore::cookiesForDOM(RemoteNetworkingContext::create(false, false).get(), firstParty, url);
+}
+
+void NetworkConnectionToWebProcess::setCookiesFromDOM(const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    WebCore::setCookiesFromDOM(RemoteNetworkingContext::create(false, false).get(), firstParty, url, cookieString);
+}
+
+void NetworkConnectionToWebProcess::cookiesEnabled(const KURL& firstParty, const KURL& url, bool& result)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    result = WebCore::cookiesEnabled(RemoteNetworkingContext::create(false, false).get(), firstParty, url);
+}
+
+void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(const KURL& firstParty, const KURL& url, String& result)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    result = WebCore::cookieRequestHeaderFieldValue(0, firstParty, url);
+}
+
+void NetworkConnectionToWebProcess::getRawCookies(const KURL& firstParty, const KURL& url, Vector<Cookie>& result)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    WebCore::getRawCookies(RemoteNetworkingContext::create(false, false).get(), firstParty, url, result);
+}
+
+void NetworkConnectionToWebProcess::deleteCookie(const KURL& url, const String& cookieName)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    WebCore::deleteCookie(RemoteNetworkingContext::create(false, false).get(), url, cookieName);
+}
+
+void NetworkConnectionToWebProcess::getHostnamesWithCookies(Vector<String>& hostnames)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    HashSet<String> hostnamesSet;
+    WebCore::getHostnamesWithCookies(RemoteNetworkingContext::create(false, false).get(), hostnamesSet);
+    WTF::copyToVector(hostnamesSet, hostnames);
+}
+
+void NetworkConnectionToWebProcess::deleteCookiesForHostname(const String& hostname)
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    WebCore::deleteCookiesForHostname(RemoteNetworkingContext::create(false, false).get(), hostname);
+}
+
+void NetworkConnectionToWebProcess::deleteAllCookies()
+{
+    // FIXME (NetworkProcess): Use a correct storage session.
+    WebCore::deleteAllCookies(RemoteNetworkingContext::create(false, false).get());
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(NETWORK_PROCESS)
index 179bc2d..042a7dd 100644 (file)
@@ -82,7 +82,16 @@ private:
     void suspendPendingRequests();
     void resumePendingRequests();
     void setSerialLoadingEnabled(bool);
-    
+    void cookiesForDOM(const WebCore::KURL& firstParty, const WebCore::KURL&, String& result);
+    void setCookiesFromDOM(const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+    void cookiesEnabled(const WebCore::KURL& firstParty, const WebCore::KURL&, bool& result);
+    void cookieRequestHeaderFieldValue(const WebCore::KURL& firstParty, const WebCore::KURL&, String& result);
+    void getRawCookies(const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+    void deleteCookie(const WebCore::KURL&, const String& cookieName);
+    void getHostnamesWithCookies(Vector<String>& hostnames);
+    void deleteCookiesForHostname(const String& hostname);
+    void deleteAllCookies();
+
     RefPtr<CoreIPC::Connection> m_connection;
     
     HashSet<NetworkConnectionToWebProcessObserver*> m_observers;
index 8c13e3c..d6c5f65 100644 (file)
@@ -38,6 +38,16 @@ messages -> NetworkConnectionToWebProcess {
     ResumePendingRequests() -> ()
     
     SetSerialLoadingEnabled(bool enabled) -> ()
+
+    CookiesForDOM(WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::String result)
+    SetCookiesFromDOM(WebCore::KURL firstParty, WebCore::KURL url, WTF::String cookieString)
+    CookiesEnabled(WebCore::KURL firstParty, WebCore::KURL url) -> (bool enabled)
+    CookieRequestHeaderFieldValue(WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::String result)
+    GetRawCookies(WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::Vector<WebCore::Cookie> cookies)
+    DeleteCookie(WebCore::KURL url, WTF::String cookieName)
+    GetHostnamesWithCookies() -> (WTF::Vector<WTF::String> hostnames)
+    DeleteCookiesForHostname(WTF::String hostname)
+    DeleteAllCookies()
 }
 
 #endif // ENABLE(NETWORK_PROCESS)
index 69a9e35..0c9b941 100644 (file)
@@ -164,6 +164,7 @@ def struct_or_class(namespace, type):
         'WebCore::Animation',
         'WebCore::EditorCommandsForKeyEvent',
         'WebCore::CompositionUnderline',
+        'WebCore::Cookie',
         'WebCore::DragSession',
         'WebCore::FloatPoint3D',
         'WebCore::FileChooserSettings',
index 516b68b..12f387e 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "ShareableBitmap.h"
 #include <WebCore/AuthenticationChallenge.h>
+#include <WebCore/Cookie.h>
 #include <WebCore/Credential.h>
 #include <WebCore/Cursor.h>
 #include <WebCore/DatabaseDetails.h>
@@ -686,6 +687,42 @@ bool ArgumentCoder<CompositionUnderline>::decode(ArgumentDecoder* decoder, Compo
     return true;
 }
 
+
+void ArgumentCoder<Cookie>::encode(ArgumentEncoder& encoder, const Cookie& cookie)
+{
+    encoder << cookie.name;
+    encoder << cookie.value;
+    encoder << cookie.domain;
+    encoder << cookie.path;
+    encoder << cookie.expires;
+    encoder << cookie.httpOnly;
+    encoder << cookie.secure;
+    encoder << cookie.session;
+}
+
+bool ArgumentCoder<Cookie>::decode(ArgumentDecoder* decoder, Cookie& cookie)
+{
+    if (!decoder->decode(cookie.name))
+        return false;
+    if (!decoder->decode(cookie.value))
+        return false;
+    if (!decoder->decode(cookie.domain))
+        return false;
+    if (!decoder->decode(cookie.path))
+        return false;
+    if (!decoder->decode(cookie.expires))
+        return false;
+    if (!decoder->decode(cookie.httpOnly))
+        return false;
+    if (!decoder->decode(cookie.secure))
+        return false;
+    if (!decoder->decode(cookie.session))
+        return false;
+
+    return true;
+}
+
+
 #if ENABLE(SQL_DATABASE)
 void ArgumentCoder<DatabaseDetails>::encode(ArgumentEncoder& encoder, const DatabaseDetails& details)
 {
index e253147..75b4acc 100644 (file)
@@ -52,6 +52,7 @@ namespace WebCore {
     class UserStyleSheet;
     class UserScript;
     struct CompositionUnderline;
+    struct Cookie;
     struct DictationAlternative;
     struct DragSession;
     struct FileChooserSettings;
@@ -207,6 +208,11 @@ template<> struct ArgumentCoder<WebCore::CompositionUnderline> {
     static bool decode(ArgumentDecoder*, WebCore::CompositionUnderline&);
 };
 
+template<> struct ArgumentCoder<WebCore::Cookie> {
+    static void encode(ArgumentEncoder&, const WebCore::Cookie&);
+    static bool decode(ArgumentDecoder*, WebCore::Cookie&);
+};
+
 template<> struct ArgumentCoder<WebCore::DatabaseDetails> {
     static void encode(ArgumentEncoder&, const WebCore::DatabaseDetails&);
     static bool decode(ArgumentDecoder*, WebCore::DatabaseDetails&);
index c046644..88434f5 100644 (file)
 #include <WebCore/KURL.h>
 #include <WebCore/LoaderStrategy.h>
 #include <WebCore/Page.h>
+#include <WebCore/PlatformCookieJar.h>
 #include <WebCore/PlatformPasteboard.h>
 #include <wtf/Atomics.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkConnectionToWebProcessMessages.h"
+#include "NetworkProcessConnection.h"
+#endif
+
 #if PLATFORM(WIN) && USE(CFNETWORK)
 #include "WebFrameNetworkingContext.h"
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
 #endif
 
-#if USE(CF)
-#include <wtf/RetainPtr.h>
-#endif
-
 using namespace WebCore;
 
 namespace WebKit {
@@ -113,6 +115,124 @@ RetainPtr<CFHTTPCookieStorageRef> WebPlatformStrategies::defaultCookieStorage()
 }
 #endif
 
+String WebPlatformStrategies::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        String result;
+        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
+            return String();
+        return result;
+    }
+#endif
+
+    return WebCore::cookiesForDOM(context, firstParty, url);
+}
+
+void WebPlatformStrategies::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(firstParty, url, cookieString), 0);
+        return;
+    }
+#endif
+
+    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
+}
+
+bool WebPlatformStrategies::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        bool result;
+        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
+            return false;
+        return result;
+    }
+#endif
+
+    return WebCore::cookiesEnabled(context, firstParty, url);
+}
+
+String WebPlatformStrategies::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        String result;
+        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
+            return String();
+        return result;
+    }
+#endif
+
+    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
+}
+
+bool WebPlatformStrategies::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
+            return false;
+        return true;
+    }
+#endif
+
+    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
+}
+
+void WebPlatformStrategies::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(url, cookieName), 0);
+        return;
+    }
+#endif
+
+    WebCore::deleteCookie(context, url, cookieName);
+}
+
+void WebPlatformStrategies::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        Vector<String> hostnamesVector;
+        WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetHostnamesWithCookies(), Messages::NetworkConnectionToWebProcess::GetHostnamesWithCookies::Reply(hostnamesVector), 0);
+        for (unsigned i = 0; i != hostnamesVector.size(); ++i)
+            hostnames.add(hostnamesVector[i]);
+        return;
+    }
+#endif
+
+    WebCore::getHostnamesWithCookies(context, hostnames);
+}
+
+void WebPlatformStrategies::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookiesForHostname(hostname), 0);
+        return;
+    }
+#endif
+
+    WebCore::deleteCookiesForHostname(context, hostname);
+}
+
+void WebPlatformStrategies::deleteAllCookies(NetworkingContext* context)
+{
+#if ENABLE(NETWORK_PROCESS)
+    if (WebProcess::shared().usesNetworkProcess()) {
+        WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteAllCookies(), 0);
+        return;
+    }
+#endif
+
+    WebCore::deleteAllCookies(context);
+}
+
 // LoaderStrategy
 
 #if ENABLE(NETWORK_PROCESS)
index 040cfb1..80acfe0 100644 (file)
@@ -58,6 +58,15 @@ private:
 #if PLATFORM(MAC) || USE(CFNETWORK)
     virtual RetainPtr<CFHTTPCookieStorageRef> defaultCookieStorage() OVERRIDE;
 #endif
+    virtual String cookiesForDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&) OVERRIDE;
+    virtual void setCookiesFromDOM(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&) OVERRIDE;
+    virtual bool cookiesEnabled(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&) OVERRIDE;
+    virtual String cookieRequestHeaderFieldValue(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&) OVERRIDE;
+    virtual bool getRawCookies(WebCore::NetworkingContext*, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&) OVERRIDE;
+    virtual void deleteCookie(WebCore::NetworkingContext*, const WebCore::KURL&, const String&) OVERRIDE;
+    virtual void getHostnamesWithCookies(WebCore::NetworkingContext*, HashSet<String>& hostnames) OVERRIDE;
+    virtual void deleteCookiesForHostname(WebCore::NetworkingContext*, const String& hostname) OVERRIDE;
+    virtual void deleteAllCookies(WebCore::NetworkingContext*) OVERRIDE;
 
     // WebCore::LoaderStrategy
 #if ENABLE(NETWORK_PROCESS)