Title: [100362] trunk/Source/WebKit2
Revision
100362
Author
[email protected]
Date
2011-11-15 16:26:15 -0800 (Tue, 15 Nov 2011)

Log Message

[SOUP][WK2] Add initial WebCookieManagerSoup.cpp for webkit2
https://bugs.webkit.org/show_bug.cgi?id=72235

Patch by Jongseok Yang <[email protected]> on 2011-11-15
Reviewed by Gustavo Noronha Silva.

Add WebCookieManagerSoup.cpp and implement functions for the cookie accept policy.
It's required when using the soup network backend.
Remove WebCookieManagerEfl.cpp and WebCookieManagerGtk.cpp because GTK port and
EFL port use soup network backend without a network backend of their own.

* GNUmakefile.am:
* WebProcess/Cookies/efl/WebCookieManagerEfl.cpp: Removed.
* WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp: Removed.
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: Added.
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (100361 => 100362)


--- trunk/Source/WebKit2/ChangeLog	2011-11-16 00:24:40 UTC (rev 100361)
+++ trunk/Source/WebKit2/ChangeLog	2011-11-16 00:26:15 UTC (rev 100362)
@@ -1,3 +1,22 @@
+2011-11-15  Jongseok Yang  <[email protected]>
+
+        [SOUP][WK2] Add initial WebCookieManagerSoup.cpp for webkit2
+        https://bugs.webkit.org/show_bug.cgi?id=72235
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add WebCookieManagerSoup.cpp and implement functions for the cookie accept policy.
+        It's required when using the soup network backend.
+        Remove WebCookieManagerEfl.cpp and WebCookieManagerGtk.cpp because GTK port and
+        EFL port use soup network backend without a network backend of their own.
+
+        * GNUmakefile.am:
+        * WebProcess/Cookies/efl/WebCookieManagerEfl.cpp: Removed.
+        * WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp: Removed.
+        * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: Added.
+        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
+        (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
+
 2011-11-15  Jochen Eisinger  <[email protected]>
 
         Rename ReferrerPolicy to clarify its meaning

Modified: trunk/Source/WebKit2/GNUmakefile.am (100361 => 100362)


--- trunk/Source/WebKit2/GNUmakefile.am	2011-11-16 00:24:40 UTC (rev 100361)
+++ trunk/Source/WebKit2/GNUmakefile.am	2011-11-16 00:26:15 UTC (rev 100362)
@@ -669,7 +669,7 @@
 	Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h \
 	Source/WebKit2/WebProcess/Cookies/WebCookieManager.h \
 	Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp \
-	Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp \
+	Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp \
 	Source/WebKit2/WebProcess/Downloads/Download.cpp \
 	Source/WebKit2/WebProcess/Downloads/Download.h \
 	Source/WebKit2/WebProcess/Downloads/DownloadAuthenticationClient.h \

Deleted: trunk/Source/WebKit2/WebProcess/Cookies/efl/WebCookieManagerEfl.cpp (100361 => 100362)


--- trunk/Source/WebKit2/WebProcess/Cookies/efl/WebCookieManagerEfl.cpp	2011-11-16 00:24:40 UTC (rev 100361)
+++ trunk/Source/WebKit2/WebProcess/Cookies/efl/WebCookieManagerEfl.cpp	2011-11-16 00:26:15 UTC (rev 100362)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2011 Samsung Electronics.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "WebCookieManager.h"
-
-#include <WebCore/NotImplemented.h>
-
-namespace WebKit {
-
-void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy)
-{
-    notImplemented();
-}
-
-HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy()
-{
-    notImplemented();
-    return HTTPCookieAcceptPolicyAlways;
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp (100361 => 100362)


--- trunk/Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp	2011-11-16 00:24:40 UTC (rev 100361)
+++ trunk/Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp	2011-11-16 00:26:15 UTC (rev 100362)
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 Apple 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:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "WebCookieManager.h"
-
-namespace WebKit {
-
-void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy)
-{
-    // FIXME: Not implemented.
-}
-
-HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy()
-{
-    // FIXME: Not implemented.
-    return HTTPCookieAcceptPolicyAlways;
-}
-
-} // namespace WebKit

Added: trunk/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp (0 => 100362)


--- trunk/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp	2011-11-16 00:26:15 UTC (rev 100362)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "WebCookieManager.h"
+
+#include <WebCore/CookieJarSoup.h>
+#include <libsoup/soup.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy)
+{
+    SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
+    SoupCookieJarAcceptPolicy soupPolicy;
+
+    soupPolicy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
+    switch (policy) {
+    case HTTPCookieAcceptPolicyAlways:
+        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
+        break;
+    case HTTPCookieAcceptPolicyNever:
+        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_NEVER;
+        break;
+    case HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
+        soupPolicy = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
+        break;
+    }
+    soup_cookie_jar_set_accept_policy(cookieJar, soupPolicy);
+}
+
+HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy()
+{
+    SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
+    SoupCookieJarAcceptPolicy soupPolicy;
+
+    HTTPCookieAcceptPolicy policy;
+
+    soupPolicy = soup_cookie_jar_get_accept_policy(cookieJar);
+    switch (soupPolicy) {
+    case SOUP_COOKIE_JAR_ACCEPT_ALWAYS:
+        policy = HTTPCookieAcceptPolicyAlways;
+        break;
+    case SOUP_COOKIE_JAR_ACCEPT_NEVER:
+        policy = HTTPCookieAcceptPolicyNever;
+        break;
+    case SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY:
+        policy = HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
+        break;
+    default:
+        policy = HTTPCookieAcceptPolicyAlways;
+    }
+    return policy;
+}
+
+} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to