diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/API/efl/ewk_context.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/API/efl/ewk_context.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp index e1ccff23b..21c157c22 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp @@ -25,20 +25,40 @@ #include "WKAPICast.h" #include "WKRetainPtr.h" #include "ewk_context_private.h" +#include "ewk_cookie_manager_private.h" using namespace WebKit; struct _Ewk_Context { WKRetainPtr<WKContextRef> context; + + Ewk_Cookie_Manager* cookieManager; #if ENABLE(BATTERY_STATUS) RefPtr<BatteryProvider> batteryProvider; #endif _Ewk_Context(WKContextRef contextRef) : context(contextRef) + , cookieManager(0) { } + + ~_Ewk_Context() + { + if (cookieManager) + ewk_cookie_manager_free(cookieManager); + } }; +Ewk_Cookie_Manager* ewk_context_cookie_manager_get(const Ewk_Context* ewkContext) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0); + + if (!ewkContext->cookieManager) + const_cast<Ewk_Context*>(ewkContext)->cookieManager = ewk_cookie_manager_new(WKContextGetCookieManager(ewkContext->context.get())); + + return ewkContext->cookieManager; +} + WKContextRef ewk_context_WKContext_get(const Ewk_Context* ewkContext) { return ewkContext->context.get(); |