2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jul 2010 18:17:35 +0000 (18:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jul 2010 18:17:35 +0000 (18:17 +0000)
        Reviewed by Antonio Gomes.

        [EFL] Add support for using libcurl network backend.
        https://bugs.webkit.org/show_bug.cgi?id=42286

        Instead of just libsoup, the EFL port now can use libcurl backend.
        This is a step in the direction of removing dependency on glib. Just
        need to pass the option -DNETWORK_BACKEND=curl to cmake in order to
        enable it.

        * cmake/OptionsEfl.cmake:
2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>

        Reviewed by Antonio Gomes.

        [EFL] Add support for using libcurl network backend.
        https://bugs.webkit.org/show_bug.cgi?id=42286

        Add files and flags for soup/curl specific backend being
        used.
        Put some ifdefs around soup/glib calls.

        No new tests, no new features implemented.

        * CMakeListsEfl.txt:
        * platform/efl/FileSystemEfl.cpp:
        (WebCore::fileSystemRepresentation):
2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>

        Reviewed by Antonio Gomes.

        [EFL] Add support for using libcurl network backend.
        https://bugs.webkit.org/show_bug.cgi?id=42286

        Just add soup/curl directories and flags for the specific
        backend being used.

        * CMakeLists.txt:
        * CMakeListsEfl.txt:
2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>

        Reviewed by Antonio Gomes.

        [EFL] Add support for using libcurl network backend.
        https://bugs.webkit.org/show_bug.cgi?id=42286

        Put some ifdefs around soup calls.

        * ewk/ewk_cookies.cpp:
        (ewk_cookies_file_set):
        (ewk_cookies_clear):
        (ewk_cookies_get_all):
        (ewk_cookies_cookie_del):
        (ewk_cookies_cookie_free):
        (ewk_cookies_policy_set):
        (ewk_cookies_policy_get):
        * ewk/ewk_main.cpp:
        (ewk_init):

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

ChangeLog
WebCore/CMakeListsEfl.txt
WebCore/ChangeLog
WebCore/platform/efl/FileSystemEfl.cpp
WebKit/CMakeLists.txt
WebKit/CMakeListsEfl.txt
WebKit/ChangeLog
WebKit/efl/ChangeLog
WebKit/efl/ewk/ewk_cookies.cpp
WebKit/efl/ewk/ewk_main.cpp
cmake/OptionsEfl.cmake

index 6bdfc1099206ed502fe56e3266670b4bc8487e8b..e672caa9fc441bd4f76100a68575fb0e12be8ee4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Add support for using libcurl network backend.
+        https://bugs.webkit.org/show_bug.cgi?id=42286
+
+        Instead of just libsoup, the EFL port now can use libcurl backend.
+        This is a step in the direction of removing dependency on glib. Just
+        need to pass the option -DNETWORK_BACKEND=curl to cmake in order to
+        enable it.
+
+        * cmake/OptionsEfl.cmake:
+
 2010-07-23  Andras Becsi  <abecsi@webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
index ab475f522fcd12fde54ca53da245c260bab64040..7ec5c7408722f4790c0f34d1d70f9910abe93b2a 100644 (file)
@@ -97,6 +97,19 @@ IF (WTF_USE_SOUP)
   )
 ENDIF ()
 
