Title: [135013] trunk/Source
Revision
135013
Author
pilg...@chromium.org
Date
2012-11-16 15:52:37 -0800 (Fri, 16 Nov 2012)

Log Message

[Chromium] Remove cookie-related functions from PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=99340

Reviewed by Adam Barth.

Move cookie-related functions out of PlatformSupport and implement
new PlatformCookieJar interface via NetworkContext.

Source/WebCore:

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* loader/CookieJar.cpp:
* loader/chromium/CookieJarChromium.cpp: Removed.
* platform/chromium/PlatformSupport.h:
(WebCore):
(PlatformSupport):
* platform/network/NetworkingContext.h:
(WebKit):
(NetworkingContext):
* platform/network/chromium/CookieJarChromium.cpp: Copied from Source/WebCore/loader/chromium/CookieJarChromium.cpp.
(WebCore::setCookiesFromDOM):
(WebCore::cookiesForDOM):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
(WebCore::getHostnamesWithCookies):
(WebCore::deleteCookiesForHostname):
(WebCore::deleteAllCookies):

Source/WebKit/chromium:

* WebKit.gyp:
* src/FrameNetworkingContextImpl.cpp: Added.
(WebKit):
(WebKit::FrameNetworkingContextImpl::cookieJar):
* src/FrameNetworkingContextImpl.h:
(FrameNetworkingContextImpl):
* src/PlatformSupport.cpp:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135012 => 135013)


--- trunk/Source/WebCore/ChangeLog	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebCore/ChangeLog	2012-11-16 23:52:37 UTC (rev 135013)
@@ -1,3 +1,34 @@
+2012-11-16  Mark Pilgrim  <pilg...@chromium.org>
+
+        [Chromium] Remove cookie-related functions from PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=99340
+
+        Reviewed by Adam Barth.
+
+        Move cookie-related functions out of PlatformSupport and implement
+        new PlatformCookieJar interface via NetworkContext.
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * loader/CookieJar.cpp:
+        * loader/chromium/CookieJarChromium.cpp: Removed.
+        * platform/chromium/PlatformSupport.h:
+        (WebCore):
+        (PlatformSupport):
+        * platform/network/NetworkingContext.h:
+        (WebKit):
+        (NetworkingContext):
+        * platform/network/chromium/CookieJarChromium.cpp: Copied from Source/WebCore/loader/chromium/CookieJarChromium.cpp.
+        (WebCore::setCookiesFromDOM):
+        (WebCore::cookiesForDOM):
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        (WebCore::deleteCookie):
+        (WebCore::getHostnamesWithCookies):
+        (WebCore::deleteCookiesForHostname):
+        (WebCore::deleteAllCookies):
+
 2012-11-16  Pablo Flouret  <pab...@motorola.com>
 
         [JSC] Don't sanitize window.onerror information on crossorigin-enabled scripts

Modified: trunk/Source/WebCore/WebCore.gyp/WebCore.gyp (135012 => 135013)


--- trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebCore/WebCore.gyp/WebCore.gyp	2012-11-16 23:52:37 UTC (rev 135013)
@@ -2116,7 +2116,6 @@
         ['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 (135012 => 135013)


--- trunk/Source/WebCore/WebCore.gypi	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebCore/WebCore.gypi	2012-11-16 23:52:37 UTC (rev 135013)
@@ -3049,7 +3049,6 @@
             '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',
@@ -5584,6 +5583,7 @@
             '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 (135012 => 135013)


--- trunk/Source/WebCore/loader/CookieJar.cpp	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebCore/loader/CookieJar.cpp	2012-11-16 23:52:37 UTC (rev 135013)
@@ -30,8 +30,8 @@
 #include "Frame.h"
 #include "PlatformCookieJar.h"
 
-#if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
-#error Chromium and Blackberry currently use a fork of this file because of layering violations
+#if PLATFORM(BLACKBERRY)
+#error Blackberry currently uses a fork of this file because of layering violations
 #endif
 
 namespace WebCore {

Deleted: trunk/Source/WebCore/loader/chromium/CookieJarChromium.cpp (135012 => 135013)


--- trunk/Source/WebCore/loader/chromium/CookieJarChromium.cpp	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebCore/loader/chromium/CookieJarChromium.cpp	2012-11-16 23:52:37 UTC (rev 135013)
@@ -1,87 +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 "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 (135012 => 135013)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-11-16 23:52:37 UTC (rev 135013)
@@ -69,7 +69,6 @@
 class SerializedScriptValue;
 class Widget;
 
-struct Cookie;
 struct FontRenderStyle;
 
 // PlatformSupport an interface to the embedding layer that lets the embedder
@@ -78,14 +77,6 @@
 
 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 (135012 => 135013)


--- trunk/Source/WebCore/platform/network/NetworkingContext.h	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebCore/platform/network/NetworkingContext.h	2012-11-16 23:52:37 UTC (rev 135013)
@@ -26,6 +26,12 @@
 #include "SchedulePair.h"
 #endif
 
+#if PLATFORM(CHROMIUM)
+namespace WebKit {
+class WebCookieJar;
+}
+#endif
+
 #if PLATFORM(QT)
 #include <qglobal.h>
 #endif
@@ -61,6 +67,10 @@
 
     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().

Added: trunk/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp (0 => 135013)


--- trunk/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/network/chromium/CookieJarChromium.cpp	2012-11-16 23:52:37 UTC (rev 135013)
@@ -0,0 +1,127 @@
+/*
+ * 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 (135012 => 135013)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-11-16 23:52:37 UTC (rev 135013)
@@ -1,3 +1,21 @@
+2012-11-16  Mark Pilgrim  <pilg...@chromium.org>
+
+        [Chromium] Remove cookie-related functions from PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=99340
+
+        Reviewed by Adam Barth.
+
+        Move cookie-related functions out of PlatformSupport and implement
+        new PlatformCookieJar interface via NetworkContext.
+
+        * WebKit.gyp:
+        * src/FrameNetworkingContextImpl.cpp: Added.
+        (WebKit):
+        (WebKit::FrameNetworkingContextImpl::cookieJar):
+        * src/FrameNetworkingContextImpl.h:
+        (FrameNetworkingContextImpl):
+        * src/PlatformSupport.cpp:
+
 2012-11-16  Tien-Ren Chen  <trc...@chromium.org>
 
         Rename applyDefaultDeviceScaleFactorInCompositor to setApplyDeviceScaleFactorInCompositor

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (135012 => 135013)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2012-11-16 23:52:37 UTC (rev 135013)
@@ -394,6 +394,7 @@
                 'src/FindInPageCoordinates.h',
                 'src/FrameLoaderClientImpl.cpp',
                 'src/FrameLoaderClientImpl.h',
+                'src/FrameNetworkingContextImpl.cpp',
                 'src/FrameNetworkingContextImpl.h',
                 'src/GeolocationClientProxy.cpp',
                 'src/GeolocationClientProxy.h',

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


--- trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp	                        (rev 0)
+++ trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp	2012-11-16 23:52:37 UTC (rev 135013)
@@ -0,0 +1,51 @@
+/*
+ * 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 "WebFrameClient.h"
+#include "WebFrameImpl.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 (135012 => 135013)


--- trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h	2012-11-16 23:52:37 UTC (rev 135013)
@@ -21,11 +21,14 @@
 #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 (135012 => 135013)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-11-16 23:47:35 UTC (rev 135012)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-11-16 23:52:37 UTC (rev 135013)
@@ -84,8 +84,6 @@
 #include "NativeImageSkia.h"
 
 #include "BitmapImage.h"
-#include "Cookie.h"
-#include "Document.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "IDBFactoryBackendProxy.h"
@@ -97,8 +95,6 @@
 
 #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>
@@ -108,86 +104,6 @@
 
 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