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 "ContextHistoryClientEfl.h"
26 #include "NetworkInfoProvider.h"
27 #include "RequestManagerClientEfl.h"
28 #include "VibrationProvider.h"
29 #include "WKAPICast.h"
30 #include "WKContextSoup.h"
31 #include "WKRetainPtr.h"
33 #include "WebContext.h"
34 #include "WebSoupRequestManagerProxy.h"
35 #include "ewk_context_private.h"
36 #include "ewk_cookie_manager_private.h"
37 #include "ewk_favicon_database_private.h"
38 #include "ewk_url_scheme_request_private.h"
39 #include <WebCore/FileSystem.h>
40 #include <WebCore/IconDatabase.h>
41 #include <wtf/HashMap.h>
42 #include <wtf/text/WTFString.h>
45 #include "WKApplicationCacheManager.h"
47 #include "WKContext.h"
48 #include "WKContextPrivate.h"
49 #include "WKContextTizen.h"
50 #include "WKDatabaseManager.h"
51 #include "WKIconDatabase.h"
52 #include "WKIconDatabaseTizen.h"
53 #include "WKKeyValueStorageManager.h"
54 #if ENABLE(TIZEN_FILE_SYSTEM)
55 #include "WKLocalFileSystemManager.h"
58 #include "WKSecurityOrigin.h"
60 #include "ewk_context_injected_bundle_client.h"
61 #include "ewk_security_origin.h"
62 #include "ewk_private.h"
65 #if ENABLE(TIZEN_WRT_LAUNCHING_PERFORMANCE)
66 #include "ProcessLauncher.h"
70 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
71 #include "FormDatabase.h"
72 #include "WKDictionary.h"
74 #endif // #if OS(TIZEN)
75 #if ENABLE(SPELLCHECK)
76 #include "ewk_settings.h"
77 #include "ewk_text_checker_private.h"
80 #if ENABLE(TIZEN_WEBKIT2_DDK_CHECK)
84 #if ENABLE(TIZEN_HW_MORE_BACK_KEY)
86 void* EflAssistHandle = 0;
89 using namespace WebCore;
90 using namespace WebKit;
92 typedef HashMap<WKContextRef, Ewk_Context*> ContextMap;
94 static inline ContextMap& contextMap()
96 DEFINE_STATIC_LOCAL(ContextMap, map, ());
100 Ewk_Context::Ewk_Context(WKContextRef context)
102 , m_historyClient(ContextHistoryClientEfl::create(context))
104 ContextMap::AddResult result = contextMap().add(context, this);
105 ASSERT_UNUSED(result, result.isNewEntry);
107 #if ENABLE(BATTERY_STATUS)
108 m_batteryProvider = BatteryProvider::create(context);
111 #if ENABLE(NETWORK_INFO)
112 m_networkInfoProvider = NetworkInfoProvider::create(context);
115 #if ENABLE(VIBRATION)
116 m_vibrationProvider = VibrationProvider::create(context);
119 #if ENABLE(MEMORY_SAMPLER)
120 static bool initializeMemorySampler = false;
121 static const char environmentVariable[] = "SAMPLE_MEMORY";
123 if (!initializeMemorySampler && getenv(environmentVariable)) {
124 WKRetainPtr<WKDoubleRef> interval(AdoptWK, WKDoubleCreate(0.0));
125 WKContextStartMemorySampler(context, interval.get());
126 initializeMemorySampler = true;
130 #if ENABLE(SPELLCHECK)
131 Ewk_Text_Checker::initialize();
132 if (ewk_settings_continuous_spell_checking_enabled_get()) {
133 // Load the default language.
134 ewk_settings_spell_checking_languages_set(0);
138 // Initialize WKContext clients.
139 m_downloadManager = DownloadManagerEfl::create(this);
140 m_requestManagerClient = RequestManagerClientEfl::create(this);
143 #if ENABLE(TIZEN_SQL_DATABASE)
144 m_defaultDatabaseQuota = 5 * 1024 * 1024;
146 m_messageFromInjectedBundle.callback = 0;
147 m_messageFromInjectedBundle.userData = 0;
148 m_didStartDownload.callback = 0;
149 m_didStartDownload.userData = 0;
150 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
151 m_formDatabase = FormDatabase::create();
152 m_formDatabase->open(FormDatabase::defaultDatabaseDirectoryPath(), FormDatabase::defaultDatabaseFilename());
156 #if ENABLE(TIZEN_HW_MORE_BACK_KEY)
157 if (!EflAssistHandle)
158 EflAssistHandle = dlopen("/usr/lib/libefl-assist.so.0", RTLD_LAZY);
162 Ewk_Context::~Ewk_Context()
164 ASSERT(contextMap().get(m_context.get()) == this);
166 #if ENABLE(TIZEN_WEB_STORAGE)
169 contextMap().remove(m_context.get());
170 #if ENABLE(TIZEN_CACHE_DUMP_SYNC)
175 PassRefPtr<Ewk_Context> Ewk_Context::create(WKContextRef context)
177 if (contextMap().contains(context))
178 return contextMap().get(context); // Will be ref-ed automatically.
180 return adoptRef(new Ewk_Context(context));
183 PassRefPtr<Ewk_Context> Ewk_Context::create()
185 return create(adoptWK(WKContextCreate()).get());
188 PassRefPtr<Ewk_Context> Ewk_Context::create(const String& injectedBundlePath)
190 if (!fileExists(injectedBundlePath))
193 WKRetainPtr<WKStringRef> injectedBundlePathWK = adoptWK(toCopiedAPI(injectedBundlePath));
194 WKRetainPtr<WKContextRef> contextWK = adoptWK(WKContextCreateWithInjectedBundlePath(injectedBundlePathWK.get()));
196 return create(contextWK.get());
199 PassRefPtr<Ewk_Context> Ewk_Context::defaultContext()
201 static RefPtr<Ewk_Context> defaultInstance = create(adoptWK(WKContextCreate()).get());
203 return defaultInstance;
206 Ewk_Cookie_Manager* Ewk_Context::cookieManager()
208 if (!m_cookieManager)
209 m_cookieManager = Ewk_Cookie_Manager::create(WKContextGetCookieManager(m_context.get()));
211 return m_cookieManager.get();
214 Ewk_Favicon_Database* Ewk_Context::faviconDatabase()
216 #if ENABLE(TIZEN_ICON_DATABASE)
219 if (!m_faviconDatabase) {
220 WKRetainPtr<WKIconDatabaseRef> iconDatabase = WKContextGetIconDatabase(m_context.get());
221 // Set the database path if it is not open yet.
222 if (!toImpl(iconDatabase.get())->isOpen()) {
223 WebContext* webContext = toImpl(m_context.get());
224 String databasePath = webContext->iconDatabasePath() + "/" + WebCore::IconDatabase::defaultDatabaseFilename();
225 webContext->setIconDatabasePath(databasePath);
227 m_faviconDatabase = Ewk_Favicon_Database::create(iconDatabase.get());
230 return m_faviconDatabase.get();
233 RequestManagerClientEfl* Ewk_Context::requestManager()
235 return m_requestManagerClient.get();
238 #if ENABLE(VIBRATION)
239 PassRefPtr<VibrationProvider> Ewk_Context::vibrationProvider()
241 return m_vibrationProvider;
245 void Ewk_Context::addVisitedLink(const String& visitedURL)
247 toImpl(m_context.get())->addVisitedLink(visitedURL);
250 void Ewk_Context::setCacheModel(Ewk_Cache_Model cacheModel)
252 WKContextSetCacheModel(m_context.get(), static_cast<Ewk_Cache_Model>(cacheModel));
255 Ewk_Cache_Model Ewk_Context::cacheModel() const
257 return static_cast<Ewk_Cache_Model>(WKContextGetCacheModel(m_context.get()));
260 Ewk_Context* ewk_context_ref(Ewk_Context* ewkContext)
262 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
269 void ewk_context_unref(Ewk_Context* ewkContext)
271 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
276 Ewk_Cookie_Manager* ewk_context_cookie_manager_get(const Ewk_Context* ewkContext)
278 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
280 return const_cast<Ewk_Context*>(ewkContext)->cookieManager();
283 Ewk_Favicon_Database* ewk_context_favicon_database_get(const Ewk_Context* ewkContext)
285 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
287 return const_cast<Ewk_Context*>(ewkContext)->faviconDatabase();
290 WKContextRef Ewk_Context::wkContext()
292 return m_context.get();
295 DownloadManagerEfl* Ewk_Context::downloadManager() const
297 return m_downloadManager.get();
300 ContextHistoryClientEfl* Ewk_Context::historyClient()
302 return m_historyClient.get();
306 bool Ewk_Context::setProxyAddress(const char* proxyAddress)
308 if (m_proxyAddress == proxyAddress)
311 m_proxyAddress = proxyAddress;
315 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
316 bool Ewk_Context::setCertificateFile(const char* certificateFile)
318 if (m_certificateFile == certificateFile)
321 m_certificateFile = certificateFile;
326 void Ewk_Context::setDefaultDatabaseQuota(uint64_t defaultDatabaseQuota)
328 m_defaultDatabaseQuota = defaultDatabaseQuota;
331 void Ewk_Context::setMessageFromInjectedBundleCallback(Ewk_Context_Message_From_Injected_Bundle_Callback callback, void* userData)
333 m_messageFromInjectedBundle.callback = callback;
334 m_messageFromInjectedBundle.userData = userData;
337 void Ewk_Context::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData)
339 if (!m_messageFromInjectedBundle.callback)
342 CString name = toImpl(messageName)->string().utf8();
344 if (messageBody && WKStringGetTypeID() == WKGetTypeID(messageBody))
345 body = toImpl(static_cast<WKStringRef>(messageBody))->string().utf8();
348 char* returnString = 0;
349 m_messageFromInjectedBundle.callback(name.data(), body.data(), &returnString,
350 m_messageFromInjectedBundle.userData);
352 *returnData = WKStringCreateWithUTF8CString(returnString);
355 *returnData = WKStringCreateWithUTF8CString("");
357 m_messageFromInjectedBundle.callback(name.data(), body.data(), 0, m_messageFromInjectedBundle.userData);
360 void Ewk_Context::setDidStartDownloadCallback(Ewk_Context_Did_Start_Download_Callback callback, void* userData)
362 m_didStartDownload.callback = callback;
363 m_didStartDownload.userData = userData;
366 void Ewk_Context::didStartDownload(WKStringRef downloadURL)
368 EINA_SAFETY_ON_NULL_RETURN(m_didStartDownload.callback);
370 m_didStartDownload.callback(toImpl(downloadURL)->string().utf8().data(), m_didStartDownload.userData);
373 #if ENABLE(TIZEN_CACHE_MEMORY_OPTIMIZATION)
374 void Ewk_Context::clearAllDecodedData()
376 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(wkContext());
377 WKResourceCacheManagerClearCacheForAllOrigins(cacheManager, WKResourceCachesToClearInDecodedDataOnly);
381 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_X_WINDOW)
382 Ecore_X_Window Ewk_Context::xWindow()
387 void Ewk_Context::setXWindow(Ecore_X_Window xWindow)
389 toImpl(wkContext())->setXWindow(xWindow);
393 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
394 void Ewk_Context::addFormData(const char* url, WKDictionaryRef& formData, bool isPasswordForm)
396 EINA_SAFETY_ON_NULL_RETURN(url);
397 if (!m_formDatabase->isOpen())
400 Vector<std::pair<String, String> > formDataVector;
401 WKRetainPtr<WKArrayRef> wkKeys(AdoptWK, WKDictionaryCopyKeys(formData));
402 size_t numKeys = WKArrayGetSize(wkKeys.get());
403 for (size_t i = 0; i < numKeys; ++i) {
404 WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkKeys.get(), i));
405 WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(formData, wkKey));
407 formDataVector.append(pair<String, String>(toImpl(wkKey)->string(), toImpl(wkValue)->string()));
410 m_formDatabase->addFormDataForURL(String::fromUTF8(url), formDataVector, isPasswordForm);
413 void Ewk_Context::passwordFormData(const char* url, Vector<std::pair<String, String> >& passwordFormData)
415 EINA_SAFETY_ON_NULL_RETURN(url);
416 if (!m_formDatabase->isOpen())
418 m_formDatabase->getPasswordFormDataForURL(String::fromUTF8(url), passwordFormData);
421 void Ewk_Context::candidateFormData(const String& name, Vector<String>& candidates)
423 if (!m_formDatabase->isOpen())
425 m_formDatabase->getCandidateFormDataForName(name, candidates);
428 void Ewk_Context::clearPasswordFormData()
430 m_formDatabase->clearPasswordFormData();
433 void Ewk_Context::clearCandidateFormData()
435 m_formDatabase->clearCandidateFormData();
440 #if ENABLE(TIZEN_CACHE_DUMP_SYNC)
443 * Request WebProcess to dump cache.
445 * This sends sync message to WebProcess to dump memory cache, that is, soup cache.
447 * @param context context object
449 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
451 * @note This can effect UIProcess's performance because it calls to sync IPC message eventually.
453 void Ewk_Context::dumpCache()
455 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(wkContext());
456 toImpl(cacheManager)->dumpCache();
460 #if ENABLE(TIZEN_WEB_STORAGE)
463 * Request WebProcess to sync local storage.
465 * This sends message to WebProcess to sync local storage.
467 void Ewk_Context::syncLocalStorage()
469 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(wkContext());
470 WKKeyValueStorageManagerSyncKeyValueStorage(storageManager);
475 Ewk_Context* ewk_context_default_get()
477 return Ewk_Context::defaultContext().get();
481 typedef struct Ewk_Context_Callback_Context
484 #if ENABLE(TIZEN_FILE_SYSTEM)
485 Ewk_Local_File_System_Origins_Get_Callback localFileSystemOriginsCallback;
487 Ewk_Web_Application_Cache_Origins_Get_Callback webApplicationCacheOriginsCallback;
488 Ewk_Web_Application_Cache_Quota_Get_Callback webApplicationCacheQuotaCallback;
489 Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback webApplicationCacheUsageForOriginCallback;
490 Ewk_Web_Application_Cache_Path_Get_Callback webApplicationCachePathCallback;
491 Ewk_Web_Database_Origins_Get_Callback webDatabaseOriginsCallback;
492 Ewk_Web_Database_Quota_Get_Callback webDatabaseQuotaCallback;
493 Ewk_Web_Database_Usage_Get_Callback webDatabaseUsageCallback;
494 Ewk_Web_Database_Path_Get_Callback webDatabasePathCallback;
495 Ewk_Web_Storage_Origins_Get_Callback webStorageOriginsCallback;
496 Ewk_Web_Storage_Usage_Get_Callback webStorageUsageCallback;
497 Ewk_Web_Storage_Path_Get_Callback webStoragePathCallback;
500 } Ewk_Context_Callback_Context;
502 #if ENABLE(TIZEN_SQL_DATABASE)
503 struct Ewk_Context_Exceeded_Quota
505 Ewk_Security_Origin* origin;
506 const char* databaseName;
507 const char* displayName;
508 unsigned long long currentQuota;
509 unsigned long long currentOriginUsage;
510 unsigned long long currentDatabaseUsage;
511 unsigned long long expectedUsage;
512 unsigned long long newQuota;
516 #if ENABLE(TIZEN_SQL_DATABASE)
517 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)
519 Ewk_Context_Exceeded_Quota* exceededQuota = new Ewk_Context_Exceeded_Quota();
521 int length = WKStringGetMaximumUTF8CStringSize(databaseName);
522 OwnArrayPtr<char> databaseNameBuffer = adoptArrayPtr(new char[length]);
523 WKStringGetUTF8CString(databaseName, databaseNameBuffer.get(), length);
525 length = WKStringGetMaximumUTF8CStringSize(displayName);
526 OwnArrayPtr<char> displayNameBuffer = adoptArrayPtr(new char[length]);
527 WKStringGetUTF8CString(displayName, displayNameBuffer.get(), length);
529 exceededQuota->origin = createSecurityOrigin(origin);
530 exceededQuota->databaseName = eina_stringshare_add(databaseNameBuffer.get());
531 exceededQuota->displayName = eina_stringshare_add(displayNameBuffer.get());
532 exceededQuota->currentQuota = currentQuota;
533 exceededQuota->currentOriginUsage = currentOriginUsage;
534 exceededQuota->currentDatabaseUsage = currentDatabaseUsage;
535 exceededQuota->expectedUsage = expectedUsage;
537 return exceededQuota;
540 void ewkContextDeleteExceededQuota(Ewk_Context_Exceeded_Quota* exceededQuota)
542 deleteSecurityOrigin(exceededQuota->origin);
543 eina_stringshare_del(exceededQuota->databaseName);
544 eina_stringshare_del(exceededQuota->displayName);
545 delete exceededQuota;
548 unsigned long long ewkContextGetNewQuotaForExceededQuota(Ewk_Context* ewkContext, Ewk_Context_Exceeded_Quota* exceededQuota)
550 if (exceededQuota->newQuota)
551 return exceededQuota->newQuota + exceededQuota->currentQuota;
553 if (exceededQuota->currentQuota)
554 return exceededQuota->currentQuota;
556 return ewkContext->defaultDatabaseQuota();
559 uint64_t ewkContextGetDatabaseQuota(Ewk_Context* ewkContext)
561 return ewkContext->defaultDatabaseQuota();
566 Ewk_Context* ewk_context_new()
569 Ewk_Context* ewkContext = Ewk_Context::create().leakRef();
570 ewkContextInjectedBundleClientAttachClient(ewkContext);
571 #if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
572 const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH");
573 if (webProcessExecutablePath) {
574 WKContextRef contextRef = ewkContext->wkContext();
575 toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath));
580 return Ewk_Context::create().leakRef();
584 Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path)
586 EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
588 #if ENABLE(TIZEN_WEBKIT2_DDK_CHECK)
589 // FIXME : OpenGL check code for WRT before launching WebProcess.
590 if(!eglGetDisplay(EGL_DEFAULT_DISPLAY)) {
591 EINA_LOG_CRIT("Fail in initiziling view because No DDK is installed.");
596 #if ENABLE(TIZEN_WRT_LAUNCHING_PERFORMANCE)
597 char* wrtLaunchingPerformance = getenv("WRT_LAUNCHING_PERFORMANCE");
598 if (wrtLaunchingPerformance && !strcmp(wrtLaunchingPerformance, "1")) {
599 static bool firstTime = true;
603 if (ProcessLauncher::isInitialFork())
604 ProcessLauncher::setSkipExec(true);
606 ProcessLauncher::setSkipExec(false);
608 ProcessLauncher::forkProcess();
610 if (ProcessLauncher::isParentProcess()) {
611 Ewk_Context* ewkContext = ewk_context_new_with_injected_bundle_path(path);
612 WKContextRef contextRef = ewkContext->wkContext();
613 toImpl(contextRef)->ensureWebProcess();
616 else if (ProcessLauncher::isChildProcess()) {
617 ProcessLauncher::callWebProcessMain();
621 ASSERT_NOT_REACHED();
628 Ewk_Context* ewkContext = Ewk_Context::create(String::fromUTF8(path)).leakRef();
629 ewkContextInjectedBundleClientAttachClient(ewkContext);
630 #if ENABLE(TIZEN_SET_WEB_PROCESS_EXECUTABLE_PATH)
631 const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH");
632 if (webProcessExecutablePath) {
633 WKContextRef contextRef = ewkContext->wkContext();
634 toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath));
639 return Ewk_Context::create(String::fromUTF8(path)).leakRef();
643 void ewk_context_delete(Ewk_Context* ewkContext)
645 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
646 if (ewkContext == ewk_context_default_get() && ewkContext->hasOneRef())
652 void ewk_context_proxy_uri_set(Ewk_Context* ewkContext, const char* proxy)
654 if (ewkContext && ewkContext->setProxyAddress(proxy)) {
655 WKRetainPtr<WKURLRef> proxyAddress(AdoptWK, WKURLCreateWithUTF8CString(proxy));
657 WKContextRef contextRef = ewkContext->wkContext();
658 toImpl(contextRef)->setProxy(toWTFString(proxyAddress.get()));
662 const char* ewk_context_proxy_uri_get(Ewk_Context* ewkContext)
664 #if ENABLE(TIZEN_WEBKIT2_PATCH_FOR_TC)
665 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
667 return ewkContext->proxyAddress();
670 void ewk_context_network_session_requests_cancel(Ewk_Context* ewkContext)
672 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
674 WKContextRef contextRef = ewkContext->wkContext();
675 toImpl(contextRef)->abortSession();
678 Eina_Bool ewk_context_notify_low_memory(Ewk_Context* ewkContext)
680 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
682 WKContextRef contextRef = ewkContext->wkContext();
683 toImpl(contextRef)->notifyLowMemory();
687 #if ENABLE(TIZEN_FILE_SYSTEM)
688 static void didGetLocalFileSystemOrigins(WKArrayRef origins, WKErrorRef error, void* context)
690 Eina_List* originList = 0;
691 for (size_t i = 0; i < WKArrayGetSize(origins); ++i) {
692 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
693 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
694 originList = eina_list_append(originList, origin);
697 Ewk_Context_Callback_Context* locaFileSystemContext = static_cast<Ewk_Context_Callback_Context*>(context);
698 locaFileSystemContext->localFileSystemOriginsCallback(originList, locaFileSystemContext->userData);
699 delete locaFileSystemContext;
703 #if ENABLE(TIZEN_APPLICATION_CACHE)
704 static void didGetWebApplicationOrigins(WKArrayRef origins, WKErrorRef error, void* context)
706 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
707 Eina_List* originList = 0;
709 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
710 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
711 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
712 originList = eina_list_append(originList, origin);
715 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
716 applicationCacheContext->webApplicationCacheOriginsCallback(originList, applicationCacheContext->userData);
717 delete applicationCacheContext;
720 static void didGetWebApplicationPath(WKStringRef path, WKErrorRef error, void* context)
722 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
724 int length = WKStringGetMaximumUTF8CStringSize(path);
725 OwnArrayPtr<char> applicationCachePath = adoptArrayPtr(new char[length]);
726 WKStringGetUTF8CString(path, applicationCachePath.get(), length);
728 TIZEN_LOGI("path (%s)", applicationCachePath.get());
729 applicationCacheContext->webApplicationCachePathCallback(eina_stringshare_add(applicationCachePath.get()), applicationCacheContext->userData);
730 delete applicationCacheContext;
733 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
734 static void didGetWebApplicationQuota(WKInt64Ref quota, WKErrorRef error, void* context)
736 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
737 TIZEN_LOGI("quota (%d)", toImpl(quota)->value());
738 applicationCacheContext->webApplicationCacheQuotaCallback(toImpl(quota)->value(), applicationCacheContext->userData);
739 delete applicationCacheContext;
742 static void didGetWebApplicationUsageForOrigin(WKInt64Ref usage, WKErrorRef error, void* context)
744 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
745 TIZEN_LOGI("usage (%d)", toImpl(usage)->value());
746 applicationCacheContext->webApplicationCacheUsageForOriginCallback(toImpl(usage)->value(), applicationCacheContext->userData);
747 delete applicationCacheContext;
752 #if ENABLE(TIZEN_SQL_DATABASE)
753 static void didGetWebDatabaseOrigins(WKArrayRef origins, WKErrorRef error, void* context)
755 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
756 Eina_List* originList = 0;
758 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
759 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
760 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
761 originList = eina_list_append(originList, origin);
764 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
765 webDatabaseContext->webDatabaseOriginsCallback(originList, webDatabaseContext->userData);
766 delete webDatabaseContext;
769 static void didGetWebDatabaseQuota(WKUInt64Ref quota, WKErrorRef error, void* context)
771 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
772 TIZEN_LOGI("quota (%d)", toImpl(quota)->value());
773 webDatabaseContext->webDatabaseQuotaCallback(toImpl(quota)->value(), webDatabaseContext->userData);
774 delete webDatabaseContext;
777 static void didGetWebDatabaseUsage(WKUInt64Ref usage, WKErrorRef error, void* context)
779 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
780 TIZEN_LOGI("usage (%d)", toImpl(usage)->value());
781 webDatabaseContext->webDatabaseUsageCallback(toImpl(usage)->value(), webDatabaseContext->userData);
782 delete webDatabaseContext;
785 static void didGetWebDatabasePath(WKStringRef path, WKErrorRef error, void * context)
787 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
789 int length = WKStringGetMaximumUTF8CStringSize(path);
790 OwnArrayPtr<char> databasePath = adoptArrayPtr(new char[length]);
791 WKStringGetUTF8CString(path, databasePath.get(), length);
793 TIZEN_LOGI("path (%s)", databasePath.get());
794 webDatabaseContext->webDatabasePathCallback(eina_stringshare_add(databasePath.get()), webDatabaseContext->userData);
795 delete webDatabaseContext;
799 #if ENABLE(TIZEN_WEB_STORAGE)
800 static void didGetWebStorageOrigins(WKArrayRef origins, WKErrorRef error, void* context)
802 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
803 Eina_List* originList = 0;
805 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
806 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
807 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
808 originList = eina_list_append(originList, origin);
811 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
812 webStorageContext->webStorageOriginsCallback(originList, webStorageContext->userData);
813 delete webStorageContext;
816 static void didGetWebStoragePath(WKStringRef path, WKErrorRef error, void * context)
818 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
820 int length = WKStringGetMaximumUTF8CStringSize(path);
821 OwnArrayPtr<char> storagePath = adoptArrayPtr(new char[length]);
822 WKStringGetUTF8CString(path, storagePath.get(), length);
824 TIZEN_LOGI("path (%s)", storagePath.get());
825 webStorageContext->webStoragePathCallback(eina_stringshare_add(storagePath.get()), webStorageContext->userData);
826 delete webStorageContext;
829 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
830 static void didGetWebStorageUsage(WKInt64Ref usage, WKErrorRef error, void* context)
832 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
834 TIZEN_LOGI("usage (%s)", toImpl(usage)->value());
835 webStorageContext->webStorageUsageCallback(toImpl(usage)->value(), webStorageContext->userData);
836 delete webStorageContext;
842 Eina_Bool ewk_context_origins_free(Eina_List* originList)
844 EINA_SAFETY_ON_NULL_RETURN_VAL(originList, false);
847 EINA_LIST_FREE(originList, currentOrigin) {
848 Ewk_Security_Origin* origin = static_cast<Ewk_Security_Origin*>(currentOrigin);
849 deleteSecurityOrigin(origin);
855 Eina_Bool ewk_context_application_cache_delete_all(Ewk_Context* ewkContext)
857 #if ENABLE(TIZEN_APPLICATION_CACHE)
858 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
860 TIZEN_LOGI("ewkContext (%p)", ewkContext);
861 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
862 WKApplicationCacheManagerDeleteAllEntries(applicationCache);
870 Eina_Bool ewk_context_application_cache_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
872 #if ENABLE(TIZEN_APPLICATION_CACHE)
873 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
874 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
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> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
879 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
880 WKApplicationCacheManagerDeleteEntriesForOrigin(applicationCacheRef, securityOriginRef.get());
888 Eina_Bool ewk_context_application_cache_origins_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Origins_Get_Callback callback, void *userData)
890 #if ENABLE(TIZEN_APPLICATION_CACHE)
891 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
892 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
894 TIZEN_LOGI("ewkContext (%p)", ewkContext);
895 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
896 context->webApplicationCacheOriginsCallback = callback;
897 context->userData = userData;
899 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
900 WKApplicationCacheManagerGetApplicationCacheOrigins(applicationCacheRef, context, didGetWebApplicationOrigins);
908 Eina_Bool ewk_context_application_cache_path_set(Ewk_Context* ewkContext, const char* path)
910 #if ENABLE(TIZEN_APPLICATION_CACHE)
911 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
912 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
915 TIZEN_LOGE("Path value is invalid");
919 TIZEN_LOGI("path (%s)", path);
920 WKRetainPtr<WKStringRef> applicationCachePathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
921 WKContextSetApplicationCacheDirectory(ewkContext->wkContext(), applicationCachePathRef.get());
929 Eina_Bool ewk_context_application_cache_path_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Path_Get_Callback callback, void* userData)
931 #if ENABLE(TIZEN_APPLICATION_CACHE)
932 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
933 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
935 TIZEN_LOGI("callback (%p)", callback);
936 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
937 context->webApplicationCachePathCallback= callback;
938 context->userData = userData;
940 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
941 WKApplicationCacheManagerGetApplicationCachePath(applicationCacheRef, context, didGetWebApplicationPath);
948 Eina_Bool ewk_context_application_cache_quota_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Quota_Get_Callback callback, void* userData)
950 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
951 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
952 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
954 TIZEN_LOGI("callback (%p)", callback);
955 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
956 context->webApplicationCacheQuotaCallback = callback;
957 context->userData = userData;
959 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
960 WKApplicationCacheManagerGetApplicationCacheQuota(applicationCacheRef, context, didGetWebApplicationQuota);
968 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)
970 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
971 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
972 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
973 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
975 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
976 context->webApplicationCacheUsageForOriginCallback = callback;
977 context->userData = userData;
978 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
979 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
980 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
982 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
983 WKApplicationCacheManagerGetApplicationCacheUsageForOrigin(applicationCache, context, originRef.get(), didGetWebApplicationUsageForOrigin);
991 Eina_Bool ewk_context_application_cache_quota_set(Ewk_Context* ewkContext, int64_t quota)
993 #if ENABLE(TIZEN_APPLICATION_CACHE)
994 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
996 TIZEN_LOGE("Quota value is invalid");
1000 TIZEN_LOGI("quota (%d)", quota);
1001 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
1002 WKApplicationCacheManagerSetApplicationCacheQuota(applicationCacheRef, quota);
1010 Eina_Bool ewk_context_application_cache_quota_for_origin_set(Ewk_Context* ewkContext, const Ewk_Security_Origin* origin, int64_t quota)
1012 #if ENABLE(TIZEN_APPLICATION_CACHE)
1013 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1014 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1016 TIZEN_LOGE("Quota value is invalid");
1020 TIZEN_LOGI("quota (%d)", quota);
1021 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1022 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1023 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1025 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
1026 WKApplicationCacheManagerSetApplicationCacheQuotaForOrigin(applicationCache, originRef.get(), quota);
1035 Eina_Bool ewk_context_icon_database_path_set(Ewk_Context* ewkContext, const char* path)
1037 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1038 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1040 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1041 WKContextSetIconDatabasePath(ewkContext->wkContext(), databasePath.get());
1046 Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* ewkContext, const char* uri, Evas* canvas)
1048 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
1049 EINA_SAFETY_ON_NULL_RETURN_VAL(uri, 0);
1050 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
1052 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewkContext->wkContext());
1053 WKRetainPtr<WKURLRef> urlString(AdoptWK, WKURLCreateWithUTF8CString(uri));
1055 return WKIconDatabaseTryGetImageForURL(iconDatabase, canvas, urlString.get());
1058 void ewk_context_icon_database_delete_all(Ewk_Context* ewkContext)
1060 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1062 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewkContext->wkContext());
1063 WKIconDatabaseRemoveAllIcons(iconDatabase);
1066 Eina_Bool ewk_context_local_file_system_path_set(Ewk_Context* ewkContext, const char* path)
1068 #if ENABLE(TIZEN_FILE_SYSTEM)
1069 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1070 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1072 TIZEN_LOGI("path (%s)", path);
1073 WKRetainPtr<WKStringRef> localFileSystemPathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
1074 WKContextSetLocalFileSystemDirectory(ewkContext->wkContext(), localFileSystemPathRef.get());
1082 Eina_Bool ewk_context_local_file_system_all_delete(Ewk_Context* ewkContext)
1084 #if ENABLE(TIZEN_FILE_SYSTEM)
1085 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1087 TIZEN_LOGI("ewkContex (%p)", ewkContext);
1088 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(ewkContext->wkContext());
1089 WKLocalFileSystemManagerDeleteAllLocalFileSystem(localFileSystemManager);
1093 UNUSED_PARAM(ewkContext);
1099 Eina_Bool ewk_context_local_file_system_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1101 #if ENABLE(TIZEN_FILE_SYSTEM)
1102 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1103 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1105 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1106 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1107 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1108 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(ewkContext->wkContext());
1110 WKLocalFileSystemManagerDeleteLocalFileSystem(localFileSystemManager, originRef.get());
1114 UNUSED_PARAM(ewkContext);
1115 UNUSED_PARAM(origin);
1121 Eina_Bool ewk_context_local_file_system_origins_get(const Ewk_Context* ewkContext, Ewk_Local_File_System_Origins_Get_Callback callback, void* userData)
1123 #if ENABLE(TIZEN_FILE_SYSTEM)
1124 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1125 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1127 TIZEN_LOGI("callback (%p)", callback);
1128 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1129 context->localFileSystemOriginsCallback= callback;
1130 context->userData = userData;
1131 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(const_cast<Ewk_Context*>(ewkContext)->wkContext());
1133 WKLocalFileSystemManagerGetLocalFileSystemOrigins(localFileSystemManager, context, didGetLocalFileSystemOrigins);
1137 UNUSED_PARAM(ewkContext);
1138 UNUSED_PARAM(callback);
1139 UNUSED_PARAM(userData);
1145 Ewk_Security_Origin* ewk_context_web_database_exceeded_quota_security_origin_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1147 #if ENABLE(TIZEN_SQL_DATABASE)
1148 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1150 return exceededQuota->origin;
1156 const char* ewk_context_web_database_exceeded_quota_database_name_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1158 #if ENABLE(TIZEN_SQL_DATABASE)
1159 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1161 TIZEN_LOGI("name (%s)", exceededQuota->databaseName);
1162 return exceededQuota->databaseName;
1168 const char* ewk_context_web_database_exceeded_quota_display_name_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1170 #if ENABLE(TIZEN_SQL_DATABASE)
1171 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1173 TIZEN_LOGI("displayName (%s)", exceededQuota->displayName);
1174 return exceededQuota->displayName;
1180 unsigned long long ewk_context_web_database_exceeded_quota_current_quota_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1182 #if ENABLE(TIZEN_SQL_DATABASE)
1183 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1185 TIZEN_LOGI("quota (%d)", exceededQuota->currentQuota);
1186 return exceededQuota->currentQuota;
1192 unsigned long long ewk_context_web_database_exceeded_quota_current_origin_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1194 #if ENABLE(TIZEN_SQL_DATABASE)
1195 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1197 TIZEN_LOGI("currentOriginUsage (%d)", exceededQuota->currentOriginUsage);
1198 return exceededQuota->currentOriginUsage;
1204 unsigned long long ewk_context_web_database_exceeded_quota_current_database_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1206 #if ENABLE(TIZEN_SQL_DATABASE)
1207 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1209 TIZEN_LOGI("currentDatabaseUsage (%d)", exceededQuota->currentDatabaseUsage);
1210 return exceededQuota->currentDatabaseUsage;
1216 unsigned long long ewk_context_web_database_exceeded_quota_expected_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1218 #if ENABLE(TIZEN_SQL_DATABASE)
1219 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1221 TIZEN_LOGI("expectedUsage (%d)", exceededQuota->expectedUsage);
1222 return exceededQuota->expectedUsage;
1228 void ewk_context_web_database_exceeded_quota_new_quota_set(Ewk_Context_Exceeded_Quota* exceededQuota, unsigned long long quota)
1230 #if ENABLE(TIZEN_SQL_DATABASE)
1231 EINA_SAFETY_ON_NULL_RETURN(exceededQuota);
1233 TIZEN_LOGI("quota (%d)", quota);
1234 exceededQuota->newQuota = quota;
1238 Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* ewkContext)
1240 #if ENABLE(TIZEN_SQL_DATABASE)
1241 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1243 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1244 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1245 WKDatabaseManagerDeleteAllDatabases(databaseManager);
1253 Eina_Bool ewk_context_web_database_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1255 #if ENABLE(TIZEN_SQL_DATABASE)
1256 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1257 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1259 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1260 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1261 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1262 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1263 WKDatabaseManagerDeleteDatabasesForOrigin(databaseManager, originRef.get());
1271 Eina_Bool ewk_context_web_database_origins_get(Ewk_Context* ewkContext, Ewk_Web_Database_Origins_Get_Callback callback, void* userData)
1273 #if ENABLE(TIZEN_SQL_DATABASE)
1274 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1275 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1277 TIZEN_LOGI("callback (%p)", callback);
1278 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1279 context->webDatabaseOriginsCallback = callback;
1280 context->userData = userData;
1282 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1283 WKDatabaseManagerGetDatabaseOrigins(databaseManager, context, didGetWebDatabaseOrigins);
1291 Eina_Bool ewk_context_web_database_path_set(Ewk_Context* ewkContext, const char* path)
1293 #if ENABLE(TIZEN_SQL_DATABASE)
1294 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1295 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1297 TIZEN_LOGI("path (%s)", path);
1298 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1299 WKContextSetDatabaseDirectory(ewkContext->wkContext(), databasePath.get());
1307 Eina_Bool ewk_context_web_database_path_get(Ewk_Context* ewkContext, Ewk_Web_Database_Path_Get_Callback callback, void* userData)
1309 #if ENABLE(TIZEN_WEB_STORAGE)
1310 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1311 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1313 TIZEN_LOGI("callback (%p)", callback);
1314 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1315 context->webDatabasePathCallback= callback;
1316 context->userData = userData;
1318 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1319 WKDatabaseManagerGetDatabasePath(databaseManager, context, didGetWebDatabasePath);
1325 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)
1327 #if ENABLE(TIZEN_SQL_DATABASE)
1328 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1329 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1330 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1332 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1333 context->webDatabaseQuotaCallback = callback;
1334 context->userData = userData;
1336 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1337 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1338 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1339 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1340 WKDatabaseManagerGetQuotaForOrigin(databaseManager, context, didGetWebDatabaseQuota, originRef.get());
1348 Eina_Bool ewk_context_web_database_default_quota_set(Ewk_Context* ewkContext, uint64_t quota)
1350 #if ENABLE(TIZEN_SQL_DATABASE)
1351 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1353 TIZEN_LOGI("quota (%d)", quota);
1354 ewkContext->setDefaultDatabaseQuota(quota);
1362 Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* ewkContext, Ewk_Security_Origin* origin, uint64_t quota)
1364 #if ENABLE(TIZEN_SQL_DATABASE)
1365 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1366 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1368 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1369 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1370 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1371 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1372 WKDatabaseManagerSetQuotaForOrigin(databaseManager, originRef.get(), quota);
1380 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)
1382 #if ENABLE(TIZEN_SQL_DATABASE)
1383 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1384 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1385 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1387 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1388 context->webDatabaseQuotaCallback = callback;
1389 context->userData = userData;
1391 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1392 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1393 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1394 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1395 WKDatabaseManagerGetUsageForOrigin(databaseManager, context, didGetWebDatabaseUsage, originRef.get());
1403 Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* ewkContext)
1405 #if ENABLE(TIZEN_INDEXED_DATABASE)
1406 WKContextDeleteIndexedDatabaseAll(ewkContext->wkContext());
1414 Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* ewkContext)
1416 #if ENABLE(TIZEN_WEB_STORAGE)
1417 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1419 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1420 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1421 WKKeyValueStorageManagerDeleteAllEntries(storageManager);
1429 Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1431 #if ENABLE(TIZEN_WEB_STORAGE)
1432 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1433 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1435 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1436 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1437 WKRetainPtr<WKSecurityOriginRef> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1438 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1439 WKKeyValueStorageManagerDeleteEntriesForOrigin(storageManager, securityOriginRef.get());
1447 Eina_Bool ewk_context_web_storage_origins_get(Ewk_Context* ewkContext, Ewk_Web_Storage_Origins_Get_Callback callback, void* userData)
1449 #if ENABLE(TIZEN_WEB_STORAGE)
1450 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1451 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1453 TIZEN_LOGI("callback (%p)", callback);
1454 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1455 context->webStorageOriginsCallback = callback;
1456 context->userData = userData;
1458 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1459 WKKeyValueStorageManagerGetKeyValueStorageOrigins(storageManager, context, didGetWebStorageOrigins);
1467 Eina_Bool ewk_context_web_storage_path_set(Ewk_Context* ewkContext, const char* path)
1469 #if ENABLE(TIZEN_WEB_STORAGE)
1470 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1471 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1473 TIZEN_LOGI("path (%s)", path);
1474 WKRetainPtr<WKStringRef> webStoragePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1475 WKContextSetLocalStorageDirectory(ewkContext->wkContext(), webStoragePath.get());
1483 Eina_Bool ewk_context_web_storage_path_get(Ewk_Context* ewkContext, Ewk_Web_Storage_Path_Get_Callback callback, void* userData)
1485 #if ENABLE(TIZEN_WEB_STORAGE)
1486 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1487 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1489 TIZEN_LOGI("callback (%p)", callback);
1490 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1491 context->webStoragePathCallback= callback;
1492 context->userData = userData;
1494 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1495 WKKeyValueStorageManagerGetKeyValueStoragePath(storageManager, context, didGetWebStoragePath);
1501 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)
1503 #if ENABLE(TIZEN_WEB_STORAGE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
1504 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1505 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1506 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1508 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1509 context->webStorageUsageCallback = callback;
1510 context->userData = userData;
1511 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1512 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1513 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1515 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1516 WKKeyValueStorageManagerGetKeyValueStorageUsageForOrigin(storageManager, context, didGetWebStorageUsage, originRef.get());
1524 //#if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2)
1525 Eina_Bool ewk_context_soup_data_directory_set(Ewk_Context* ewkContext, const char* path)
1527 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1528 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1530 WKRetainPtr<WKStringRef> soupDataDirectory(AdoptWK, WKStringCreateWithUTF8CString(path));
1531 WKContextSetSoupDataDirectory(ewkContext->wkContext(), soupDataDirectory.get());
1536 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_DOCUMENT_VIEWER, kWKCacheModelDocumentViewer);
1537 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_DOCUMENT_BROWSER, kWKCacheModelDocumentBrowser);
1538 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_PRIMARY_WEBBROWSER, kWKCacheModelPrimaryWebBrowser);
1540 Eina_Bool ewk_context_cache_model_set(Ewk_Context* ewkContext, Ewk_Cache_Model cacheModel)
1542 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1544 ewkContext->setCacheModel(cacheModel);
1549 Ewk_Cache_Model ewk_context_cache_model_get(Ewk_Context* ewkContext)
1551 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, EWK_CACHE_MODEL_DOCUMENT_VIEWER);
1553 return ewkContext->cacheModel();
1556 Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* ewkContext, Eina_Bool cacheDisabled)
1558 #if ENABLE(TIZEN_CACHE_CONTROL)
1559 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1560 WKContextSetCacheDisabled(ewkContext->wkContext(), cacheDisabled);
1566 Eina_Bool ewk_context_cache_disabled_get(Ewk_Context* ewkContext)
1568 #if ENABLE(TIZEN_CACHE_CONTROL)
1569 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1570 return WKContextGetCacheDisabled(ewkContext->wkContext());
1576 Eina_Bool ewk_context_certificate_file_set(Ewk_Context* context, const char* certificateFile)
1578 EINA_SAFETY_ON_NULL_RETURN_VAL(context, false);
1579 EINA_SAFETY_ON_NULL_RETURN_VAL(certificateFile, false);
1580 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
1581 if (!context->setCertificateFile(certificateFile))
1584 if (fileExists(WTF::String::fromUTF8(certificateFile))) {
1585 long long fileSize = -1;
1586 getFileSize(WTF::String::fromUTF8(certificateFile), fileSize);
1587 TIZEN_LOGE("[Network] ewk_context_certificate_file_set certificateFile fileSize [%lld]\n", fileSize);
1589 TIZEN_LOGE("[Network] ewk_context_certificate_file_set certificateFile does not exist!\n");
1591 WKRetainPtr<WKStringRef> certificateFileRef(AdoptWK, WKStringCreateWithUTF8CString(certificateFile));
1592 WKContextSetCertificateFile(context->wkContext(), certificateFileRef.get());
1595 UNUSED_PARAM(context);
1596 UNUSED_PARAM(certificateFile);
1601 const char* ewk_context_certificate_file_get(const Ewk_Context* context)
1603 EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0);
1604 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
1605 return context->certificateFile();
1607 UNUSED_PARAM(context);
1612 Eina_Bool ewk_context_cache_clear(Ewk_Context* ewkContext)
1614 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1615 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(ewkContext->wkContext());
1616 #if ENABLE(TIZEN_EWK_CONTEXT_CACHE_MANAGER_NULL_CHECK_WORKAROUND)
1620 WKResourceCacheManagerClearCacheForAllOrigins(cacheManager, WKResourceCachesToClearAll);
1625 void ewk_context_message_post_to_injected_bundle(Ewk_Context* ewkContext, const char* name, const char* body)
1627 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1628 EINA_SAFETY_ON_NULL_RETURN(name);
1629 EINA_SAFETY_ON_NULL_RETURN(body);
1631 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString(name));
1632 WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithUTF8CString(body));
1633 WKContextPostMessageToInjectedBundle(ewkContext->wkContext(), messageName.get(), messageBody.get());
1636 void ewk_context_message_from_injected_bundle_callback_set(Ewk_Context* ewkContext, Ewk_Context_Message_From_Injected_Bundle_Callback callback, void* userData)
1638 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1640 ewkContext->setMessageFromInjectedBundleCallback(callback, userData);
1643 void ewk_context_did_start_download_callback_set(Ewk_Context* ewkContext, Ewk_Context_Did_Start_Download_Callback callback, void* userData)
1645 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1647 ewkContext->setDidStartDownloadCallback(callback, userData);
1650 #if ENABLE(MEMORY_SAMPLER)
1651 void ewk_context_memory_sampler_start(Ewk_Context* ewkContext, double timerInterval)
1653 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1654 WKRetainPtr<WKDoubleRef> interval(AdoptWK, WKDoubleCreate(timerInterval));
1655 WKContextStartMemorySampler(ewkContext->wkContext(), interval.get());
1658 void ewk_context_memory_sampler_stop(Ewk_Context* ewkContext)
1660 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1661 WKContextStopMemorySampler(ewkContext->wkContext());
1665 Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context* ewkContext, const char* path)
1667 #if ENABLE(TIZEN_SUPPORT_PLUGINS)
1668 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1669 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1671 WKRetainPtr<WKStringRef> pluginPath(AdoptWK, WKStringCreateWithUTF8CString(path));
1672 WKContextSetAdditionalPluginsDirectory(ewkContext->wkContext(), pluginPath.get());
1680 #if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE)
1681 void ewk_context_memory_saving_mode_set(Ewk_Context* ewkContext, Eina_Bool mode)
1683 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1685 WKContextRef contextRef = ewkContext->wkContext();
1686 toImpl(contextRef)->setMemorySavingMode(mode);
1690 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
1691 void ewk_context_form_password_data_clear(Ewk_Context* ewkContext)
1693 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1694 ewkContext->clearPasswordFormData();
1697 void ewk_context_form_candidate_data_clear(Ewk_Context* ewkContext)
1699 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1700 ewkContext->clearCandidateFormData();
1703 #endif // #if OS(TIZEN)
1705 Eina_Bool ewk_context_url_scheme_register(Ewk_Context* ewkContext, const char* scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
1707 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1708 EINA_SAFETY_ON_NULL_RETURN_VAL(scheme, false);
1709 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1711 ewkContext->requestManager()->registerURLSchemeHandler(String::fromUTF8(scheme), callback, userData);
1716 void ewk_context_vibration_client_callbacks_set(Ewk_Context* ewkContext, Ewk_Vibration_Client_Vibrate_Cb vibrate, Ewk_Vibration_Client_Vibration_Cancel_Cb cancel, void* data)
1718 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1720 TIZEN_LOGI("vibrate (%p)", vibrate);
1721 #if ENABLE(VIBRATION)
1722 ewkContext->vibrationProvider()->setVibrationClientCallbacks(vibrate, cancel, data);
1726 Eina_Bool ewk_context_tizen_extensible_api_set(Ewk_Context* ewkContext, Ewk_Extensible_API extensibleAPI, Eina_Bool enable)
1728 #if ENABLE(TIZEN_EXTENSIBLE_API)
1729 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1731 TIZEN_LOGI("extensibleAPI (%d) enable (%d)", extensibleAPI, enable);
1732 WKContextSetTizenExtensibleAPI(ewkContext->wkContext(), static_cast<WKTizenExtensibleAPI>(extensibleAPI), enable);
1736 UNUSED_PARAM(ewkContext);
1737 UNUSED_PARAM(extensibleAPI);
1738 UNUSED_PARAM(enable);
1744 void ewk_context_storage_path_reset(Ewk_Context* ewkContext)
1746 #if ENABLE(TIZEN_RESET_PATH)
1747 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1749 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1750 WKContextResetStoragePath(ewkContext->wkContext());
1752 UNUSED_PARAM(ewkContext);
1756 void ewk_context_history_callbacks_set(Ewk_Context* ewkContext, Ewk_History_Navigation_Cb navigate, Ewk_History_Client_Redirection_Cb clientRedirect, Ewk_History_Server_Redirection_Cb serverRedirect, Ewk_History_Title_Update_Cb titleUpdate, Ewk_History_Populate_Visited_Links_Cb populateVisitedLinks, void* data)
1758 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1760 ewkContext->historyClient()->setCallbacks(navigate, clientRedirect, serverRedirect, titleUpdate, populateVisitedLinks, data);
1763 void ewk_context_visited_link_add(Ewk_Context* ewkContext, const char* visitedURL)
1765 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1766 EINA_SAFETY_ON_NULL_RETURN(visitedURL);
1768 ewkContext->addVisitedLink(visitedURL);