2 * Copyright (C) 2012 Samsung Electronics
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 #include "ewk_context.h"
24 #include "BatteryProvider.h"
25 #include "WKAPICast.h"
26 #include "WKApplicationCacheManager.h"
28 #include "WKContext.h"
29 #include "WKContextPrivate.h"
30 #include "WKContextTizen.h"
31 #include "WKDatabaseManager.h"
32 #include "WKIconDatabase.h"
33 #include "WKIconDatabaseEfl.h"
34 #include "WKKeyValueStorageManager.h"
36 #include "WKRetainPtr.h"
37 #include "WKSecurityOrigin.h"
40 #include "WebContext.h"
41 #include "ewk_context_download_client.h"
42 #include "ewk_context_injected_bundle_client.h"
43 #include "ewk_context_private.h"
44 #include "ewk_security_origin.h"
46 #include <WebCore/FileSystem.h>
47 #include <wtf/text/WTFString.h>
49 using namespace WebKit;
52 WKRetainPtr<WKContextRef> context;
53 #if ENABLE(BATTERY_STATUS)
54 RefPtr<BatteryProvider> batteryProvider;
56 const char* proxyAddress;
57 #if ENABLE(TIZEN_SQL_DATABASE)
58 uint64_t defaultDatabaseQuota;
61 Ewk_Context_Message_From_Injected_Bundle_Callback callback;
63 } messageFromInjectedBundle;
65 Ewk_Context_Did_Start_Download_Callback callback;
69 _Ewk_Context(WKRetainPtr<WKContextRef> contextRef)
72 #if ENABLE(BATTERY_STATUS)
73 WKBatteryManagerRef wkBatteryManager = WKContextGetBatteryManager(contextRef.get());
74 batteryProvider = BatteryProvider::create(wkBatteryManager);
76 this->proxyAddress = 0;
77 #if ENABLE(TIZEN_SQL_DATABASE)
78 this->defaultDatabaseQuota = 5 * 1024 * 1024;
80 this->messageFromInjectedBundle.callback = 0;
81 this->messageFromInjectedBundle.userData = 0;
82 this->didStartDownload.callback = 0;
83 this->didStartDownload.userData = 0;
87 typedef struct _Ewk_Context_Callback_Context
90 Ewk_Web_Application_Cache_Origins_Get_Callback webApplicationCacheOriginsCallback;
91 Ewk_Web_Application_Cache_Quota_Get_Callback webApplicationCacheQuotaCallback;
92 Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback webApplicationCacheUsageForOriginCallback;
93 Ewk_Web_Database_Origins_Get_Callback webDatabaseOriginsCallback;
94 Ewk_Web_Database_Quota_Get_Callback webDatabaseQuotaCallback;
95 Ewk_Web_Database_Usage_Get_Callback webDatabaseUsageCallback;
96 Ewk_Web_Storage_Origins_Get_Callback webStorageOriginsCallback;
97 Ewk_Web_Storage_Usage_Get_Callback webStorageUsageCallback;
98 Ewk_Cookies_Policy_Get_Callback cookiesPolicyGetCallback;
101 } Ewk_Context_Callback_Context;
103 #if ENABLE(TIZEN_SQL_DATABASE)
104 struct _Ewk_Context_Exceeded_Quota
106 Ewk_Security_Origin* origin;
107 const char* databaseName;
108 const char* displayName;
109 unsigned long long currentQuota;
110 unsigned long long currentOriginUsage;
111 unsigned long long currentDatabaseUsage;
112 unsigned long long expectedUsage;
113 unsigned long long newQuota;
118 WKContextRef ewk_context_WKContext_get(const Ewk_Context* ewkContext)
120 return ewkContext->context.get();
126 * Create Ewk_Context with WKContext.
128 Ewk_Context* ewk_context_new_with_WKContext(WKContextRef contextRef)
130 EINA_SAFETY_ON_NULL_RETURN_VAL(contextRef, 0);
132 return new Ewk_Context(contextRef);
134 #endif // #if OS(TIZEN)
136 #if ENABLE(TIZEN_SQL_DATABASE)
137 Ewk_Context_Exceeded_Quota* ewkContextCreateExceededQuota(WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage)
139 Ewk_Context_Exceeded_Quota* exceededQuota = new Ewk_Context_Exceeded_Quota();
141 int length = WKStringGetMaximumUTF8CStringSize(databaseName);
142 OwnArrayPtr<char> databaseNameBuffer = adoptArrayPtr(new char[length]);
143 WKStringGetUTF8CString(databaseName, databaseNameBuffer.get(), length);
145 length = WKStringGetMaximumUTF8CStringSize(displayName);
146 OwnArrayPtr<char> displayNameBuffer = adoptArrayPtr(new char[length]);
147 WKStringGetUTF8CString(displayName, displayNameBuffer.get(), length);
149 exceededQuota->origin = createSecurityOrigin(origin);
150 exceededQuota->databaseName = eina_stringshare_add(databaseNameBuffer.get());
151 exceededQuota->displayName = eina_stringshare_add(displayNameBuffer.get());
152 exceededQuota->currentQuota = currentQuota;
153 exceededQuota->currentOriginUsage = currentOriginUsage;
154 exceededQuota->currentDatabaseUsage = currentDatabaseUsage;
155 exceededQuota->expectedUsage = expectedUsage;
157 return exceededQuota;
160 void ewkContextDeleteExceededQuota(Ewk_Context_Exceeded_Quota* exceededQuota)
162 deleteSecurityOrigin(exceededQuota->origin);
163 eina_stringshare_del(exceededQuota->databaseName);
164 eina_stringshare_del(exceededQuota->displayName);
165 delete exceededQuota;
168 unsigned long long ewkContextGetNewQuotaForExceededQuota(Ewk_Context* ewkContext, Ewk_Context_Exceeded_Quota* exceededQuota)
170 if (exceededQuota->newQuota)
171 return exceededQuota->newQuota;
173 if (exceededQuota->currentQuota)
174 return exceededQuota->currentQuota;
176 return ewkContext->defaultDatabaseQuota;
179 uint64_t ewkContextGetDatabaseQuota(Ewk_Context* ewkContext)
181 return ewkContext->defaultDatabaseQuota;
186 Ewk_Context* ewk_context_new()
188 Ewk_Context* ewk_context = new Ewk_Context(adoptWK(WKContextCreate()));
190 ewkContextInjectedBundleClientAttachClient(ewk_context);
191 ewkContextDownloadClientAttatchClient(ewk_context);
196 Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path)
198 EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
200 WKRetainPtr<WKStringRef> pathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
201 Ewk_Context* ewk_context = new Ewk_Context(adoptWK(WKContextCreateWithInjectedBundlePath(pathRef.get())));
203 ewkContextInjectedBundleClientAttachClient(ewk_context);
204 ewkContextDownloadClientAttatchClient(ewk_context);
209 void ewk_context_delete(Ewk_Context* ewkContext)
211 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
212 if (ewkContext == ewk_context_default_get())
215 eina_stringshare_del(ewkContext->proxyAddress);
219 void ewk_context_proxy_uri_set(Ewk_Context* ewkContext, const char* proxy)
221 if (ewkContext && eina_stringshare_replace(&ewkContext->proxyAddress, proxy)) {
222 WKRetainPtr<WKURLRef> proxyAddress(AdoptWK, WKURLCreateWithUTF8CString(proxy));
224 WKContextRef contextRef = ewk_context_WKContext_get(ewkContext);
225 toImpl(contextRef)->setProxy(toWTFString(proxyAddress.get()));
229 const char* ewk_context_proxy_uri_get(Ewk_Context* ewkContext)
231 #if ENABLE(TIZEN_WEBKIT2_PATCH_FOR_TC)
232 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
234 return ewkContext->proxyAddress;
237 void ewk_context_network_session_requests_cancel(Ewk_Context* ewkContext)
239 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
241 WKContextRef contextRef = ewk_context_WKContext_get(ewkContext);
242 toImpl(contextRef)->abortSession();
245 Eina_Bool ewk_context_notify_low_memory(Ewk_Context* ewkContext)
247 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
249 WKContextRef contextRef = ewk_context_WKContext_get(ewkContext);
250 toImpl(contextRef)->notifyLowMemory();
254 #if ENABLE(TIZEN_APPLICATION_CACHE)
255 static void didGetWebApplicationOrigins(WKArrayRef origins, WKErrorRef error, void* context)
257 Eina_List* originList = 0;
259 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
260 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
261 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
262 originList = eina_list_append(originList, origin);
265 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
266 applicationCacheContext->webApplicationCacheOriginsCallback(originList, applicationCacheContext->userData);
267 delete applicationCacheContext;
270 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
271 static void didGetWebApplicationQuota(WKInt64Ref quota, WKErrorRef error, void* context)
273 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
274 applicationCacheContext->webApplicationCacheQuotaCallback(toImpl(quota)->value(), applicationCacheContext->userData);
275 delete applicationCacheContext;
278 static void didGetWebApplicationUsageForOrigin(WKInt64Ref usage, WKErrorRef error, void* context)
280 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
281 applicationCacheContext->webApplicationCacheUsageForOriginCallback(toImpl(usage)->value(), applicationCacheContext->userData);
282 delete applicationCacheContext;
287 #if ENABLE(TIZEN_SQL_DATABASE)
288 static void didGetWebDatabaseOrigins(WKArrayRef origins, WKErrorRef error, void* context)
290 Eina_List* originList = 0;
292 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
293 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
294 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
295 originList = eina_list_append(originList, origin);
298 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
299 webDatabaseContext->webDatabaseOriginsCallback(originList, webDatabaseContext->userData);
300 delete webDatabaseContext;
303 static void didGetWebDatabaseQuota(WKUInt64Ref quota, WKErrorRef error, void* context)
305 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
306 webDatabaseContext->webDatabaseQuotaCallback(toImpl(quota)->value(), webDatabaseContext->userData);
307 delete webDatabaseContext;
310 static void didGetWebDatabaseUsage(WKUInt64Ref usage, WKErrorRef error, void* context)
312 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
313 webDatabaseContext->webDatabaseUsageCallback(toImpl(usage)->value(), webDatabaseContext->userData);
314 delete webDatabaseContext;
318 #if ENABLE(TIZEN_WEB_STORAGE)
319 static void didGetWebStorageOrigins(WKArrayRef origins, WKErrorRef error, void* context)
321 Eina_List* originList = 0;
323 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
324 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
325 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
326 originList = eina_list_append(originList, origin);
329 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
330 webStorageContext->webStorageOriginsCallback(originList, webStorageContext->userData);
331 delete webStorageContext;
334 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
335 static void didGetWebStorageUsage(WKInt64Ref usage, WKErrorRef error, void* context)
337 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
338 webStorageContext->webStorageUsageCallback(toImpl(usage)->value(), webStorageContext->userData);
339 delete webStorageContext;
345 Eina_Bool ewk_context_origins_free(Eina_List* originList)
347 EINA_SAFETY_ON_NULL_RETURN_VAL(originList, false);
350 EINA_LIST_FREE(originList, currentOrigin) {
351 Ewk_Security_Origin* origin = static_cast<Ewk_Security_Origin*>(currentOrigin);
352 deleteSecurityOrigin(origin);
358 Eina_Bool ewk_context_application_cache_delete_all(Ewk_Context* ewkContext)
360 #if ENABLE(TIZEN_APPLICATION_CACHE)
361 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
363 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewk_context_WKContext_get(ewkContext));
364 WKApplicationCacheManagerDeleteAllEntries(applicationCache);
372 Eina_Bool ewk_context_application_cache_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
374 #if ENABLE(TIZEN_APPLICATION_CACHE)
375 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
376 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
378 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
379 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
380 WKRetainPtr<WKSecurityOriginRef> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
381 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewk_context_WKContext_get(ewkContext));
382 WKApplicationCacheManagerDeleteEntriesForOrigin(applicationCacheRef, securityOriginRef.get());
390 Eina_Bool ewk_context_application_cache_origins_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Origins_Get_Callback callback, void *userData)
392 #if ENABLE(TIZEN_APPLICATION_CACHE)
393 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
394 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
396 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
397 context->webApplicationCacheOriginsCallback = callback;
398 context->userData = userData;
400 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewk_context_WKContext_get(ewkContext));
401 WKApplicationCacheManagerGetApplicationCacheOrigins(applicationCacheRef, context, didGetWebApplicationOrigins);
409 Eina_Bool ewk_context_application_cache_path_set(Ewk_Context* ewkContext, const char* path)
411 #if ENABLE(TIZEN_APPLICATION_CACHE)
412 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
413 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
415 WKRetainPtr<WKStringRef> applicationCachePathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
416 WKContextSetApplicationCacheDirectory(ewk_context_WKContext_get(ewkContext), applicationCachePathRef.get());
424 Eina_Bool ewk_context_application_cache_quota_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Quota_Get_Callback callback, void* userData)
426 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
427 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
428 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
430 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
431 context->webApplicationCacheQuotaCallback = callback;
432 context->userData = userData;
434 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewk_context_WKContext_get(ewkContext));
435 WKApplicationCacheManagerGetApplicationCacheQuota(applicationCacheRef, context, didGetWebApplicationQuota);
443 Eina_Bool ewk_context_application_cache_usage_for_origin_get(Ewk_Context* ewkContext, const Ewk_Security_Origin* origin, Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback callback, void* userData)
445 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
446 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
447 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
448 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
450 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
451 context->webApplicationCacheUsageForOriginCallback = callback;
452 context->userData = userData;
453 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
454 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
455 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
457 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewk_context_WKContext_get(ewkContext));
458 WKApplicationCacheManagerGetApplicationCacheUsageForOrigin(applicationCache, context, originRef.get(), didGetWebApplicationUsageForOrigin);
466 Eina_Bool ewk_context_application_cache_quota_set(Ewk_Context* ewkContext, int64_t quota)
468 #if ENABLE(TIZEN_APPLICATION_CACHE)
469 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
470 EINA_SAFETY_ON_NULL_RETURN_VAL(quota, false);
472 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewk_context_WKContext_get(ewkContext));
473 WKApplicationCacheManagerSetApplicationCacheQuota(applicationCacheRef, quota);
481 Eina_Bool ewk_context_application_cache_quota_for_origin_set(Ewk_Context* ewkContext, const Ewk_Security_Origin* origin, int64_t quota)
483 #if ENABLE(TIZEN_APPLICATION_CACHE)
484 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
485 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
486 EINA_SAFETY_ON_NULL_RETURN_VAL(quota, false);
488 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
489 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
490 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
492 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewk_context_WKContext_get(ewkContext));
493 WKApplicationCacheManagerSetApplicationCacheQuotaForOrigin(applicationCache, originRef.get(), quota);
502 Eina_Bool ewk_context_icon_database_path_set(Ewk_Context* ewkContext, const char* path)
504 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
505 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
507 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
508 WKContextSetIconDatabasePath(ewk_context_WKContext_get(ewkContext), databasePath.get());
513 Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* ewkContext, const char* uri, Evas* canvas)
515 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
516 EINA_SAFETY_ON_NULL_RETURN_VAL(uri, 0);
517 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
519 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewk_context_WKContext_get(ewkContext));
520 WKRetainPtr<WKURLRef> urlString(AdoptWK, WKURLCreateWithUTF8CString(uri));
522 return WKIconDatabaseTryGetImageForURL(iconDatabase, canvas, urlString.get());
525 void ewk_context_icon_database_delete_all(Ewk_Context* ewkContext)
527 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
529 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewk_context_WKContext_get(ewkContext));
530 WKIconDatabaseRemoveAllIcons(iconDatabase);
533 Eina_Bool ewk_context_local_file_system_path_set(Ewk_Context* ewkContext, const char* path)
535 #if ENABLE(TIZEN_FILE_SYSTEM)
536 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
537 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
539 WKRetainPtr<WKStringRef> localFileSystemPathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
540 WKContextSetLocalFileSystemDirectory(ewk_context_WKContext_get(ewkContext), localFileSystemPathRef.get());
548 Ewk_Security_Origin* ewk_context_web_database_exceeded_quota_port_get(Ewk_Context_Exceeded_Quota* exceededQuota)
550 #if ENABLE(TIZEN_SQL_DATABASE)
551 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
553 return exceededQuota->origin;
559 const char* ewk_context_web_database_exceeded_quota_database_name_get(Ewk_Context_Exceeded_Quota* exceededQuota)
561 #if ENABLE(TIZEN_SQL_DATABASE)
562 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
564 return exceededQuota->databaseName;
570 const char* ewk_context_web_database_exceeded_quota_display_name_get(Ewk_Context_Exceeded_Quota* exceededQuota)
572 #if ENABLE(TIZEN_SQL_DATABASE)
573 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
575 return exceededQuota->displayName;
581 unsigned long long ewk_context_web_database_exceeded_quota_current_quota_get(Ewk_Context_Exceeded_Quota* exceededQuota)
583 #if ENABLE(TIZEN_SQL_DATABASE)
584 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
586 return exceededQuota->currentQuota;
592 unsigned long long ewk_context_web_database_exceeded_quota_current_origin_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
594 #if ENABLE(TIZEN_SQL_DATABASE)
595 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
597 return exceededQuota->currentOriginUsage;
603 unsigned long long ewk_context_web_database_exceeded_quota_current_database_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
605 #if ENABLE(TIZEN_SQL_DATABASE)
606 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
608 return exceededQuota->currentDatabaseUsage;
614 unsigned long long ewk_context_web_database_exceeded_quota_expected_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
616 #if ENABLE(TIZEN_SQL_DATABASE)
617 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
619 return exceededQuota->expectedUsage;
625 void ewk_context_web_database_exceeded_quota_new_quota_set(Ewk_Context_Exceeded_Quota* exceededQuota, unsigned long long quota)
627 #if ENABLE(TIZEN_SQL_DATABASE)
628 EINA_SAFETY_ON_NULL_RETURN(exceededQuota);
630 exceededQuota->newQuota = quota;
634 Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* ewkContext)
636 #if ENABLE(TIZEN_SQL_DATABASE)
637 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
639 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewk_context_WKContext_get(ewkContext));
640 WKDatabaseManagerDeleteAllDatabases(databaseManager);
648 Eina_Bool ewk_context_web_database_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
650 #if ENABLE(TIZEN_SQL_DATABASE)
651 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
652 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
654 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
655 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
656 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
657 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewk_context_WKContext_get(ewkContext));
658 WKDatabaseManagerDeleteDatabasesForOrigin(databaseManager, originRef.get());
666 Eina_Bool ewk_context_web_database_origins_get(Ewk_Context* ewkContext, Ewk_Web_Database_Origins_Get_Callback callback, void* userData)
668 #if ENABLE(TIZEN_SQL_DATABASE)
669 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
670 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
672 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
673 context->webDatabaseOriginsCallback = callback;
674 context->userData = userData;
676 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewk_context_WKContext_get(ewkContext));
677 WKDatabaseManagerGetDatabaseOrigins(databaseManager, context, didGetWebDatabaseOrigins);
685 Eina_Bool ewk_context_web_database_path_set(Ewk_Context* ewkContext, const char* path)
687 #if ENABLE(TIZEN_SQL_DATABASE)
688 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
689 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
691 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
692 WKContextSetDatabaseDirectory(ewk_context_WKContext_get(ewkContext), databasePath.get());
700 Eina_Bool ewk_context_web_database_quota_for_origin_get(Ewk_Context* ewkContext, Ewk_Web_Database_Quota_Get_Callback callback, void* userData, Ewk_Security_Origin* origin)
702 #if ENABLE(TIZEN_SQL_DATABASE)
703 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
704 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
705 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
707 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
708 context->webDatabaseQuotaCallback = callback;
709 context->userData = userData;
711 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
712 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
713 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
714 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewk_context_WKContext_get(ewkContext));
715 WKDatabaseManagerGetQuotaForOrigin(databaseManager, context, didGetWebDatabaseQuota, originRef.get());
723 Eina_Bool ewk_context_web_database_default_quota_set(Ewk_Context* ewkContext, uint64_t quota)
725 #if ENABLE(TIZEN_SQL_DATABASE)
726 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
728 ewkContext->defaultDatabaseQuota = quota;
736 Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* ewkContext, Ewk_Security_Origin* origin, uint64_t quota)
738 #if ENABLE(TIZEN_SQL_DATABASE)
739 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
740 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
742 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
743 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
744 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
745 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewk_context_WKContext_get(ewkContext));
746 WKDatabaseManagerSetQuotaForOrigin(databaseManager, originRef.get(), quota);
754 Eina_Bool ewk_context_web_database_usage_for_origin_get(Ewk_Context* ewkContext, Ewk_Web_Database_Quota_Get_Callback callback, void* userData, Ewk_Security_Origin* origin)
756 #if ENABLE(TIZEN_SQL_DATABASE)
757 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
758 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
759 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
761 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
762 context->webDatabaseQuotaCallback = callback;
763 context->userData = userData;
765 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
766 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
767 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
768 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewk_context_WKContext_get(ewkContext));
769 WKDatabaseManagerGetUsageForOrigin(databaseManager, context, didGetWebDatabaseUsage, originRef.get());
777 Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* ewkContext)
779 #if ENABLE(TIZEN_INDEXED_DATABASE)
780 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
782 DEFINE_STATIC_LOCAL(const String, fileMatchPattern, ("*"));
783 DEFINE_STATIC_LOCAL(const String, indexedDatabaseDirectory, ("/opt/apps/com.samsung.browser/data/.webkit/indexedDatabases"));
785 Vector<String> paths = WebCore::listDirectory(indexedDatabaseDirectory, fileMatchPattern);
786 Vector<String>::const_iterator end = paths.end();
787 for(Vector<String>::const_iterator it = paths.begin(); it != end; ++it){
789 #if ENABLE(TIZEN_FILE_SYSTEM)
790 WebCore::removeDirectory(path);
800 Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* ewkContext)
802 #if ENABLE(TIZEN_WEB_STORAGE)
803 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
805 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewk_context_WKContext_get(ewkContext));
806 WKKeyValueStorageManagerDeleteAllEntries(storageManager);
814 Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
816 #if ENABLE(TIZEN_WEB_STORAGE)
817 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
818 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
820 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
821 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
822 WKRetainPtr<WKSecurityOriginRef> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
823 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewk_context_WKContext_get(ewkContext));
824 WKKeyValueStorageManagerDeleteEntriesForOrigin(storageManager, securityOriginRef.get());
832 Eina_Bool ewk_context_web_storage_origins_get(Ewk_Context* ewkContext, Ewk_Web_Storage_Origins_Get_Callback callback, void* userData)
834 #if ENABLE(TIZEN_WEB_STORAGE)
835 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
836 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
838 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
839 context->webStorageOriginsCallback = callback;
840 context->userData = userData;
842 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewk_context_WKContext_get(ewkContext));
843 WKKeyValueStorageManagerGetKeyValueStorageOrigins(storageManager, context, didGetWebStorageOrigins);
851 Eina_Bool ewk_context_web_storage_path_set(Ewk_Context* ewkContext, const char* path)
853 #if ENABLE(TIZEN_WEB_STORAGE)
854 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
855 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
857 WKRetainPtr<WKStringRef> webStoragePath(AdoptWK, WKStringCreateWithUTF8CString(path));
858 WKContextSetLocalStorageDirectory(ewk_context_WKContext_get(ewkContext), webStoragePath.get());
866 Eina_Bool ewk_context_web_storage_usage_for_origin_get(Ewk_Context* ewkContext, Ewk_Security_Origin* origin, Ewk_Web_Storage_Usage_Get_Callback callback, void* userData)
868 #if ENABLE(TIZEN_WEB_STORAGE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
869 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
870 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
871 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
873 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
874 context->webStorageUsageCallback = callback;
875 context->userData = userData;
876 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
877 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
878 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
880 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewk_context_WKContext_get(ewkContext));
881 WKKeyValueStorageManagerGetKeyValueStorageUsageForOrigin(storageManager, context, didGetWebStorageUsage, originRef.get());
889 //#if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2)
890 Eina_Bool ewk_context_soup_data_directory_set(Ewk_Context* ewkContext, const char* path)
892 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
893 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
895 WKRetainPtr<WKStringRef> soupDataDirectory(AdoptWK, WKStringCreateWithUTF8CString(path));
896 WKContextSetSoupDataDirectory(ewk_context_WKContext_get(ewkContext), soupDataDirectory.get());
901 Eina_Bool ewk_context_cache_model_set(Ewk_Context* ewkContext, Ewk_Cache_Model model)
903 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
904 if (model == EWK_CACHE_MODEL_DOCUMENT_VIEWER)
905 WKContextSetCacheModel(ewk_context_WKContext_get(ewkContext), kWKCacheModelDocumentViewer);
906 else if (model == EWK_CACHE_MODEL_DOCUMENT_BROWSER)
907 WKContextSetCacheModel(ewk_context_WKContext_get(ewkContext), kWKCacheModelDocumentBrowser);
909 WKContextSetCacheModel(ewk_context_WKContext_get(ewkContext), kWKCacheModelPrimaryWebBrowser);
914 Ewk_Cache_Model ewk_context_cache_model_get(Ewk_Context* ewkContext)
916 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, EWK_CACHE_MODEL_DOCUMENT_VIEWER);
917 WKCacheModel cacheModel = WKContextGetCacheModel(ewk_context_WKContext_get(ewkContext));
919 if (cacheModel == kWKCacheModelDocumentViewer)
920 return EWK_CACHE_MODEL_DOCUMENT_VIEWER;
921 else if (cacheModel == kWKCacheModelDocumentBrowser)
922 return EWK_CACHE_MODEL_DOCUMENT_BROWSER;
924 return EWK_CACHE_MODEL_PRIMARY_WEBBROWSER;
927 Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* ewkContext, Eina_Bool cacheDisabled)
929 #if ENABLE(TIZEN_CACHE_CONTROL)
930 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
931 WKContextSetCacheDisabled(ewk_context_WKContext_get(ewkContext), cacheDisabled);
937 Eina_Bool ewk_context_cache_disabled_get(Ewk_Context* ewkContext)
939 #if ENABLE(TIZEN_CACHE_CONTROL)
940 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
941 return WKContextGetCacheDisabled(ewk_context_WKContext_get(ewkContext));
947 Eina_Bool ewk_context_cache_clear(Ewk_Context* ewkContext)
949 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
950 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(ewk_context_WKContext_get(ewkContext));
951 WKResourceCacheManagerClearCacheForAllOrigins(cacheManager, WKResourceCachesToClearAll);
956 Eina_Bool ewk_context_cookies_clear(Ewk_Context* ewkContext)
958 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
959 WKCookieManagerRef cookieManager = WKContextGetCookieManager(ewk_context_WKContext_get(ewkContext));
960 WKCookieManagerDeleteAllCookies(cookieManager);
965 Eina_Bool ewk_context_cookies_policy_set(Ewk_Context* ewkContext, Ewk_Cookie_Policy cookiePolicy)
967 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
968 WKCookieManagerRef cookieManager = WKContextGetCookieManager(ewk_context_WKContext_get(ewkContext));
969 if (cookiePolicy == EWK_COOKIE_JAR_ACCEPT_ALWAYS)
970 WKCookieManagerSetHTTPCookieAcceptPolicy(cookieManager, kWKHTTPCookieAcceptPolicyAlways);
971 else if (cookiePolicy == EWK_COOKIE_JAR_ACCEPT_NEVER)
972 WKCookieManagerSetHTTPCookieAcceptPolicy(cookieManager, kWKHTTPCookieAcceptPolicyNever);
974 WKCookieManagerSetHTTPCookieAcceptPolicy(cookieManager, kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);
979 static void getCookiesPolicy(WKHTTPCookieAcceptPolicy cookiePolicy, WKErrorRef error, void* context)
981 EINA_SAFETY_ON_NULL_RETURN(context);
982 Ewk_Context_Callback_Context* callbackContext = static_cast<Ewk_Context_Callback_Context*>(context);
984 Ewk_Cookie_Policy policy = EWK_COOKIE_JAR_ACCEPT_ALWAYS;
985 switch (cookiePolicy) {
986 case kWKHTTPCookieAcceptPolicyAlways:
987 policy = EWK_COOKIE_JAR_ACCEPT_ALWAYS;
989 case kWKHTTPCookieAcceptPolicyNever:
990 policy = EWK_COOKIE_JAR_ACCEPT_NEVER;
992 case kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
994 policy = EWK_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
998 ASSERT(callbackContext->cookiesPolicyGetCallback);
999 callbackContext->cookiesPolicyGetCallback(policy, callbackContext->userData);
1001 delete callbackContext;
1004 Eina_Bool ewk_context_cookies_policy_get(Ewk_Context* ewkContext, Ewk_Cookies_Policy_Get_Callback callback, void* userData)
1006 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1007 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1009 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1010 context->cookiesPolicyGetCallback = callback;
1011 context->userData = userData;
1013 WKCookieManagerRef cookieManager = WKContextGetCookieManager(ewk_context_WKContext_get(ewkContext));
1014 WKCookieManagerGetHTTPCookieAcceptPolicy(cookieManager, context, getCookiesPolicy);
1019 void ewk_context_message_post_to_injected_bundle(Ewk_Context* ewkContext, const char* name, const char* body)
1021 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1022 EINA_SAFETY_ON_NULL_RETURN(name);
1023 EINA_SAFETY_ON_NULL_RETURN(body);
1025 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString(name));
1026 WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithUTF8CString(body));
1027 WKContextPostMessageToInjectedBundle(ewk_context_WKContext_get(ewkContext), messageName.get(), messageBody.get());
1030 void ewk_context_message_from_injected_bundle_callback_set(Ewk_Context* ewkContext, Ewk_Context_Message_From_Injected_Bundle_Callback callback, void* userData)
1032 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1034 ewkContext->messageFromInjectedBundle.callback = callback;
1035 ewkContext->messageFromInjectedBundle.userData = userData;
1038 void ewkContextDidReceiveMessageFromInjectedBundle(Ewk_Context* ewkContext, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData)
1040 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1042 if (!ewkContext->messageFromInjectedBundle.callback)
1045 CString name = toImpl(messageName)->string().utf8();
1047 if (messageBody && WKStringGetTypeID() == WKGetTypeID(messageBody))
1048 body = toImpl(static_cast<WKStringRef>(messageBody))->string().utf8();
1051 char* returnString = 0;
1052 ewkContext->messageFromInjectedBundle.callback(name.data(), body.data(), &returnString,
1053 ewkContext->messageFromInjectedBundle.userData);
1055 *returnData = WKStringCreateWithUTF8CString(returnString);
1058 *returnData = WKStringCreateWithUTF8CString("");
1061 ewkContext->messageFromInjectedBundle.callback(name.data(), body.data(), 0,
1062 ewkContext->messageFromInjectedBundle.userData);
1066 void ewk_context_did_start_download_callback_set(Ewk_Context* ewkContext, Ewk_Context_Did_Start_Download_Callback callback, void* userData)
1068 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1070 ewkContext->didStartDownload.callback = callback;
1071 ewkContext->didStartDownload.userData = userData;
1074 void ewkContextDidStartDownload(Ewk_Context* ewkContext, WKStringRef downloadURL)
1076 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1077 EINA_SAFETY_ON_NULL_RETURN(ewkContext->didStartDownload.callback);
1079 ewkContext->didStartDownload.callback(toImpl(downloadURL)->string().utf8().data(), ewkContext->didStartDownload.userData);
1082 #if ENABLE(MEMORY_SAMPLER)
1083 void ewk_context_memory_sampler_start(Ewk_Context* ewkContext, double timerInterval)
1085 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1086 WKRetainPtr<WKDoubleRef> interval(AdoptWK, WKDoubleCreate(timerInterval));
1087 WKContextStartMemorySampler(ewk_context_WKContext_get(ewkContext), interval.get());
1090 void ewk_context_memory_sampler_stop(Ewk_Context* ewkContext)
1092 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1093 WKContextStopMemorySampler(ewk_context_WKContext_get(ewkContext));
1097 Ewk_Context* ewk_context_default_get()
1099 static Ewk_Context* defaultContext = ewk_context_new();
1101 return defaultContext;