+IF (WTF_USE_CURL)
+  LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+    "${WEBCORE_DIR}/platform/network/curl"
+  )
+  LIST(APPEND WebCore_SOURCES
+    platform/network/curl/CookieJarCurl.cpp
+    platform/network/curl/DNSCurl.cpp
+    platform/network/curl/FormDataStreamCurl.cpp
+    platform/network/curl/ResourceHandleCurl.cpp
+    platform/network/curl/ResourceHandleManager.cpp
+  )
+ENDIF ()
+
 IF (WTF_USE_ICU_UNICODE)
   LIST(APPEND WebCore_SOURCES
     editing/SmartReplaceICU.cpp
@@ -116,13 +129,24 @@ LIST(APPEND WebCore_LIBRARIES
   ${Glib_LIBRARIES}
   ${GTK_LIBRARIES}
   ${ICU_LIBRARIES}
-  ${LIBSOUP24_LIBRARIES}
   ${LIBXML2_LIBRARIES}
   ${LIBXSLT_LIBRARIES}
   ${Pango_LIBRARIES}
   ${SQLITE_LIBRARIES}
 )
 
+IF (WTF_USE_SOUP)
+  LIST(APPEND WebCore_LIBRARIES
+    ${LIBSOUP24_LIBRARIES}
+  )
+ENDIF ()
+
+IF (WTF_USE_CURL)
+  LIST(APPEND WebCore_LIBRARIES
+    ${CURL_LIBRARIES}
+  )
+ENDIF ()
+
 LIST(APPEND WebCore_INCLUDE_DIRECTORIES
   ${Cairo_INCLUDE_DIRS}
   ${ECORE_X_INCLUDE_DIRS}
@@ -133,9 +157,20 @@ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
   ${Glib_INCLUDE_DIRS}
   ${GTK_INCLUDE_DIRS}
   ${ICU_INCLUDE_DIRS}
-  ${LIBSOUP24_INCLUDE_DIRS}
-  ${LIBXML2_INCLUDE_DIRS}
+  ${LIBXML2_INCLUDE_DIR}
   ${LIBXSLT_INCLUDE_DIRS}
   ${Pango_INCLUDE_DIRS}
   ${SQLITE_INCLUDE_DIRS}
 )
+
+IF (WTF_USE_SOUP)
+  LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+    ${LIBSOUP24_INCLUDE_DIRS}
+  )
+ENDIF ()
+
+IF (WTF_USE_CURL)
+  LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+    ${CURL_INCLUDE_DIRS}
+  )
+ENDIF ()
index a92dc736d960ce36d4820fa3256920b5a61f0bc1..be6f2c17ae99044b35d15bba66fb9a3e999ad734 100644 (file)
@@ -1,3 +1,20 @@
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Add support for using libcurl network backend.
+        https://bugs.webkit.org/show_bug.cgi?id=42286
+
+        Add files and flags for soup/curl specific backend being
+        used.
+        Put some ifdefs around soup/glib calls.
+
+        No new tests, no new features implemented.
+
+        * CMakeListsEfl.txt:
+        * platform/efl/FileSystemEfl.cpp:
+        (WebCore::fileSystemRepresentation):
+
 2010-07-23  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index 31b2e221fd5bc742e3a91c348a82882d9ff1c85d..680d5579fd4224dca8e7ea113e0789554da9c85e 100644 (file)
@@ -55,13 +55,13 @@ CString fileSystemRepresentation(const String& path)
 {
 // WARNING: this is just used by platform/network/soup, thus must be GLIB!!!
 // TODO: move this to CString and use it instead in both, being more standard
-#if PLATFORM(WIN_OS)
-    return path.utf8();
-#else
+#if !PLATFORM(WIN_OS) && defined(WTF_USE_SOUP)
     char* filename = g_uri_unescape_string(path.utf8().data(), 0);
     CString cfilename(filename);
     g_free(filename);
     return cfilename;
+#else
+    return path.utf8();
 #endif
 }
 
