diff options
Diffstat (limited to 'WebKit/efl/ewk/ewk_cookies.cpp')
-rw-r--r-- | WebKit/efl/ewk/ewk_cookies.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/WebKit/efl/ewk/ewk_cookies.cpp b/WebKit/efl/ewk/ewk_cookies.cpp index 3b4949e..421f8dc 100644 --- a/WebKit/efl/ewk/ewk_cookies.cpp +++ b/WebKit/efl/ewk/ewk_cookies.cpp @@ -21,14 +21,18 @@ #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> +#ifdef WTF_USE_SOUP #include <glib.h> #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; @@ -216,6 +235,7 @@ EAPI Ewk_Cookie_Policy ewk_cookies_policy_get() break; } #endif +#endif return ewk_policy; } |