Title: [134975] trunk/Source
Revision
134975
Author
dglaz...@chromium.org
Date
2012-11-16 11:27:50 -0800 (Fri, 16 Nov 2012)

Log Message

Unreviewed, rolling out r134973.
http://trac.webkit.org/changeset/134973
https://bugs.webkit.org/show_bug.cgi?id=99340

Broke compile on at least Mac and Linux.

Source/WebCore:

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* loader/CookieJar.cpp:
* loader/chromium/CookieJarChromium.cpp: Renamed from Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp.
(WebCore):
(WebCore::setCookies):
(WebCore::cookies):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
(WebCore::getHostnamesWithCookies):
(WebCore::deleteCookiesForHostname):
(WebCore::deleteAllCookies):
* platform/chromium/PlatformSupport.h:
(WebCore):
(PlatformSupport):
* platform/network/NetworkingContext.h:
* platform/network/chromium/CookieJarChromium.cpp: Removed.

Source/WebKit/chromium:

* WebKit.gyp:
* src/FrameNetworkingContextImpl.h:
* src/PlatformSupport.cpp:
(WebCore::getCookieJar):
(WebCore):
(WebCore::PlatformSupport::setCookies):
(WebCore::PlatformSupport::cookies):
(WebCore::PlatformSupport::cookieRequestHeaderFieldValue):
(WebCore::PlatformSupport::rawCookies):
(WebCore::PlatformSupport::deleteCookie):
(WebCore::PlatformSupport::cookiesEnabled):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134974 => 134975)


--- trunk/Source/WebCore/ChangeLog	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebCore/ChangeLog	2012-11-16 19:27:50 UTC (rev 134975)
@@ -1,3 +1,31 @@
+2012-11-16  Dimitri Glazkov  <dglaz...@chromium.org>
+
+        Unreviewed, rolling out r134973.
+        http://trac.webkit.org/changeset/134973
+        https://bugs.webkit.org/show_bug.cgi?id=99340
+
+        Broke compile on at least Mac and Linux.
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * loader/CookieJar.cpp:
+        * loader/chromium/CookieJarChromium.cpp: Renamed from Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp.
+        (WebCore):
+        (WebCore::setCookies):
+        (WebCore::cookies):
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        (WebCore::deleteCookie):
+        (WebCore::getHostnamesWithCookies):
+        (WebCore::deleteCookiesForHostname):
+        (WebCore::deleteAllCookies):
+        * platform/chromium/PlatformSupport.h:
+        (WebCore):
+        (PlatformSupport):
+        * platform/network/NetworkingContext.h:
+        * platform/network/chromium/CookieJarChromium.cpp: Removed.
+
 2012-11-16  Martin Robinson  <mrobin...@igalia.com>
 
         [GTK] [WebKit2] Move GtkAuthenticationDialog to the UIProcess

Modified: trunk/Source/WebCore/WebCore.gyp/WebCore.gyp (134974 => 134975)


--- trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2012-11-16 19:27:50 UTC (rev 134975)
@@ -2116,6 +2116,7 @@
         ['exclude', 'inspector/InspectorFrontendClientLocal\\.cpp$'],
         ['exclude', 'inspector/_javascript_[^/]*\\.cpp$'],
         ['exclude', 'loader/UserStyleSheetLoader\\.cpp$'],
+        ['exclude', 'loader/CookieJar\\.cpp$'],
         ['exclude', 'loader/appcache/'],
         ['exclude', 'loader/archive/cf/LegacyWebArchiveMac\\.mm$'],
         ['exclude', 'loader/archive/cf/LegacyWebArchive\\.cpp$'],

Modified: trunk/Source/WebCore/WebCore.gypi (134974 => 134975)


--- trunk/Source/WebCore/WebCore.gypi	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebCore/WebCore.gypi	2012-11-16 19:27:50 UTC (rev 134975)
@@ -3049,6 +3049,7 @@
             'loader/cache/MemoryCache.cpp',
             'loader/cf/ResourceLoaderCFNet.cpp',
             'loader/chromium/CachedRawResourceChromium.cpp',