index 6e0996c0591f836770ea2134932930561d7c1137..ef850de394b1726aad9e3190f461cf24e4ede380 100644 (file)
@@ -21,7 +21,6 @@ SET(WebKit_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/platform/graphics/cairo"
     "${WEBCORE_DIR}/platform/graphics/transforms"
     "${WEBCORE_DIR}/platform/network"
-    "${WEBCORE_DIR}/platform/network/soup"
     "${WEBCORE_DIR}/platform/sql"
     "${WEBCORE_DIR}/platform/text"
     "${WEBCORE_DIR}/plugins"
@@ -47,6 +46,14 @@ SET(WebKit_INCLUDE_DIRECTORIES
     "${CMAKE_BINARY_DIR}"
 )
 
+IF (WTF_USE_SOUP)
+  LIST(APPEND WebKit_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/platform/network/soup")
+ENDIF ()
+
+IF (WTF_USE_CURL)
+  LIST(APPEND WebKit_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/platform/network/curl")
+ENDIF ()
+
 SET(WebKit_LIBRARIES
     ${JavaScriptCore_LIBRARY_NAME}
     ${WebCore_LIBRARY_NAME}
index ee67d71d93bc09e6f1abf2431af22dda2dfd41fa..46a95a0ef30775e7bd0894b3ffd8f7c8584b861c 100644 (file)
@@ -17,7 +17,6 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES
     ${EVAS_INCLUDE_DIRS}
     ${Gdk_INCLUDE_DIRS}
     ${Glib_INCLUDE_DIRS}
-    ${LIBSOUP24_INCLUDE_DIRS}
     ${LIBXML2_INCLUDE_DIRS}
     ${LIBXSLT_INCLUDE_DIRS}
     ${SQLITE_INCLUDE_DIRS}
@@ -51,12 +50,21 @@ LIST(APPEND WebKit_LIBRARIES
     ${Gdk_LIBRARIES}
     ${Glib_LIBRARIES}
     ${Gtk_LIBRARIES}
-    ${LIBSOUP24_LIBRARIES}
     ${LIBXML2_LIBRARIES}
     ${Pango_LIBRARIES}
     ${SQLITE_LIBRARIES}
 )
 
+IF (WTF_USE_SOUP)
+  LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${LIBSOUP24_INCLUDE_DIRS})
+  LIST(APPEND WebKit_LIBRARIES ${LIBSOUP24_LIBRARIES})
+ENDIF ()
+
+IF (WTF_USE_CURL)
+  LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${CURL_INCLUDE_DIRS})
+  LIST(APPEND WebKit_LIBRARIES ${CURL_LIBRARIES})
+ENDIF ()
+
 FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
 GENERATE_EDJ(
     ${WEBKIT_DIR}/efl/DefaultTheme/default.edc
@@ -80,7 +88,6 @@ SET(EWebLauncher_LIBRARIES
     ${EVAS_LIBRARIES}
     ${Gdk_LIBRARIES}
     ${Glib_LIBRARIES}
-    ${LIBSOUP24_LIBRARIES}
     ${LIBXML2_LIBRARIES}
     ${LIBXSLT_LIBRARIES}
     ${SQLITE_LIBRARIES}
@@ -91,9 +98,18 @@ SET(EWebLauncher_LINK_FLAGS
     ${EDJE_LDFLAGS}
     ${EFLDEPS_LDFLAGS}
     ${EVAS_LDFLAGS}
-    ${LIBSOUP24_LDFLAGS}
 )
 
+IF (WTF_USE_SOUP)
+  LIST(APPEND EWebLauncher_LIBRARIES ${LIBSOUP24_LIBRARIES})
+  LIST(APPEND EWebLauncher_LINK_FLAGS ${LIBSOUP24_LDFLAGS})
+ENDIF ()
+
+IF (WTF_USE_CURL)
+  LIST(APPEND EWebLauncher_LIBRARIES ${CURL_LIBRARIES})
+  LIST(APPEND EWebLauncher_LINK_FLAGS ${CURL_LDFLAGS})
+ENDIF ()
+
 ADD_EXECUTABLE(../Programs/EWebLauncher ${EWebLauncher_SOURCES})
 TARGET_LINK_LIBRARIES(../Programs/EWebLauncher ${EWebLauncher_LIBRARIES})
 ADD_TARGET_PROPERTIES(../Programs/EWebLauncher LINK_FLAGS "${EWebLauncher_LINK_FLAGS}")
index a34347d185eb5d0b74907c8fca76cc7088509050..a4fa9bac4747f7768879de081b6afb682364c5bb 100644 (file)
@@ -1,3 +1,16 @@
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Add support for using libcurl network backend.
+        https://bugs.webkit.org/show_bug.cgi?id=42286
+
+        Just add soup/curl directories and flags for the specific
+        backend being used.
+
+        * CMakeLists.txt:
+        * CMakeListsEfl.txt:
+
 2010-07-22  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
 
         Reviewed by Antonio Gomes.
index f64bbee7c7102d96c80737c65a7a3f574aa243df..8149f51bbef1b9ad203838cc0edbeebef82dbc46 100644 (file)
@@ -1,3 +1,23 @@
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Add support for using libcurl network backend.
+        https://bugs.webkit.org/show_bug.cgi?id=42286
+
+        Put some ifdefs around soup calls.
+
+        * ewk/ewk_cookies.cpp:
+        (ewk_cookies_file_set):
+        (ewk_cookies_clear):
+        (ewk_cookies_get_all):
+        (ewk_cookies_cookie_del):
+        (ewk_cookies_cookie_free):
+        (ewk_cookies_policy_set):
+        (ewk_cookies_policy_get):
+        * ewk/ewk_main.cpp:
+        (ewk_init):
+
 2010-07-23  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
 
         Reviewed by Kenneth Rohde Christiansen.
index 3b4949e1f08d351d249780552c51da953b6cdedd..913cf12af71b827e63a04fc04f12aea486eda58f 100644 (file)
 #include "config.h"
 #include "ewk_cookies.h"
 
+#ifdef WTF_USE_SOUP
 #include "CookieJarSoup.h"
+#endif
 #include "EWebKit.h"
 #include "ResourceHandle.h"
 
 #include <Eina.h>
 #include <eina_safety_checks.h>
 #include <glib.h>
+#ifdef WTF_USE_SOUP
 #include <libsoup/soup.h>
+#endif
 #include <wtf/text/CString.h>
 
 
@@ -43,6 +47,7 @@
  */
 EAPI Eina_Bool ewk_cookies_file_set(const char *filename)
 {
+#ifdef WTF_USE_SOUP
     SoupCookieJar* cookieJar = 0;
     if (filename)
         cookieJar = soup_cookie_jar_text_new(filename, FALSE);
@@ -65,6 +70,9 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename)
     soup_session_add_feature(session, SOUP_SESSION_FEATURE(cookieJar));
 
     return EINA_TRUE;
+#else
+    return EINA_FALSE;
+#endif
 }
 
 /**
@@ -72,6 +80,7 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename)
  */
 EAPI void ewk_cookies_clear()
 {
+#ifdef WTF_USE_SOUP
     GSList* l;
     GSList* p;
     SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
@@ -81,6 +90,7 @@ EAPI void ewk_cookies_clear()
         soup_cookie_jar_delete_cookie(cookieJar, (SoupCookie*)p->data);
 
     soup_cookies_free(l);
+#endif
 }
 
 /**
@@ -90,9 +100,10 @@ EAPI void ewk_cookies_clear()
  */
 EAPI Eina_List* ewk_cookies_get_all(void)
 {
+    Eina_List* el = 0;
+#ifdef WTF_USE_SOUP
     GSList* l;
     GSList* p;
-    Eina_List* el = 0;
     SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
 
     l = soup_cookie_jar_all_cookies(cookieJar);
@@ -110,6 +121,7 @@ EAPI Eina_List* ewk_cookies_get_all(void)
     }
 
     soup_cookies_free(l);
+#endif
     return el;
 }
 
@@ -123,6 +135,7 @@ EAPI Eina_List* ewk_cookies_get_all(void)
  */
 EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie)
 {
+#ifdef WTF_USE_SOUP
     EINA_SAFETY_ON_NULL_RETURN(cookie);
     GSList* l;
     GSList* p;
@@ -141,6 +154,7 @@ EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie)
 
     soup_cookie_free(c1);
     soup_cookies_free(l);
+#endif
 }
 
 /*
@@ -150,12 +164,14 @@ EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie)
  */
 EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie)
 {
+#ifdef WTF_USE_SOUP
     EINA_SAFETY_ON_NULL_RETURN(cookie);
     free(cookie->name);
     free(cookie->value);
     free(cookie->domain);
     free(cookie->path);
     free(cookie);
+#endif
 }
 
 /*
@@ -170,6 +186,7 @@ EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie)
  */
 EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p)
 {
+#ifdef WTF_USE_SOUP
 #ifdef HAVE_LIBSOUP_2_29_90
     SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
     SoupCookieJarAcceptPolicy policy;
@@ -189,6 +206,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p)
 
     soup_cookie_jar_set_accept_policy(cookieJar, policy);
 #endif
