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 using namespace WebCore;
85 using namespace WebKit;
87 typedef HashMap<WKContextRef, Ewk_Context*> ContextMap;
89 static inline ContextMap& contextMap()
91 DEFINE_STATIC_LOCAL(ContextMap, map, ());
95 Ewk_Context::Ewk_Context(WKContextRef context)
97 , m_historyClient(ContextHistoryClientEfl::create(context))
99 ContextMap::AddResult result = contextMap().add(context, this);
100 ASSERT_UNUSED(result, result.isNewEntry);
102 #if ENABLE(BATTERY_STATUS)
103 m_batteryProvider = BatteryProvider::create(context);
106 #if ENABLE(NETWORK_INFO)
107 m_networkInfoProvider = NetworkInfoProvider::create(context);
110 #if ENABLE(VIBRATION)
111 m_vibrationProvider = VibrationProvider::create(context);
114 #if ENABLE(MEMORY_SAMPLER)
115 static bool initializeMemorySampler = false;
116 static const char environmentVariable[] = "SAMPLE_MEMORY";
118 if (!initializeMemorySampler && getenv(environmentVariable)) {
119 WKRetainPtr<WKDoubleRef> interval(AdoptWK, WKDoubleCreate(0.0));
120 WKContextStartMemorySampler(context, interval.get());
121 initializeMemorySampler = true;
125 #if ENABLE(SPELLCHECK)
126 Ewk_Text_Checker::initialize();
127 if (ewk_settings_continuous_spell_checking_enabled_get()) {
128 // Load the default language.
129 ewk_settings_spell_checking_languages_set(0);
133 // Initialize WKContext clients.
134 m_downloadManager = DownloadManagerEfl::create(this);
135 m_requestManagerClient = RequestManagerClientEfl::create(this);
138 #if ENABLE(TIZEN_SQL_DATABASE)
139 m_defaultDatabaseQuota = 5 * 1024 * 1024;
141 m_messageFromInjectedBundle.callback = 0;
142 m_messageFromInjectedBundle.userData = 0;
143 m_didStartDownload.callback = 0;
144 m_didStartDownload.userData = 0;
145 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
146 m_formDatabase = FormDatabase::create();
147 m_formDatabase->open(FormDatabase::defaultDatabaseDirectoryPath(), FormDatabase::defaultDatabaseFilename());
152 Ewk_Context::~Ewk_Context()
154 ASSERT(contextMap().get(m_context.get()) == this);
155 contextMap().remove(m_context.get());
156 #if ENABLE(TIZEN_CACHE_DUMP_SYNC)
161 PassRefPtr<Ewk_Context> Ewk_Context::create(WKContextRef context)
163 if (contextMap().contains(context))
164 return contextMap().get(context); // Will be ref-ed automatically.
166 return adoptRef(new Ewk_Context(context));
169 PassRefPtr<Ewk_Context> Ewk_Context::create()
171 return create(adoptWK(WKContextCreate()).get());
174 PassRefPtr<Ewk_Context> Ewk_Context::create(const String& injectedBundlePath)
176 if (!fileExists(injectedBundlePath))
179 WKRetainPtr<WKStringRef> injectedBundlePathWK = adoptWK(toCopiedAPI(injectedBundlePath));
180 WKRetainPtr<WKContextRef> contextWK = adoptWK(WKContextCreateWithInjectedBundlePath(injectedBundlePathWK.get()));
182 return create(contextWK.get());
185 PassRefPtr<Ewk_Context> Ewk_Context::defaultContext()
187 static RefPtr<Ewk_Context> defaultInstance = create(adoptWK(WKContextCreate()).get());
189 return defaultInstance;
192 Ewk_Cookie_Manager* Ewk_Context::cookieManager()
194 if (!m_cookieManager)
195 m_cookieManager = Ewk_Cookie_Manager::create(WKContextGetCookieManager(m_context.get()));
197 return m_cookieManager.get();
200 Ewk_Favicon_Database* Ewk_Context::faviconDatabase()
202 if (!m_faviconDatabase) {
203 WKRetainPtr<WKIconDatabaseRef> iconDatabase = WKContextGetIconDatabase(m_context.get());
204 // Set the database path if it is not open yet.
205 if (!toImpl(iconDatabase.get())->isOpen()) {
206 WebContext* webContext = toImpl(m_context.get());
207 String databasePath = webContext->iconDatabasePath() + "/" + WebCore::IconDatabase::defaultDatabaseFilename();
208 webContext->setIconDatabasePath(databasePath);
210 m_faviconDatabase = Ewk_Favicon_Database::create(iconDatabase.get());
213 return m_faviconDatabase.get();
216 RequestManagerClientEfl* Ewk_Context::requestManager()
218 return m_requestManagerClient.get();
221 #if ENABLE(VIBRATION)
222 PassRefPtr<VibrationProvider> Ewk_Context::vibrationProvider()
224 return m_vibrationProvider;
228 void Ewk_Context::addVisitedLink(const String& visitedURL)
230 toImpl(m_context.get())->addVisitedLink(visitedURL);
233 void Ewk_Context::setCacheModel(Ewk_Cache_Model cacheModel)
235 WKContextSetCacheModel(m_context.get(), static_cast<Ewk_Cache_Model>(cacheModel));
238 Ewk_Cache_Model Ewk_Context::cacheModel() const
240 return static_cast<Ewk_Cache_Model>(WKContextGetCacheModel(m_context.get()));
243 Ewk_Context* ewk_context_ref(Ewk_Context* ewkContext)
245 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
252 void ewk_context_unref(Ewk_Context* ewkContext)
254 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
259 Ewk_Cookie_Manager* ewk_context_cookie_manager_get(const Ewk_Context* ewkContext)
261 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
263 return const_cast<Ewk_Context*>(ewkContext)->cookieManager();
266 Ewk_Favicon_Database* ewk_context_favicon_database_get(const Ewk_Context* ewkContext)
268 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
270 return const_cast<Ewk_Context*>(ewkContext)->faviconDatabase();
273 WKContextRef Ewk_Context::wkContext()
275 return m_context.get();
278 DownloadManagerEfl* Ewk_Context::downloadManager() const
280 return m_downloadManager.get();
283 ContextHistoryClientEfl* Ewk_Context::historyClient()
285 return m_historyClient.get();
289 bool Ewk_Context::setProxyAddress(const char* proxyAddress)
291 if (m_proxyAddress == proxyAddress)
294 m_proxyAddress = proxyAddress;
298 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
299 bool Ewk_Context::setCertificateFile(const char* certificateFile)
301 if (m_certificateFile == certificateFile)
304 m_certificateFile = certificateFile;
309 void Ewk_Context::setDefaultDatabaseQuota(uint64_t defaultDatabaseQuota)
311 m_defaultDatabaseQuota = defaultDatabaseQuota;
314 void Ewk_Context::setMessageFromInjectedBundleCallback(Ewk_Context_Message_From_Injected_Bundle_Callback callback, void* userData)
316 m_messageFromInjectedBundle.callback = callback;
317 m_messageFromInjectedBundle.userData = userData;
320 void Ewk_Context::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData)
322 if (!m_messageFromInjectedBundle.callback)
325 CString name = toImpl(messageName)->string().utf8();
327 if (messageBody && WKStringGetTypeID() == WKGetTypeID(messageBody))
328 body = toImpl(static_cast<WKStringRef>(messageBody))->string().utf8();
331 char* returnString = 0;
332 m_messageFromInjectedBundle.callback(name.data(), body.data(), &returnString,
333 m_messageFromInjectedBundle.userData);
335 *returnData = WKStringCreateWithUTF8CString(returnString);
338 *returnData = WKStringCreateWithUTF8CString("");
340 m_messageFromInjectedBundle.callback(name.data(), body.data(), 0, m_messageFromInjectedBundle.userData);
343 void Ewk_Context::setDidStartDownloadCallback(Ewk_Context_Did_Start_Download_Callback callback, void* userData)
345 m_didStartDownload.callback = callback;
346 m_didStartDownload.userData = userData;
349 void Ewk_Context::didStartDownload(WKStringRef downloadURL)
351 EINA_SAFETY_ON_NULL_RETURN(m_didStartDownload.callback);
353 m_didStartDownload.callback(toImpl(downloadURL)->string().utf8().data(), m_didStartDownload.userData);
356 #if ENABLE(TIZEN_CACHE_MEMORY_OPTIMIZATION)
357 void Ewk_Context::clearAllDecodedData()
359 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(wkContext());
360 WKResourceCacheManagerClearCacheForAllOrigins(cacheManager, WKResourceCachesToClearInDecodedDataOnly);
364 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_X_WINDOW)
365 Ecore_X_Window Ewk_Context::xWindow()
370 void Ewk_Context::setXWindow(Ecore_X_Window xWindow)
372 toImpl(wkContext())->setXWindow(xWindow);
376 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
377 void Ewk_Context::addFormData(const char* url, WKDictionaryRef& formData, bool isPasswordForm)
379 EINA_SAFETY_ON_NULL_RETURN(url);
380 if (!m_formDatabase->isOpen())
383 Vector<std::pair<String, String> > formDataVector;
384 WKRetainPtr<WKArrayRef> wkKeys(AdoptWK, WKDictionaryCopyKeys(formData));
385 size_t numKeys = WKArrayGetSize(wkKeys.get());
386 for (size_t i = 0; i < numKeys; ++i) {
387 WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkKeys.get(), i));
388 WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(formData, wkKey));
390 int length = WKStringGetMaximumUTF8CStringSize(wkKey);
393 OwnArrayPtr<char> keyBuffer = adoptArrayPtr(new char[length]);
394 WKStringGetUTF8CString(wkKey, keyBuffer.get(), length);
396 length = WKStringGetMaximumUTF8CStringSize(wkValue);
399 OwnArrayPtr<char> valueBuffer = adoptArrayPtr(new char[length]);
400 WKStringGetUTF8CString(wkValue, valueBuffer.get(), length);
401 formDataVector.append(pair<String, String>(keyBuffer.get(), valueBuffer.get()));
404 m_formDatabase->addFormDataForURL(String::fromUTF8(url), formDataVector, isPasswordForm);
407 void Ewk_Context::passwordFormData(const char* url, Vector<std::pair<String, String> >& passwordFormData)
409 EINA_SAFETY_ON_NULL_RETURN(url);
410 if (!m_formDatabase->isOpen())
412 m_formDatabase->getPasswordFormDataForURL(String::fromUTF8(url), passwordFormData);
415 void Ewk_Context::candidateFormData(const String& name, Vector<String>& candidates)
417 if (!m_formDatabase->isOpen())
419 m_formDatabase->getCandidateFormDataForName(name, candidates);
422 void Ewk_Context::clearPasswordFormData()
424 m_formDatabase->clearPasswordFormData();
427 void Ewk_Context::clearCandidateFormData()
429 m_formDatabase->clearCandidateFormData();
434 #if ENABLE(TIZEN_CACHE_DUMP_SYNC)
437 * Request WebProcess to dump cache.
439 * This sends sync message to WebProcess to dump memory cache, that is, soup cache.
441 * @param context context object
443 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
445 * @note This can effect UIProcess's performance because it calls to sync IPC message eventually.
447 void Ewk_Context::dumpCache()
449 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(wkContext());
450 toImpl(cacheManager)->dumpCache();
455 Ewk_Context* ewk_context_default_get()
457 return Ewk_Context::defaultContext().get();
461 typedef struct Ewk_Context_Callback_Context
464 #if ENABLE(TIZEN_FILE_SYSTEM)
465 Ewk_Local_File_System_Origins_Get_Callback localFileSystemOriginsCallback;
467 Ewk_Web_Application_Cache_Origins_Get_Callback webApplicationCacheOriginsCallback;
468 Ewk_Web_Application_Cache_Quota_Get_Callback webApplicationCacheQuotaCallback;
469 Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback webApplicationCacheUsageForOriginCallback;
470 Ewk_Web_Application_Cache_Path_Get_Callback webApplicationCachePathCallback;
471 Ewk_Web_Database_Origins_Get_Callback webDatabaseOriginsCallback;
472 Ewk_Web_Database_Quota_Get_Callback webDatabaseQuotaCallback;
473 Ewk_Web_Database_Usage_Get_Callback webDatabaseUsageCallback;
474 Ewk_Web_Database_Path_Get_Callback webDatabasePathCallback;
475 Ewk_Web_Storage_Origins_Get_Callback webStorageOriginsCallback;
476 Ewk_Web_Storage_Usage_Get_Callback webStorageUsageCallback;
477 Ewk_Web_Storage_Path_Get_Callback webStoragePathCallback;
480 } Ewk_Context_Callback_Context;
482 #if ENABLE(TIZEN_SQL_DATABASE)
483 struct Ewk_Context_Exceeded_Quota
485 Ewk_Security_Origin* origin;
486 const char* databaseName;
487 const char* displayName;
488 unsigned long long currentQuota;
489 unsigned long long currentOriginUsage;
490 unsigned long long currentDatabaseUsage;
491 unsigned long long expectedUsage;
492 unsigned long long newQuota;
496 #if ENABLE(TIZEN_SQL_DATABASE)
497 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)
499 Ewk_Context_Exceeded_Quota* exceededQuota = new Ewk_Context_Exceeded_Quota();
501 int length = WKStringGetMaximumUTF8CStringSize(databaseName);
502 OwnArrayPtr<char> databaseNameBuffer = adoptArrayPtr(new char[length]);
503 WKStringGetUTF8CString(databaseName, databaseNameBuffer.get(), length);
505 length = WKStringGetMaximumUTF8CStringSize(displayName);
506 OwnArrayPtr<char> displayNameBuffer = adoptArrayPtr(new char[length]);
507 WKStringGetUTF8CString(displayName, displayNameBuffer.get(), length);
509 exceededQuota->origin = createSecurityOrigin(origin);
510 exceededQuota->databaseName = eina_stringshare_add(databaseNameBuffer.get());
511 exceededQuota->displayName = eina_stringshare_add(displayNameBuffer.get());
512 exceededQuota->currentQuota = currentQuota;
513 exceededQuota->currentOriginUsage = currentOriginUsage;
514 exceededQuota->currentDatabaseUsage = currentDatabaseUsage;
515 exceededQuota->expectedUsage = expectedUsage;
517 return exceededQuota;
520 void ewkContextDeleteExceededQuota(Ewk_Context_Exceeded_Quota* exceededQuota)
522 deleteSecurityOrigin(exceededQuota->origin);
523 eina_stringshare_del(exceededQuota->databaseName);
524 eina_stringshare_del(exceededQuota->displayName);
525 delete exceededQuota;
528 unsigned long long ewkContextGetNewQuotaForExceededQuota(Ewk_Context* ewkContext, Ewk_Context_Exceeded_Quota* exceededQuota)
530 if (exceededQuota->newQuota)
531 return exceededQuota->newQuota + exceededQuota->currentQuota;
533 if (exceededQuota->currentQuota)
534 return exceededQuota->currentQuota;
536 return ewkContext->defaultDatabaseQuota();
539 uint64_t ewkContextGetDatabaseQuota(Ewk_Context* ewkContext)
541 return ewkContext->defaultDatabaseQuota();
546 Ewk_Context* ewk_context_new()
549 Ewk_Context* ewk_context = Ewk_Context::create().leakRef();
550 ewkContextInjectedBundleClientAttachClient(ewk_context);
553 return Ewk_Context::create().leakRef();
556 Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path)
558 EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
560 #if ENABLE(TIZEN_WEBKIT2_DDK_CHECK)
561 // FIXME : OpenGL check code for WRT before launching WebProcess.
562 if(!eglGetDisplay(EGL_DEFAULT_DISPLAY)) {
563 EINA_LOG_CRIT("Fail in initiziling view because No DDK is installed.");
568 #if ENABLE(TIZEN_WRT_LAUNCHING_PERFORMANCE)
569 char* wrtLaunchingPerformance = getenv("WRT_LAUNCHING_PERFORMANCE");
570 if (wrtLaunchingPerformance && !strcmp(wrtLaunchingPerformance, "1")) {
571 static bool firstTime = true;
575 if (ProcessLauncher::isInitialFork())
576 ProcessLauncher::setSkipExec(true);
578 ProcessLauncher::setSkipExec(false);
580 ProcessLauncher::forkProcess();
582 if (ProcessLauncher::isParentProcess()) {
583 Ewk_Context* ewkContext = ewk_context_new_with_injected_bundle_path(path);
584 WKContextRef contextRef = ewkContext->wkContext();
585 toImpl(contextRef)->ensureWebProcess();
588 else if (ProcessLauncher::isChildProcess()) {
589 ProcessLauncher::callWebProcessMain();
593 ASSERT_NOT_REACHED();
600 Ewk_Context* ewk_context = Ewk_Context::create(String::fromUTF8(path)).leakRef();
601 ewkContextInjectedBundleClientAttachClient(ewk_context);
604 return Ewk_Context::create(String::fromUTF8(path)).leakRef();
607 void ewk_context_delete(Ewk_Context* ewkContext)
609 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
610 if (ewkContext == ewk_context_default_get() && ewkContext->hasOneRef())
616 void ewk_context_proxy_uri_set(Ewk_Context* ewkContext, const char* proxy)
618 if (ewkContext && ewkContext->setProxyAddress(proxy)) {
619 WKRetainPtr<WKURLRef> proxyAddress(AdoptWK, WKURLCreateWithUTF8CString(proxy));
621 WKContextRef contextRef = ewkContext->wkContext();
622 toImpl(contextRef)->setProxy(toWTFString(proxyAddress.get()));
626 const char* ewk_context_proxy_uri_get(Ewk_Context* ewkContext)
628 #if ENABLE(TIZEN_WEBKIT2_PATCH_FOR_TC)
629 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
631 return ewkContext->proxyAddress();
634 void ewk_context_network_session_requests_cancel(Ewk_Context* ewkContext)
636 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
638 WKContextRef contextRef = ewkContext->wkContext();
639 toImpl(contextRef)->abortSession();
642 Eina_Bool ewk_context_notify_low_memory(Ewk_Context* ewkContext)
644 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
646 WKContextRef contextRef = ewkContext->wkContext();
647 toImpl(contextRef)->notifyLowMemory();
651 #if ENABLE(TIZEN_FILE_SYSTEM)
652 static void didGetLocalFileSystemOrigins(WKArrayRef origins, WKErrorRef error, void* context)
654 Eina_List* originList = 0;
655 for (size_t i = 0; i < WKArrayGetSize(origins); ++i) {
656 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
657 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
658 originList = eina_list_append(originList, origin);
661 Ewk_Context_Callback_Context* locaFileSystemContext = static_cast<Ewk_Context_Callback_Context*>(context);
662 locaFileSystemContext->localFileSystemOriginsCallback(originList, locaFileSystemContext->userData);
663 delete locaFileSystemContext;
667 #if ENABLE(TIZEN_APPLICATION_CACHE)
668 static void didGetWebApplicationOrigins(WKArrayRef origins, WKErrorRef error, void* context)
670 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
671 Eina_List* originList = 0;
673 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
674 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
675 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
676 originList = eina_list_append(originList, origin);
679 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
680 applicationCacheContext->webApplicationCacheOriginsCallback(originList, applicationCacheContext->userData);
681 delete applicationCacheContext;
684 static void didGetWebApplicationPath(WKStringRef path, WKErrorRef error, void* context)
686 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
688 int length = WKStringGetMaximumUTF8CStringSize(path);
689 OwnArrayPtr<char> applicationCachePath = adoptArrayPtr(new char[length]);
690 WKStringGetUTF8CString(path, applicationCachePath.get(), length);
692 TIZEN_LOGI("path (%s)", applicationCachePath.get());
693 applicationCacheContext->webApplicationCachePathCallback(eina_stringshare_add(applicationCachePath.get()), applicationCacheContext->userData);
694 delete applicationCacheContext;
697 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
698 static void didGetWebApplicationQuota(WKInt64Ref quota, WKErrorRef error, void* context)
700 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
701 TIZEN_LOGI("quota (%d)", toImpl(quota)->value());
702 applicationCacheContext->webApplicationCacheQuotaCallback(toImpl(quota)->value(), applicationCacheContext->userData);
703 delete applicationCacheContext;
706 static void didGetWebApplicationUsageForOrigin(WKInt64Ref usage, WKErrorRef error, void* context)
708 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
709 TIZEN_LOGI("usage (%d)", toImpl(usage)->value());
710 applicationCacheContext->webApplicationCacheUsageForOriginCallback(toImpl(usage)->value(), applicationCacheContext->userData);
711 delete applicationCacheContext;
716 #if ENABLE(TIZEN_SQL_DATABASE)
717 static void didGetWebDatabaseOrigins(WKArrayRef origins, WKErrorRef error, void* context)
719 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
720 Eina_List* originList = 0;
722 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
723 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
724 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
725 originList = eina_list_append(originList, origin);
728 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
729 webDatabaseContext->webDatabaseOriginsCallback(originList, webDatabaseContext->userData);
730 delete webDatabaseContext;
733 static void didGetWebDatabaseQuota(WKUInt64Ref quota, WKErrorRef error, void* context)
735 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
736 TIZEN_LOGI("quota (%d)", toImpl(quota)->value());
737 webDatabaseContext->webDatabaseQuotaCallback(toImpl(quota)->value(), webDatabaseContext->userData);
738 delete webDatabaseContext;
741 static void didGetWebDatabaseUsage(WKUInt64Ref usage, WKErrorRef error, void* context)
743 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
744 TIZEN_LOGI("usage (%d)", toImpl(usage)->value());
745 webDatabaseContext->webDatabaseUsageCallback(toImpl(usage)->value(), webDatabaseContext->userData);
746 delete webDatabaseContext;
749 static void didGetWebDatabasePath(WKStringRef path, WKErrorRef error, void * context)
751 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
753 int length = WKStringGetMaximumUTF8CStringSize(path);
754 OwnArrayPtr<char> databasePath = adoptArrayPtr(new char[length]);
755 WKStringGetUTF8CString(path, databasePath.get(), length);
757 TIZEN_LOGI("path (%s)", databasePath.get());
758 webDatabaseContext->webDatabasePathCallback(eina_stringshare_add(databasePath.get()), webDatabaseContext->userData);
759 delete webDatabaseContext;
763 #if ENABLE(TIZEN_WEB_STORAGE)
764 static void didGetWebStorageOrigins(WKArrayRef origins, WKErrorRef error, void* context)
766 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
767 Eina_List* originList = 0;
769 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
770 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
771 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
772 originList = eina_list_append(originList, origin);
775 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
776 webStorageContext->webStorageOriginsCallback(originList, webStorageContext->userData);
777 delete webStorageContext;
780 static void didGetWebStoragePath(WKStringRef path, WKErrorRef error, void * context)
782 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
784 int length = WKStringGetMaximumUTF8CStringSize(path);
785 OwnArrayPtr<char> storagePath = adoptArrayPtr(new char[length]);
786 WKStringGetUTF8CString(path, storagePath.get(), length);
788 TIZEN_LOGI("path (%s)", storagePath.get());
789 webStorageContext->webStoragePathCallback(eina_stringshare_add(storagePath.get()), webStorageContext->userData);
790 delete webStorageContext;
793 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
794 static void didGetWebStorageUsage(WKInt64Ref usage, WKErrorRef error, void* context)
796 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
798 TIZEN_LOGI("usage (%s)", toImpl(usage)->value());
799 webStorageContext->webStorageUsageCallback(toImpl(usage)->value(), webStorageContext->userData);
800 delete webStorageContext;
806 Eina_Bool ewk_context_origins_free(Eina_List* originList)
808 EINA_SAFETY_ON_NULL_RETURN_VAL(originList, false);
811 EINA_LIST_FREE(originList, currentOrigin) {
812 Ewk_Security_Origin* origin = static_cast<Ewk_Security_Origin*>(currentOrigin);
813 deleteSecurityOrigin(origin);
819 Eina_Bool ewk_context_application_cache_delete_all(Ewk_Context* ewkContext)
821 #if ENABLE(TIZEN_APPLICATION_CACHE)
822 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
824 TIZEN_LOGI("ewkContext (%p)", ewkContext);
825 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
826 WKApplicationCacheManagerDeleteAllEntries(applicationCache);
834 Eina_Bool ewk_context_application_cache_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
836 #if ENABLE(TIZEN_APPLICATION_CACHE)
837 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
838 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
840 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
841 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
842 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
843 WKRetainPtr<WKSecurityOriginRef> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
844 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
845 WKApplicationCacheManagerDeleteEntriesForOrigin(applicationCacheRef, securityOriginRef.get());
853 Eina_Bool ewk_context_application_cache_origins_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Origins_Get_Callback callback, void *userData)
855 #if ENABLE(TIZEN_APPLICATION_CACHE)
856 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
857 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
859 TIZEN_LOGI("ewkContext (%p)", ewkContext);
860 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
861 context->webApplicationCacheOriginsCallback = callback;
862 context->userData = userData;
864 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
865 WKApplicationCacheManagerGetApplicationCacheOrigins(applicationCacheRef, context, didGetWebApplicationOrigins);
873 Eina_Bool ewk_context_application_cache_path_set(Ewk_Context* ewkContext, const char* path)
875 #if ENABLE(TIZEN_APPLICATION_CACHE)
876 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
877 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
880 TIZEN_LOGE("Path value is invalid");
884 TIZEN_LOGI("path (%s)", path);
885 WKRetainPtr<WKStringRef> applicationCachePathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
886 WKContextSetApplicationCacheDirectory(ewkContext->wkContext(), applicationCachePathRef.get());
894 Eina_Bool ewk_context_application_cache_path_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Path_Get_Callback callback, void* userData)
896 #if ENABLE(TIZEN_APPLICATION_CACHE)
897 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
898 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
900 TIZEN_LOGI("callback (%p)", callback);
901 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
902 context->webApplicationCachePathCallback= callback;
903 context->userData = userData;
905 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
906 WKApplicationCacheManagerGetApplicationCachePath(applicationCacheRef, context, didGetWebApplicationPath);
913 Eina_Bool ewk_context_application_cache_quota_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Quota_Get_Callback callback, void* userData)
915 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
916 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
917 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
919 TIZEN_LOGI("callback (%p)", callback);
920 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
921 context->webApplicationCacheQuotaCallback = callback;
922 context->userData = userData;
924 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
925 WKApplicationCacheManagerGetApplicationCacheQuota(applicationCacheRef, context, didGetWebApplicationQuota);
933 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)
935 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
936 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
937 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
938 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
940 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
941 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
942 context->webApplicationCacheUsageForOriginCallback = callback;
943 context->userData = userData;
944 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
945 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
946 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
948 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
949 WKApplicationCacheManagerGetApplicationCacheUsageForOrigin(applicationCache, context, originRef.get(), didGetWebApplicationUsageForOrigin);
957 Eina_Bool ewk_context_application_cache_quota_set(Ewk_Context* ewkContext, int64_t quota)
959 #if ENABLE(TIZEN_APPLICATION_CACHE)
960 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
962 TIZEN_LOGE("Quota value is invalid");
966 TIZEN_LOGI("quota (%d)", quota);
967 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
968 WKApplicationCacheManagerSetApplicationCacheQuota(applicationCacheRef, quota);
976 Eina_Bool ewk_context_application_cache_quota_for_origin_set(Ewk_Context* ewkContext, const Ewk_Security_Origin* origin, int64_t quota)
978 #if ENABLE(TIZEN_APPLICATION_CACHE)
979 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
980 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
982 TIZEN_LOGE("Quota value is invalid");
986 TIZEN_LOGI("quota (%d)", quota);
987 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
988 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
989 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
991 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
992 WKApplicationCacheManagerSetApplicationCacheQuotaForOrigin(applicationCache, originRef.get(), quota);
1001 Eina_Bool ewk_context_icon_database_path_set(Ewk_Context* ewkContext, const char* path)
1003 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1004 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1006 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1007 WKContextSetIconDatabasePath(ewkContext->wkContext(), databasePath.get());
1012 Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* ewkContext, const char* uri, Evas* canvas)
1014 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
1015 EINA_SAFETY_ON_NULL_RETURN_VAL(uri, 0);
1016 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
1018 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewkContext->wkContext());
1019 WKRetainPtr<WKURLRef> urlString(AdoptWK, WKURLCreateWithUTF8CString(uri));
1021 return WKIconDatabaseTryGetImageForURL(iconDatabase, canvas, urlString.get());
1024 void ewk_context_icon_database_delete_all(Ewk_Context* ewkContext)
1026 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1028 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewkContext->wkContext());
1029 WKIconDatabaseRemoveAllIcons(iconDatabase);
1032 Eina_Bool ewk_context_local_file_system_path_set(Ewk_Context* ewkContext, const char* path)
1034 #if ENABLE(TIZEN_FILE_SYSTEM)
1035 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1036 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1038 TIZEN_LOGI("path (%s)", path);
1039 WKRetainPtr<WKStringRef> localFileSystemPathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
1040 WKContextSetLocalFileSystemDirectory(ewkContext->wkContext(), localFileSystemPathRef.get());
1048 Eina_Bool ewk_context_local_file_system_all_delete(Ewk_Context* ewkContext)
1050 #if ENABLE(TIZEN_FILE_SYSTEM)
1051 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1053 TIZEN_LOGI("ewkContex (%p)", ewkContext);
1054 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(ewkContext->wkContext());
1055 WKLocalFileSystemManagerDeleteAllLocalFileSystem(localFileSystemManager);
1059 UNUSED_PARAM(ewkContext);
1065 Eina_Bool ewk_context_local_file_system_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1067 #if ENABLE(TIZEN_FILE_SYSTEM)
1068 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1069 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1071 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
1072 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1073 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1074 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1075 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(ewkContext->wkContext());
1077 WKLocalFileSystemManagerDeleteLocalFileSystem(localFileSystemManager, originRef.get());
1081 UNUSED_PARAM(ewkContext);
1082 UNUSED_PARAM(origin);
1088 Eina_Bool ewk_context_local_file_system_origins_get(const Ewk_Context* ewkContext, Ewk_Local_File_System_Origins_Get_Callback callback, void* userData)
1090 #if ENABLE(TIZEN_FILE_SYSTEM)
1091 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1092 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1094 TIZEN_LOGI("callback (%p)", callback);
1095 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1096 context->localFileSystemOriginsCallback= callback;
1097 context->userData = userData;
1098 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(const_cast<Ewk_Context*>(ewkContext)->wkContext());
1100 WKLocalFileSystemManagerGetLocalFileSystemOrigins(localFileSystemManager, context, didGetLocalFileSystemOrigins);
1104 UNUSED_PARAM(ewkContext);
1105 UNUSED_PARAM(callback);
1106 UNUSED_PARAM(userData);
1112 Ewk_Security_Origin* ewk_context_web_database_exceeded_quota_security_origin_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1114 #if ENABLE(TIZEN_SQL_DATABASE)
1115 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1117 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(exceededQuota->origin));
1118 return exceededQuota->origin;
1124 const char* ewk_context_web_database_exceeded_quota_database_name_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1126 #if ENABLE(TIZEN_SQL_DATABASE)
1127 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1129 TIZEN_LOGI("name (%s)", exceededQuota->databaseName);
1130 return exceededQuota->databaseName;
1136 const char* ewk_context_web_database_exceeded_quota_display_name_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1138 #if ENABLE(TIZEN_SQL_DATABASE)
1139 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1141 TIZEN_LOGI("displayName (%s)", exceededQuota->displayName);
1142 return exceededQuota->displayName;
1148 unsigned long long ewk_context_web_database_exceeded_quota_current_quota_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1150 #if ENABLE(TIZEN_SQL_DATABASE)
1151 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1153 TIZEN_LOGI("quota (%d)", exceededQuota->currentQuota);
1154 return exceededQuota->currentQuota;
1160 unsigned long long ewk_context_web_database_exceeded_quota_current_origin_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1162 #if ENABLE(TIZEN_SQL_DATABASE)
1163 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1165 TIZEN_LOGI("currentOriginUsage (%d)", exceededQuota->currentOriginUsage);
1166 return exceededQuota->currentOriginUsage;
1172 unsigned long long ewk_context_web_database_exceeded_quota_current_database_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1174 #if ENABLE(TIZEN_SQL_DATABASE)
1175 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1177 TIZEN_LOGI("currentDatabaseUsage (%d)", exceededQuota->currentDatabaseUsage);
1178 return exceededQuota->currentDatabaseUsage;
1184 unsigned long long ewk_context_web_database_exceeded_quota_expected_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1186 #if ENABLE(TIZEN_SQL_DATABASE)
1187 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1189 TIZEN_LOGI("expectedUsage (%d)", exceededQuota->expectedUsage);
1190 return exceededQuota->expectedUsage;
1196 void ewk_context_web_database_exceeded_quota_new_quota_set(Ewk_Context_Exceeded_Quota* exceededQuota, unsigned long long quota)
1198 #if ENABLE(TIZEN_SQL_DATABASE)
1199 EINA_SAFETY_ON_NULL_RETURN(exceededQuota);
1201 TIZEN_LOGI("quota (%d)", quota);
1202 exceededQuota->newQuota = quota;
1206 Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* ewkContext)
1208 #if ENABLE(TIZEN_SQL_DATABASE)
1209 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1211 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1212 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1213 WKDatabaseManagerDeleteAllDatabases(databaseManager);
1221 Eina_Bool ewk_context_web_database_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1223 #if ENABLE(TIZEN_SQL_DATABASE)
1224 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1225 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1227 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
1228 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1229 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1230 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1231 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1232 WKDatabaseManagerDeleteDatabasesForOrigin(databaseManager, originRef.get());
1240 Eina_Bool ewk_context_web_database_origins_get(Ewk_Context* ewkContext, Ewk_Web_Database_Origins_Get_Callback callback, void* userData)
1242 #if ENABLE(TIZEN_SQL_DATABASE)
1243 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1244 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1246 TIZEN_LOGI("callback (%p)", callback);
1247 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1248 context->webDatabaseOriginsCallback = callback;
1249 context->userData = userData;
1251 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1252 WKDatabaseManagerGetDatabaseOrigins(databaseManager, context, didGetWebDatabaseOrigins);
1260 Eina_Bool ewk_context_web_database_path_set(Ewk_Context* ewkContext, const char* path)
1262 #if ENABLE(TIZEN_SQL_DATABASE)
1263 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1264 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1266 TIZEN_LOGI("path (%s)", path);
1267 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1268 WKContextSetDatabaseDirectory(ewkContext->wkContext(), databasePath.get());
1276 Eina_Bool ewk_context_web_database_path_get(Ewk_Context* ewkContext, Ewk_Web_Database_Path_Get_Callback callback, void* userData)
1278 #if ENABLE(TIZEN_WEB_STORAGE)
1279 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1280 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1282 TIZEN_LOGI("callback (%p)", callback);
1283 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1284 context->webDatabasePathCallback= callback;
1285 context->userData = userData;
1287 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1288 WKDatabaseManagerGetDatabasePath(databaseManager, context, didGetWebDatabasePath);
1294 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)
1296 #if ENABLE(TIZEN_SQL_DATABASE)
1297 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1298 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1299 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1301 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
1302 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1303 context->webDatabaseQuotaCallback = callback;
1304 context->userData = userData;
1306 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1307 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1308 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1309 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1310 WKDatabaseManagerGetQuotaForOrigin(databaseManager, context, didGetWebDatabaseQuota, originRef.get());
1318 Eina_Bool ewk_context_web_database_default_quota_set(Ewk_Context* ewkContext, uint64_t quota)
1320 #if ENABLE(TIZEN_SQL_DATABASE)
1321 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1323 TIZEN_LOGI("quota (%d)", quota);
1324 ewkContext->setDefaultDatabaseQuota(quota);
1332 Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* ewkContext, Ewk_Security_Origin* origin, uint64_t quota)
1334 #if ENABLE(TIZEN_SQL_DATABASE)
1335 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1336 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1338 TIZEN_LOGI("host (%s) quota(%d)", ewk_security_origin_host_get(origin), quota);
1339 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1340 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1341 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1342 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1343 WKDatabaseManagerSetQuotaForOrigin(databaseManager, originRef.get(), quota);
1351 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)
1353 #if ENABLE(TIZEN_SQL_DATABASE)
1354 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1355 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1356 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1358 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
1359 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1360 context->webDatabaseQuotaCallback = callback;
1361 context->userData = userData;
1363 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1364 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1365 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1366 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1367 WKDatabaseManagerGetUsageForOrigin(databaseManager, context, didGetWebDatabaseUsage, originRef.get());
1375 Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* ewkContext)
1377 #if ENABLE(TIZEN_INDEXED_DATABASE)
1378 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1380 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1381 DEFINE_STATIC_LOCAL(const String, fileMatchPattern, ("*"));
1382 DEFINE_STATIC_LOCAL(const String, indexedDatabaseDirectory, ("/opt/apps/com.samsung.browser/data/.webkit/indexedDatabases"));
1384 Vector<String> paths = WebCore::listDirectory(indexedDatabaseDirectory, fileMatchPattern);
1385 Vector<String>::const_iterator end = paths.end();
1386 for(Vector<String>::const_iterator it = paths.begin(); it != end; ++it){
1388 #if ENABLE(TIZEN_FILE_SYSTEM)
1389 WebCore::removeDirectory(path);
1399 Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* ewkContext)
1401 #if ENABLE(TIZEN_WEB_STORAGE)
1402 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1404 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1405 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1406 WKKeyValueStorageManagerDeleteAllEntries(storageManager);
1414 Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1416 #if ENABLE(TIZEN_WEB_STORAGE)
1417 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1418 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1420 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
1421 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1422 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1423 WKRetainPtr<WKSecurityOriginRef> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1424 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1425 WKKeyValueStorageManagerDeleteEntriesForOrigin(storageManager, securityOriginRef.get());
1433 Eina_Bool ewk_context_web_storage_origins_get(Ewk_Context* ewkContext, Ewk_Web_Storage_Origins_Get_Callback callback, void* userData)
1435 #if ENABLE(TIZEN_WEB_STORAGE)
1436 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1437 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1439 TIZEN_LOGI("callback (%p)", callback);
1440 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1441 context->webStorageOriginsCallback = callback;
1442 context->userData = userData;
1444 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1445 WKKeyValueStorageManagerGetKeyValueStorageOrigins(storageManager, context, didGetWebStorageOrigins);
1453 Eina_Bool ewk_context_web_storage_path_set(Ewk_Context* ewkContext, const char* path)
1455 #if ENABLE(TIZEN_WEB_STORAGE)
1456 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1457 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1459 TIZEN_LOGI("path (%s)", path);
1460 WKRetainPtr<WKStringRef> webStoragePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1461 WKContextSetLocalStorageDirectory(ewkContext->wkContext(), webStoragePath.get());
1469 Eina_Bool ewk_context_web_storage_path_get(Ewk_Context* ewkContext, Ewk_Web_Storage_Path_Get_Callback callback, void* userData)
1471 #if ENABLE(TIZEN_WEB_STORAGE)
1472 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1473 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1475 TIZEN_LOGI("callback (%p)", callback);
1476 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1477 context->webStoragePathCallback= callback;
1478 context->userData = userData;
1480 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1481 WKKeyValueStorageManagerGetKeyValueStoragePath(storageManager, context, didGetWebStoragePath);
1487 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)
1489 #if ENABLE(TIZEN_WEB_STORAGE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
1490 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1491 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1492 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1494 TIZEN_LOGI("host (%s)", ewk_security_origin_host_get(origin));
1495 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1496 context->webStorageUsageCallback = callback;
1497 context->userData = userData;
1498 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1499 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1500 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1502 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1503 WKKeyValueStorageManagerGetKeyValueStorageUsageForOrigin(storageManager, context, didGetWebStorageUsage, originRef.get());
1511 //#if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2)
1512 Eina_Bool ewk_context_soup_data_directory_set(Ewk_Context* ewkContext, const char* path)
1514 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1515 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1517 WKRetainPtr<WKStringRef> soupDataDirectory(AdoptWK, WKStringCreateWithUTF8CString(path));
1518 WKContextSetSoupDataDirectory(ewkContext->wkContext(), soupDataDirectory.get());
1523 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_DOCUMENT_VIEWER, kWKCacheModelDocumentViewer);
1524 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_DOCUMENT_BROWSER, kWKCacheModelDocumentBrowser);
1525 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_PRIMARY_WEBBROWSER, kWKCacheModelPrimaryWebBrowser);
1527 Eina_Bool ewk_context_cache_model_set(Ewk_Context* ewkContext, Ewk_Cache_Model cacheModel)
1529 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1531 ewkContext->setCacheModel(cacheModel);
1536 Ewk_Cache_Model ewk_context_cache_model_get(Ewk_Context* ewkContext)
1538 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, EWK_CACHE_MODEL_DOCUMENT_VIEWER);
1540 return ewkContext->cacheModel();
1543 Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* ewkContext, Eina_Bool cacheDisabled)
1545 #if ENABLE(TIZEN_CACHE_CONTROL)
1546 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1547 WKContextSetCacheDisabled(ewkContext->wkContext(), cacheDisabled);
1553 Eina_Bool ewk_context_cache_disabled_get(Ewk_Context* ewkContext)
1555 #if ENABLE(TIZEN_CACHE_CONTROL)
1556 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1557 return WKContextGetCacheDisabled(ewkContext->wkContext());
1563 Eina_Bool ewk_context_certificate_file_set(Ewk_Context* context, const char* certificateFile)
1565 EINA_SAFETY_ON_NULL_RETURN_VAL(context, false);
1566 EINA_SAFETY_ON_NULL_RETURN_VAL(certificateFile, false);
1567 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
1568 if (!context->setCertificateFile(certificateFile))
1571 if (!fileExists(WTF::String::fromUTF8(certificateFile)))
1572 LOG_ERROR("[Network] ewk_context_certificate_file_set certificateFile does not exist!\n");
1574 WKRetainPtr<WKStringRef> certificateFileRef(AdoptWK, WKStringCreateWithUTF8CString(certificateFile));
1575 WKContextSetCertificateFile(context->wkContext(), certificateFileRef.get());
1578 UNUSED_PARAM(context);
1579 UNUSED_PARAM(certificateFile);
1584 const char* ewk_context_certificate_file_get(const Ewk_Context* context)
1586 EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0);
1587 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
1588 return context->certificateFile();
1590 UNUSED_PARAM(context);
1595 Eina_Bool ewk_context_cache_clear(Ewk_Context* ewkContext)
1597 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1598 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(ewkContext->wkContext());
1599 #if ENABLE(TIZEN_EWK_CONTEXT_CACHE_MANAGER_NULL_CHECK_WORKAROUND)
1603 WKResourceCacheManagerClearCacheForAllOrigins(cacheManager, WKResourceCachesToClearAll);
1608 void ewk_context_message_post_to_injected_bundle(Ewk_Context* ewkContext, const char* name, const char* body)
1610 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1611 EINA_SAFETY_ON_NULL_RETURN(name);
1612 EINA_SAFETY_ON_NULL_RETURN(body);
1614 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString(name));
1615 WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithUTF8CString(body));
1616 WKContextPostMessageToInjectedBundle(ewkContext->wkContext(), messageName.get(), messageBody.get());
1619 void ewk_context_message_from_injected_bundle_callback_set(Ewk_Context* ewkContext, Ewk_Context_Message_From_Injected_Bundle_Callback callback, void* userData)
1621 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1623 ewkContext->setMessageFromInjectedBundleCallback(callback, userData);
1626 void ewk_context_did_start_download_callback_set(Ewk_Context* ewkContext, Ewk_Context_Did_Start_Download_Callback callback, void* userData)
1628 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1630 ewkContext->setDidStartDownloadCallback(callback, userData);
1633 #if ENABLE(MEMORY_SAMPLER)
1634 void ewk_context_memory_sampler_start(Ewk_Context* ewkContext, double timerInterval)
1636 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1637 WKRetainPtr<WKDoubleRef> interval(AdoptWK, WKDoubleCreate(timerInterval));
1638 WKContextStartMemorySampler(ewkContext->wkContext(), interval.get());
1641 void ewk_context_memory_sampler_stop(Ewk_Context* ewkContext)
1643 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1644 WKContextStopMemorySampler(ewkContext->wkContext());
1648 Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context* ewkContext, const char* path)
1650 #if ENABLE(TIZEN_SUPPORT_PLUGINS)
1651 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1652 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1654 WKRetainPtr<WKStringRef> pluginPath(AdoptWK, WKStringCreateWithUTF8CString(path));
1655 WKContextSetAdditionalPluginsDirectory(ewkContext->wkContext(), pluginPath.get());
1663 #if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE)
1664 void ewk_context_memory_saving_mode_set(Ewk_Context* ewkContext, Eina_Bool mode)
1666 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1668 WKContextRef contextRef = ewkContext->wkContext();
1669 toImpl(contextRef)->setMemorySavingMode(mode);
1673 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
1674 void ewk_context_form_password_data_clear(Ewk_Context* ewkContext)
1676 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1677 ewkContext->clearPasswordFormData();
1680 void ewk_context_form_candidate_data_clear(Ewk_Context* ewkContext)
1682 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1683 ewkContext->clearCandidateFormData();
1686 #endif // #if OS(TIZEN)
1688 Eina_Bool ewk_context_url_scheme_register(Ewk_Context* ewkContext, const char* scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
1690 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1691 EINA_SAFETY_ON_NULL_RETURN_VAL(scheme, false);
1692 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1694 ewkContext->requestManager()->registerURLSchemeHandler(String::fromUTF8(scheme), callback, userData);
1699 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)
1701 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1703 TIZEN_LOGI("vibrate (%p)", vibrate);
1704 #if ENABLE(VIBRATION)
1705 ewkContext->vibrationProvider()->setVibrationClientCallbacks(vibrate, cancel, data);
1709 Eina_Bool ewk_context_tizen_extensible_api_set(Ewk_Context* ewkContext, Ewk_Extensible_API extensibleAPI, Eina_Bool enable)
1711 #if ENABLE(TIZEN_EXTENSIBLE_API)
1712 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1714 TIZEN_LOGI("extensibleAPI (%d) enable (%d)", extensibleAPI, enable);
1715 WKContextSetTizenExtensibleAPI(ewkContext->wkContext(), static_cast<WKTizenExtensibleAPI>(extensibleAPI), enable);
1719 UNUSED_PARAM(ewkContext);
1720 UNUSED_PARAM(extensibleAPI);
1721 UNUSED_PARAM(enable);
1727 void ewk_context_storage_path_reset(Ewk_Context* ewkContext)
1729 #if ENABLE(TIZEN_RESET_PATH)
1730 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1732 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1733 WKContextResetStoragePath(ewkContext->wkContext());
1735 UNUSED_PARAM(ewkContext);
1739 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)
1741 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1743 ewkContext->historyClient()->setCallbacks(navigate, clientRedirect, serverRedirect, titleUpdate, populateVisitedLinks, data);
1746 void ewk_context_visited_link_add(Ewk_Context* ewkContext, const char* visitedURL)
1748 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1749 EINA_SAFETY_ON_NULL_RETURN(visitedURL);
1751 ewkContext->addVisitedLink(visitedURL);