+            'loader/chromium/CookieJarChromium.cpp',
             'loader/chromium/DocumentThreadableLoaderChromium.cpp',
             'loader/chromium/ResourceLoaderChromium.cpp',
             'loader/chromium/SubresourceLoaderChromium.cpp',
@@ -5583,7 +5584,6 @@
             'platform/network/cf/SocketStreamHandleCFNet.cpp',
             'platform/network/chromium/AuthenticationChallenge.h',
             'platform/network/chromium/AuthenticationChallengeChromium.cpp',
-            'platform/network/chromium/CookieJarChromium.cpp',
             'platform/network/chromium/DNSChromium.cpp',
             'platform/network/chromium/ResourceError.h',
             'platform/network/chromium/ResourceHandle.cpp',

Modified: trunk/Source/WebCore/loader/CookieJar.cpp (134974 => 134975)


--- trunk/Source/WebCore/loader/CookieJar.cpp	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebCore/loader/CookieJar.cpp	2012-11-16 19:27:50 UTC (rev 134975)
@@ -30,8 +30,8 @@
 #include "Frame.h"
 #include "PlatformCookieJar.h"
 
-#if PLATFORM(BLACKBERRY)
-#error Blackberry currently uses a fork of this file because of layering violations
+#if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
+#error Chromium and Blackberry currently use a fork of this file because of layering violations
 #endif
 
 namespace WebCore {

Copied: trunk/Source/WebCore/loader/chromium/CookieJarChromium.cpp (from rev 134974, trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp) (0 => 134975)


--- trunk/Source/WebCore/loader/chromium/CookieJarChromium.cpp	                        (rev 0)
+++ trunk/Source/WebCore/loader/chromium/CookieJarChromium.cpp	2012-11-16 19:27:50 UTC (rev 134975)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2010, Google Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CookieJar.h"
+
+#include "Cookie.h"
+#include "Document.h"
+#include "PlatformSupport.h"
+
+namespace WebCore {
+
+// FIXME: Unfork. This file is forked because all other platforms use NetworkingContext to access cookie jar, not Document or Frame.
+
+void setCookies(Document* document, const KURL& url, const String& value)
+{
+    PlatformSupport::setCookies(document, url, value);
+}
+
+String cookies(const Document* document, const KURL& url)
+{
+    return PlatformSupport::cookies(document, url);
+}
+
+String cookieRequestHeaderFieldValue(const Document* document, const KURL& url)
+{
+    return PlatformSupport::cookieRequestHeaderFieldValue(document, url);
+}
+
+bool cookiesEnabled(const Document* document)
+{
+    return PlatformSupport::cookiesEnabled(document);
+}
+
+bool getRawCookies(const Document* document, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return PlatformSupport::rawCookies(document, url, rawCookies);
+}
+
+void deleteCookie(const Document* document, const KURL& url, const String& cookieName)
+{
+    return PlatformSupport::deleteCookie(document, url, cookieName);
+}
+
+void getHostnamesWithCookies(HashSet<String>& hostnames)
+{
+    // FIXME: Not yet implemented
+}
+
+void deleteCookiesForHostname(const String& hostname)
+{
+    // FIXME: Not yet implemented
+}
+
+void deleteAllCookies()
+{
+    // FIXME: Not yet implemented
+}
+
+} // namespace WebCore

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (134974 => 134975)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-11-16 19:27:50 UTC (rev 134975)
@@ -69,6 +69,7 @@
 class SerializedScriptValue;
 class Widget;
 
+struct Cookie;
 struct FontRenderStyle;
 
 // PlatformSupport an interface to the embedding layer that lets the embedder
@@ -77,6 +78,14 @@
 
 class PlatformSupport {
 public:
+    // Cookies ------------------------------------------------------------
+    static void setCookies(const Document*, const KURL&, const String& value);
+    static String cookies(const Document*, const KURL&);
+    static String cookieRequestHeaderFieldValue(const Document*, const KURL&);
+    static bool rawCookies(const Document*, const KURL&, Vector<Cookie>&);
+    static void deleteCookie(const Document*, const KURL&, const String& cookieName);
+    static bool cookiesEnabled(const Document*);
+
     // Font ---------------------------------------------------------------
 #if OS(WINDOWS)
     static bool ensureFontLoaded(HFONT);

Modified: trunk/Source/WebCore/platform/network/NetworkingContext.h (134974 => 134975)


--- trunk/Source/WebCore/platform/network/NetworkingContext.h	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebCore/platform/network/NetworkingContext.h	2012-11-16 19:27:50 UTC (rev 134975)
@@ -26,12 +26,6 @@
 #include "SchedulePair.h"
 #endif
 
-#if PLATFORM(CHROMIUM)
-namespace WebKit {
-class WebCookieJar;
-}
-#endif
-
 #if PLATFORM(QT)
 #include <qglobal.h>
 #endif
@@ -67,10 +61,6 @@
 
     virtual bool isValid() const { return true; }
 
-#if PLATFORM(CHROMIUM)
-    virtual WebKit::WebCookieJar* cookieJar() const = 0;
-#endif
-
 #if PLATFORM(MAC)
     virtual bool needsSiteSpecificQuirks() const = 0;
     virtual bool localFileContentSniffingEnabled() const = 0; // FIXME: Reconcile with ResourceHandle::forceContentSniffing().

Deleted: trunk/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp (134974 => 134975)


--- trunk/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp	2012-11-16 19:27:50 UTC (rev 134975)
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2010, Google Inc. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CookieJar.h"
-
-#include "Cookie.h"
-#include "NetworkingContext.h"
-#include <public/Platform.h>
-#include <public/WebCookie.h>
-#include <public/WebCookieJar.h>
-#include <public/WebURL.h>
-#include <public/WebVector.h>
-
-namespace WebCore {
-
-void setCookiesFromDOM(NetworkingContext* context, const KURL& firstPartyForCookies, const KURL& url, const String& cookieStr)
-{
-    if (!context)
-        return;
-    WebKit::WebCookieJar* cookieJar = context->cookieJar();
-    if (cookieJar)
-        cookieJar->setCookie(url, firstPartyForCookies, cookieStr);
-}
-
-String cookiesForDOM(NetworkingContext* context, const KURL& firstPartyForCookies, const KURL& url)
-{
-    if (!context)
-        return String();
-    String result;
-    WebKit::WebCookieJar* cookieJar = context->cookieJar();
-    if (cookieJar)
-        result = cookieJar->cookies(url, firstPartyForCookies);
-    return result;
-}
-
-String cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstPartyForCookies, const KURL& url)
-{
-    if (!context)
-        return String();
-    String result;
-    WebKit::WebCookieJar* cookieJar = context->cookieJar();
-    if (cookieJar)
-        result = cookieJar->cookieRequestHeaderFieldValue(url, firstPartyForCookies);
-    return result;
-}
-
-bool cookiesEnabled(NetworkingContext* context, const KURL& cookieURL, const KURL& firstPartyForCookies)
-{
-    bool result = false;
-    if (!context)
-        return result;
-    WebKit::WebCookieJar* cookieJar = context->cookieJar();
-    if (cookieJar)
-        result = cookieJar->cookiesEnabled(cookieURL, firstPartyForCookies);
-    return result;
-}
-
-bool getRawCookies(NetworkingContext* context, const KURL& firstPartyForCookies, const KURL& url, Vector<Cookie>& rawCookies)
-{
-    rawCookies.clear();
-    if (!context)
-        return false;
-    WebKit::WebVector<WebKit::WebCookie> webCookies;
-    WebKit::WebCookieJar* cookieJar = context->cookieJar();
-    if (cookieJar)
-        cookieJar->rawCookies(url, firstPartyForCookies, webCookies);
-    for (unsigned i = 0; i < webCookies.size(); ++i) {
-        const WebKit::WebCookie& webCookie = webCookies[i];
-        Cookie cookie(webCookie.name, webCookie.value, webCookie.domain, webCookie.path, webCookie.expires, webCookie.httpOnly, webCookie.secure, webCookie.session);
-        rawCookies.append(cookie);
-    }
-    return true;
-}
-
-void deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
-{
-    if (!context)
-        return;
-    WebKit::WebCookieJar* cookieJar = context->cookieJar();
-    if (cookieJar)
-        cookieJar->deleteCookie(url, cookieName);
-}
-
-void getHostnamesWithCookies(NetworkingContext* /*context*/, HashSet<String>& /*hostnames*/)
-{
-    // FIXME: Not yet implemented
-}
-
-void deleteCookiesForHostname(NetworkingContext* /*context*/, const String& /*hostname*/)
-{
-    // FIXME: Not yet implemented
-}
-
-void deleteAllCookies(NetworkingContext* /*context*/)
-{
-    // FIXME: Not yet implemented
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebKit/chromium/ChangeLog (134974 => 134975)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-11-16 19:27:50 UTC (rev 134975)
@@ -1,3 +1,23 @@
+2012-11-16  Dimitri Glazkov  <dglaz...@chromium.org>
+
+        Unreviewed, rolling out r134973.
+        http://trac.webkit.org/changeset/134973
+        https://bugs.webkit.org/show_bug.cgi?id=99340
+
+        Broke compile on at least Mac and Linux.
+
+        * WebKit.gyp:
+        * src/FrameNetworkingContextImpl.h:
+        * src/PlatformSupport.cpp:
+        (WebCore::getCookieJar):
+        (WebCore):
+        (WebCore::PlatformSupport::setCookies):
+        (WebCore::PlatformSupport::cookies):
+        (WebCore::PlatformSupport::cookieRequestHeaderFieldValue):
+        (WebCore::PlatformSupport::rawCookies):
+        (WebCore::PlatformSupport::deleteCookie):
+        (WebCore::PlatformSupport::cookiesEnabled):
+
 2012-11-16  Mark Pilgrim  <pilg...@chromium.org>
 
         [Chromium] Remove cookie-related functions from PlatformSupport

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (134974 => 134975)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2012-11-16 19:27:50 UTC (rev 134975)
@@ -394,7 +394,6 @@
                 'src/FindInPageCoordinates.h',
                 'src/FrameLoaderClientImpl.cpp',
                 'src/FrameLoaderClientImpl.h',
-                'src/FrameNetworkingContextImpl.cpp',
                 'src/FrameNetworkingContextImpl.h',
                 'src/GeolocationClientProxy.cpp',
                 'src/GeolocationClientProxy.h',

Deleted: trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp (134974 => 134975)


--- trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp	2012-11-16 19:27:50 UTC (rev 134975)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FrameNetworkingContextImpl.h"
-
-#include "WebFrameImpl.h"
-#include "public/WebFrameClient.h"
-#include <public/Platform.h>
-
-namespace WebKit {
-
-WebCookieJar* FrameNetworkingContextImpl::cookieJar() const
-{
-    WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(frame());
-    if (!frameImpl || !frameImpl->client())
-        return 0;
-    WebCookieJar* cookieJar = frameImpl->client()->cookieJar(frameImpl);
-    if (!cookieJar)
-        cookieJar = WebKit::Platform::current()->cookieJar();
-    return cookieJar;
-}
-
-}

Modified: trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h (134974 => 134975)


--- trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h	2012-11-16 19:27:50 UTC (rev 134975)
@@ -21,14 +21,11 @@
 #define FrameNetworkingContextImpl_h
 
 #include "FrameNetworkingContext.h"
-#include <public/WebCookieJar.h>
 
 namespace WebKit {
 
 class FrameNetworkingContextImpl : public WebCore::FrameNetworkingContext {
 public:
-    virtual WebCookieJar* cookieJar() const OVERRIDE;
-
     static PassRefPtr<FrameNetworkingContextImpl> create(WebCore::Frame* frame)
     {
         return adoptRef(new FrameNetworkingContextImpl(frame));

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (134974 => 134975)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-11-16 19:06:44 UTC (rev 134974)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-11-16 19:27:50 UTC (rev 134975)
@@ -84,6 +84,8 @@
 #include "NativeImageSkia.h"
 
 #include "BitmapImage.h"
+#include "Cookie.h"
+#include "Document.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "IDBFactoryBackendProxy.h"
@@ -95,6 +97,8 @@
 
 #include "Worker.h"
 #include "WorkerContextProxy.h"
+#include <public/WebCookie.h>
+#include <public/WebCookieJar.h>
 #include <public/WebMimeRegistry.h>
 #include <public/WebVector.h>
 #include <wtf/Assertions.h>
@@ -104,6 +108,86 @@
 
 namespace WebCore {
 
+static WebCookieJar* getCookieJar(const Document* document)
+{
+    WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(document->frame());
+    if (!frameImpl || !frameImpl->client())
+        return 0;
+    WebCookieJar* cookieJar = frameImpl->client()->cookieJar(frameImpl);
+    if (!cookieJar)
+        cookieJar = WebKit::Platform::current()->cookieJar();
+    return cookieJar;
+}
+
+// Cookies --------------------------------------------------------------------
+
+void PlatformSupport::setCookies(const Document* document, const KURL& url,
+                                const String& value)
+{
+    WebCookieJar* cookieJar = getCookieJar(document);
+    if (cookieJar)
+        cookieJar->setCookie(url, document->firstPartyForCookies(), value);
+}
+
+String PlatformSupport::cookies(const Document* document, const KURL& url)
+{
+    String result;
+    WebCookieJar* cookieJar = getCookieJar(document);
+    if (cookieJar)
+        result = cookieJar->cookies(url, document->firstPartyForCookies());
+    return result;
+}
+
+String PlatformSupport::cookieRequestHeaderFieldValue(const Document* document,
+                                                     const KURL& url)
+{
+    String result;
+    WebCookieJar* cookieJar = getCookieJar(document);
+    if (cookieJar)
+        result = cookieJar->cookieRequestHeaderFieldValue(url, document->firstPartyForCookies());
+    return result;
+}
+
+bool PlatformSupport::rawCookies(const Document* document, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    rawCookies.clear();
+    WebVector<WebCookie> webCookies;
+
+    WebCookieJar* cookieJar = getCookieJar(document);
+    if (cookieJar)
+        cookieJar->rawCookies(url, document->firstPartyForCookies(), webCookies);
+
+    for (unsigned i = 0; i < webCookies.size(); ++i) {
+        const WebCookie& webCookie = webCookies[i];
+        Cookie cookie(webCookie.name,
+                      webCookie.value,
+                      webCookie.domain,
+                      webCookie.path,
+                      webCookie.expires,
+                      webCookie.httpOnly,
+                      webCookie.secure,
+                      webCookie.session);
+        rawCookies.append(cookie);
+    }
+    return true;
+}
+
+void PlatformSupport::deleteCookie(const Document* document, const KURL& url, const String& cookieName)
+{
+    WebCookieJar* cookieJar = getCookieJar(document);
+    if (cookieJar)
+        cookieJar->deleteCookie(url, cookieName);
+}
+
+bool PlatformSupport::cookiesEnabled(const Document* document)
+{
+    bool result = false;
+    WebCookieJar* cookieJar = getCookieJar(document);
+    if (cookieJar)
+        result = cookieJar->cookiesEnabled(document->cookieURL(), document->firstPartyForCookies());
+    return result;
+}
+
 // Font -----------------------------------------------------------------------
 
 #if OS(WINDOWS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to