+#endif
 }
 
 /*
@@ -199,6 +217,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p)
 EAPI Ewk_Cookie_Policy ewk_cookies_policy_get()
 {
     Ewk_Cookie_Policy ewk_policy = EWK_COOKIE_JAR_ACCEPT_ALWAYS;
+#ifdef WTF_USE_SOUP
 #ifdef HAVE_LIBSOUP_2_29_90
     SoupCookieJar* cookieJar = WebCore::defaultCookieJar();
     SoupCookieJarAcceptPolicy policy;
@@ -215,6 +234,7 @@ EAPI Ewk_Cookie_Policy ewk_cookies_policy_get()
         ewk_policy = EWK_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
         break;
     }
+#endif
 #endif
 
     return ewk_policy;
index 92346e7f1f3356930018ea8704901da25e6274f9..206f70c64d7aece906c29d35b61bb440da76c8bc 100644 (file)
 
 #endif
 
+#ifdef WTF_USE_SOUP
 // REMOVE-ME: see todo below
 #include "ResourceHandle.h"
 #include <libsoup/soup.h>
+#endif
 
 static int _ewk_init_count = 0;
 int _ewk_log_dom = -1;
@@ -119,10 +121,12 @@ int ewk_init(void)
     ewk_settings_web_database_path_set(getenv("HOME"));
 
     // TODO: this should move to WebCore, already reported to webkit-gtk folks:
+#ifdef WTF_USE_SOUP
     if (1) {
         SoupSession* session = WebCore::ResourceHandle::defaultSession();
         soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER);
     }
+#endif
 
     return ++_ewk_init_count;
 
index 3be7bda67715509bd630491fe16fa7189e8aa72b..c9d51206cd780643fedfb5323a3c372e0e651143 100644 (file)
@@ -8,14 +8,17 @@ ADD_DEFINITIONS(-DDATA_DIR="${DATA_DIR}")
 ADD_DEFINITIONS(-DWTF_PLATFORM_EFL=1)
 SET(WTF_PLATFORM_EFL 1)
 
-SET(LIBSOUP24_MIN_VERSION 2.28.2)
+# -----------------------------------------------------------------------------
+# Determine which network backend will be used
+# -----------------------------------------------------------------------------
+SET(ALL_NETWORK_BACKENDS soup curl)
+SET(NETWORK_BACKEND "soup" CACHE STRING "choose which network backend to use (one of ${ALL_NETWORK_BACKENDS})")
 
 FIND_PACKAGE(Cairo 1.6 REQUIRED)
 FIND_PACKAGE(EFL REQUIRED)
 FIND_PACKAGE(Freetype 9.0 REQUIRED)
 FIND_PACKAGE(GDK 2.10 REQUIRED)
 FIND_PACKAGE(Glib REQUIRED)
-FIND_PACKAGE(LibSoup2 2.28.2 REQUIRED)
 FIND_PACKAGE(Sqlite REQUIRED)
 FIND_PACKAGE(LibXml2 2.6 REQUIRED)
 FIND_PACKAGE(LibXslt 1.1.7 REQUIRED)
@@ -32,14 +35,6 @@ LIST(APPEND WTF_INCLUDE_DIRECTORIES ${ICU_INCLUDE_DIRS})
 SET(WTF_PLATFORM_CAIRO 1)
 ADD_DEFINITIONS(-DWTF_PLATFORM_CAIRO=1)
 
-SET(WTF_USE_SOUP 1)
-ADD_DEFINITIONS(-DWTF_USE_SOUP=1)
-IF (LIBSOUP24_VERSION VERSION_LESS 2.29.90)
-ELSE (LIBSOUP24_VERSION VERSION_LESS 2.29.90)
-    SET(HAVE_LIBSOUP_2_29_90 1)
-    ADD_DEFINITIONS(-DHAVE_LIBSOUP_2_29_90=1)
-ENDIF ()
-
 SET(WTF_USE_FREETYPE 1)
 ADD_DEFINITIONS(-DUSE_FREETYPE=1)
 
@@ -96,4 +91,24 @@ IF (${ENABLE_ECORE_X})
     ENDIF ()
 ENDIF ()
 
+IF (NETWORK_BACKEND STREQUAL "soup")
+  IF (NOT ENABLE_GLIB_SUPPORT)
+    SET(ENABLE_GLIB_SUPPORT 1)
+    MESSAGE("Forcing Glib support")
+  ENDIF ()
+  FIND_PACKAGE(LibSoup2 2.28.2 REQUIRED)
+  SET(WTF_USE_SOUP 1)
+  ADD_DEFINITIONS(-DWTF_USE_SOUP=1)
+
+  IF (LIBSOUP24_VERSION VERSION_LESS 2.29.90)
+  ELSE (LIBSOUP24_VERSION VERSION_LESS 2.29.90)
+      SET(HAVE_LIBSOUP_2_29_90 1)
+      ADD_DEFINITIONS(-DHAVE_LIBSOUP_2_29_90=1)
+  ENDIF ()
+ELSE ()
+  FIND_PACKAGE(CURL REQUIRED)
+  SET(WTF_USE_CURL 1)
+  ADD_DEFINITIONS(-DWTF_USE_CURL=1)
+ENDIF ()
+
 SET(CPACK_SOURCE_GENERATOR TBZ2)