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_PROCESS_PERMISSION_CONTROL)
572 const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH");
573 if (webProcessExecutablePath) {
574 WKContextRef contextRef = ewkContext->wkContext();
575 toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath));
578 const char* pluginProcessExecutablePath = getenv("PLUGIN_PROCESS_EXECUTABLE_PATH");
579 if (pluginProcessExecutablePath) {
580 WKContextRef contextRef = ewkContext->wkContext();
581 toImpl(contextRef)->pluginInfoStore().setExecutablePath(String::fromUTF8(pluginProcessExecutablePath));
586 return Ewk_Context::create().leakRef();
590 Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path)
592 EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
594 #if ENABLE(TIZEN_WEBKIT2_DDK_CHECK)
595 // FIXME : OpenGL check code for WRT before launching WebProcess.
596 if(!eglGetDisplay(EGL_DEFAULT_DISPLAY)) {
597 EINA_LOG_CRIT("Fail in initiziling view because No DDK is installed.");
602 #if ENABLE(TIZEN_WRT_LAUNCHING_PERFORMANCE)
603 char* wrtLaunchingPerformance = getenv("WRT_LAUNCHING_PERFORMANCE");
604 if (wrtLaunchingPerformance && !strcmp(wrtLaunchingPerformance, "1")) {
605 static bool firstTime = true;
609 if (ProcessLauncher::isInitialFork())
610 ProcessLauncher::setSkipExec(true);
612 ProcessLauncher::setSkipExec(false);
614 ProcessLauncher::forkProcess();
616 if (ProcessLauncher::isParentProcess()) {
617 Ewk_Context* ewkContext = ewk_context_new_with_injected_bundle_path(path);
618 WKContextRef contextRef = ewkContext->wkContext();
619 toImpl(contextRef)->ensureWebProcess();
622 else if (ProcessLauncher::isChildProcess()) {
623 ProcessLauncher::callWebProcessMain();
627 ASSERT_NOT_REACHED();
634 Ewk_Context* ewkContext = Ewk_Context::create(String::fromUTF8(path)).leakRef();
635 ewkContextInjectedBundleClientAttachClient(ewkContext);
636 #if ENABLE(TIZEN_PROCESS_PERMISSION_CONTROL)
637 const char* webProcessExecutablePath = getenv("WEB_PROCESS_EXECUTABLE_PATH");
638 if (webProcessExecutablePath) {
639 WKContextRef contextRef = ewkContext->wkContext();
640 toImpl(contextRef)->setWebProcessExecutablePath(String::fromUTF8(webProcessExecutablePath));
643 const char* pluginProcessExecutablePath = getenv("PLUGIN_PROCESS_EXECUTABLE_PATH");
644 if (pluginProcessExecutablePath) {
645 WKContextRef contextRef = ewkContext->wkContext();
646 toImpl(contextRef)->pluginInfoStore().setExecutablePath(String::fromUTF8(pluginProcessExecutablePath));
651 return Ewk_Context::create(String::fromUTF8(path)).leakRef();
655 void ewk_context_delete(Ewk_Context* ewkContext)
657 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
658 if (ewkContext == ewk_context_default_get() && ewkContext->hasOneRef())
664 void ewk_context_proxy_uri_set(Ewk_Context* ewkContext, const char* proxy)
666 if (ewkContext && ewkContext->setProxyAddress(proxy)) {
667 WKRetainPtr<WKURLRef> proxyAddress(AdoptWK, WKURLCreateWithUTF8CString(proxy));
669 WKContextRef contextRef = ewkContext->wkContext();
670 toImpl(contextRef)->setProxy(toWTFString(proxyAddress.get()));
674 const char* ewk_context_proxy_uri_get(Ewk_Context* ewkContext)
676 #if ENABLE(TIZEN_WEBKIT2_PATCH_FOR_TC)
677 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
679 return ewkContext->proxyAddress();
682 void ewk_context_network_session_requests_cancel(Ewk_Context* ewkContext)
684 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
686 WKContextRef contextRef = ewkContext->wkContext();
687 toImpl(contextRef)->abortSession();
690 Eina_Bool ewk_context_notify_low_memory(Ewk_Context* ewkContext)
692 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
694 WKContextRef contextRef = ewkContext->wkContext();
695 toImpl(contextRef)->notifyLowMemory();
699 #if ENABLE(TIZEN_FILE_SYSTEM)
700 static void didGetLocalFileSystemOrigins(WKArrayRef origins, WKErrorRef error, void* context)
702 Eina_List* originList = 0;
703 for (size_t i = 0; i < WKArrayGetSize(origins); ++i) {
704 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
705 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
706 originList = eina_list_append(originList, origin);
709 Ewk_Context_Callback_Context* locaFileSystemContext = static_cast<Ewk_Context_Callback_Context*>(context);
710 locaFileSystemContext->localFileSystemOriginsCallback(originList, locaFileSystemContext->userData);
711 delete locaFileSystemContext;
715 #if ENABLE(TIZEN_APPLICATION_CACHE)
716 static void didGetWebApplicationOrigins(WKArrayRef origins, WKErrorRef error, void* context)
718 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
719 Eina_List* originList = 0;
721 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
722 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
723 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
724 originList = eina_list_append(originList, origin);
727 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
728 applicationCacheContext->webApplicationCacheOriginsCallback(originList, applicationCacheContext->userData);
729 delete applicationCacheContext;
732 static void didGetWebApplicationPath(WKStringRef path, WKErrorRef error, void* context)
734 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
736 int length = WKStringGetMaximumUTF8CStringSize(path);
737 OwnArrayPtr<char> applicationCachePath = adoptArrayPtr(new char[length]);
738 WKStringGetUTF8CString(path, applicationCachePath.get(), length);
740 TIZEN_LOGI("path (%s)", applicationCachePath.get());
741 applicationCacheContext->webApplicationCachePathCallback(eina_stringshare_add(applicationCachePath.get()), applicationCacheContext->userData);
742 delete applicationCacheContext;
745 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
746 static void didGetWebApplicationQuota(WKInt64Ref quota, WKErrorRef error, void* context)
748 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
749 TIZEN_LOGI("quota (%d)", toImpl(quota)->value());
750 applicationCacheContext->webApplicationCacheQuotaCallback(toImpl(quota)->value(), applicationCacheContext->userData);
751 delete applicationCacheContext;
754 static void didGetWebApplicationUsageForOrigin(WKInt64Ref usage, WKErrorRef error, void* context)
756 Ewk_Context_Callback_Context* applicationCacheContext = static_cast<Ewk_Context_Callback_Context*>(context);
757 TIZEN_LOGI("usage (%d)", toImpl(usage)->value());
758 applicationCacheContext->webApplicationCacheUsageForOriginCallback(toImpl(usage)->value(), applicationCacheContext->userData);
759 delete applicationCacheContext;
764 #if ENABLE(TIZEN_SQL_DATABASE)
765 static void didGetWebDatabaseOrigins(WKArrayRef origins, WKErrorRef error, void* context)
767 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
768 Eina_List* originList = 0;
770 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
771 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
772 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
773 originList = eina_list_append(originList, origin);
776 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
777 webDatabaseContext->webDatabaseOriginsCallback(originList, webDatabaseContext->userData);
778 delete webDatabaseContext;
781 static void didGetWebDatabaseQuota(WKUInt64Ref quota, WKErrorRef error, void* context)
783 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
784 TIZEN_LOGI("quota (%d)", toImpl(quota)->value());
785 webDatabaseContext->webDatabaseQuotaCallback(toImpl(quota)->value(), webDatabaseContext->userData);
786 delete webDatabaseContext;
789 static void didGetWebDatabaseUsage(WKUInt64Ref usage, WKErrorRef error, void* context)
791 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
792 TIZEN_LOGI("usage (%d)", toImpl(usage)->value());
793 webDatabaseContext->webDatabaseUsageCallback(toImpl(usage)->value(), webDatabaseContext->userData);
794 delete webDatabaseContext;
797 static void didGetWebDatabasePath(WKStringRef path, WKErrorRef error, void * context)
799 Ewk_Context_Callback_Context* webDatabaseContext = static_cast<Ewk_Context_Callback_Context*>(context);
801 int length = WKStringGetMaximumUTF8CStringSize(path);
802 OwnArrayPtr<char> databasePath = adoptArrayPtr(new char[length]);
803 WKStringGetUTF8CString(path, databasePath.get(), length);
805 TIZEN_LOGI("path (%s)", databasePath.get());
806 webDatabaseContext->webDatabasePathCallback(eina_stringshare_add(databasePath.get()), webDatabaseContext->userData);
807 delete webDatabaseContext;
811 #if ENABLE(TIZEN_WEB_STORAGE)
812 static void didGetWebStorageOrigins(WKArrayRef origins, WKErrorRef error, void* context)
814 TIZEN_LOGI("origin size(%d)", WKArrayGetSize(origins));
815 Eina_List* originList = 0;
817 for(size_t i = 0; i < WKArrayGetSize(origins); i++) {
818 WKSecurityOriginRef securityOriginRef = static_cast<WKSecurityOriginRef>(WKArrayGetItemAtIndex(origins, i));
819 Ewk_Security_Origin* origin = createSecurityOrigin(securityOriginRef);
820 originList = eina_list_append(originList, origin);
823 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
824 webStorageContext->webStorageOriginsCallback(originList, webStorageContext->userData);
825 delete webStorageContext;
828 static void didGetWebStoragePath(WKStringRef path, WKErrorRef error, void * context)
830 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
832 int length = WKStringGetMaximumUTF8CStringSize(path);
833 OwnArrayPtr<char> storagePath = adoptArrayPtr(new char[length]);
834 WKStringGetUTF8CString(path, storagePath.get(), length);
836 TIZEN_LOGI("path (%s)", storagePath.get());
837 webStorageContext->webStoragePathCallback(eina_stringshare_add(storagePath.get()), webStorageContext->userData);
838 delete webStorageContext;
841 #if ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
842 static void didGetWebStorageUsage(WKInt64Ref usage, WKErrorRef error, void* context)
844 Ewk_Context_Callback_Context* webStorageContext = static_cast<Ewk_Context_Callback_Context*>(context);
846 TIZEN_LOGI("usage (%s)", toImpl(usage)->value());
847 webStorageContext->webStorageUsageCallback(toImpl(usage)->value(), webStorageContext->userData);
848 delete webStorageContext;
854 Eina_Bool ewk_context_origins_free(Eina_List* originList)
856 EINA_SAFETY_ON_NULL_RETURN_VAL(originList, false);
859 EINA_LIST_FREE(originList, currentOrigin) {
860 Ewk_Security_Origin* origin = static_cast<Ewk_Security_Origin*>(currentOrigin);
861 deleteSecurityOrigin(origin);
867 Eina_Bool ewk_context_application_cache_delete_all(Ewk_Context* ewkContext)
869 #if ENABLE(TIZEN_APPLICATION_CACHE)
870 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
872 TIZEN_LOGI("ewkContext (%p)", ewkContext);
873 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
874 WKApplicationCacheManagerDeleteAllEntries(applicationCache);
882 Eina_Bool ewk_context_application_cache_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
884 #if ENABLE(TIZEN_APPLICATION_CACHE)
885 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
886 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
888 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
889 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
890 WKRetainPtr<WKSecurityOriginRef> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
891 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
892 WKApplicationCacheManagerDeleteEntriesForOrigin(applicationCacheRef, securityOriginRef.get());
900 Eina_Bool ewk_context_application_cache_origins_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Origins_Get_Callback callback, void *userData)
902 #if ENABLE(TIZEN_APPLICATION_CACHE)
903 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
904 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
906 TIZEN_LOGI("ewkContext (%p)", ewkContext);
907 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
908 context->webApplicationCacheOriginsCallback = callback;
909 context->userData = userData;
911 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
912 WKApplicationCacheManagerGetApplicationCacheOrigins(applicationCacheRef, context, didGetWebApplicationOrigins);
920 Eina_Bool ewk_context_application_cache_path_set(Ewk_Context* ewkContext, const char* path)
922 #if ENABLE(TIZEN_APPLICATION_CACHE)
923 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
924 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
927 TIZEN_LOGE("Path value is invalid");
931 TIZEN_LOGI("path (%s)", path);
932 WKRetainPtr<WKStringRef> applicationCachePathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
933 WKContextSetApplicationCacheDirectory(ewkContext->wkContext(), applicationCachePathRef.get());
941 Eina_Bool ewk_context_application_cache_path_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Path_Get_Callback callback, void* userData)
943 #if ENABLE(TIZEN_APPLICATION_CACHE)
944 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
945 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
947 TIZEN_LOGI("callback (%p)", callback);
948 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
949 context->webApplicationCachePathCallback= callback;
950 context->userData = userData;
952 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
953 WKApplicationCacheManagerGetApplicationCachePath(applicationCacheRef, context, didGetWebApplicationPath);
960 Eina_Bool ewk_context_application_cache_quota_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Quota_Get_Callback callback, void* userData)
962 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
963 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
964 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
966 TIZEN_LOGI("callback (%p)", callback);
967 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
968 context->webApplicationCacheQuotaCallback = callback;
969 context->userData = userData;
971 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
972 WKApplicationCacheManagerGetApplicationCacheQuota(applicationCacheRef, context, didGetWebApplicationQuota);
980 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)
982 #if ENABLE(TIZEN_APPLICATION_CACHE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
983 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
984 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
985 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
987 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
988 context->webApplicationCacheUsageForOriginCallback = callback;
989 context->userData = userData;
990 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
991 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
992 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
994 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
995 WKApplicationCacheManagerGetApplicationCacheUsageForOrigin(applicationCache, context, originRef.get(), didGetWebApplicationUsageForOrigin);
1003 Eina_Bool ewk_context_application_cache_quota_set(Ewk_Context* ewkContext, int64_t quota)
1005 #if ENABLE(TIZEN_APPLICATION_CACHE)
1006 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1008 TIZEN_LOGE("Quota value is invalid");
1012 TIZEN_LOGI("quota (%d)", quota);
1013 WKApplicationCacheManagerRef applicationCacheRef = WKContextGetApplicationCacheManager(ewkContext->wkContext());
1014 WKApplicationCacheManagerSetApplicationCacheQuota(applicationCacheRef, quota);
1022 Eina_Bool ewk_context_application_cache_quota_for_origin_set(Ewk_Context* ewkContext, const Ewk_Security_Origin* origin, int64_t quota)
1024 #if ENABLE(TIZEN_APPLICATION_CACHE)
1025 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1026 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1028 TIZEN_LOGE("Quota value is invalid");
1032 TIZEN_LOGI("quota (%d)", quota);
1033 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1034 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1035 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1037 WKApplicationCacheManagerRef applicationCache = WKContextGetApplicationCacheManager(ewkContext->wkContext());
1038 WKApplicationCacheManagerSetApplicationCacheQuotaForOrigin(applicationCache, originRef.get(), quota);
1047 Eina_Bool ewk_context_icon_database_path_set(Ewk_Context* ewkContext, const char* path)
1049 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1050 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1052 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1053 WKContextSetIconDatabasePath(ewkContext->wkContext(), databasePath.get());
1058 Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* ewkContext, const char* uri, Evas* canvas)
1060 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
1061 EINA_SAFETY_ON_NULL_RETURN_VAL(uri, 0);
1062 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
1064 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewkContext->wkContext());
1065 WKRetainPtr<WKURLRef> urlString(AdoptWK, WKURLCreateWithUTF8CString(uri));
1067 return WKIconDatabaseTryGetImageForURL(iconDatabase, canvas, urlString.get());
1070 void ewk_context_icon_database_delete_all(Ewk_Context* ewkContext)
1072 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1074 WKIconDatabaseRef iconDatabase = WKContextGetIconDatabase(ewkContext->wkContext());
1075 WKIconDatabaseRemoveAllIcons(iconDatabase);
1078 Eina_Bool ewk_context_local_file_system_path_set(Ewk_Context* ewkContext, const char* path)
1080 #if ENABLE(TIZEN_FILE_SYSTEM)
1081 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1082 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1084 TIZEN_LOGI("path (%s)", path);
1085 WKRetainPtr<WKStringRef> localFileSystemPathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
1086 WKContextSetLocalFileSystemDirectory(ewkContext->wkContext(), localFileSystemPathRef.get());
1094 Eina_Bool ewk_context_local_file_system_all_delete(Ewk_Context* ewkContext)
1096 #if ENABLE(TIZEN_FILE_SYSTEM)
1097 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1099 TIZEN_LOGI("ewkContex (%p)", ewkContext);
1100 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(ewkContext->wkContext());
1101 WKLocalFileSystemManagerDeleteAllLocalFileSystem(localFileSystemManager);
1105 UNUSED_PARAM(ewkContext);
1111 Eina_Bool ewk_context_local_file_system_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1113 #if ENABLE(TIZEN_FILE_SYSTEM)
1114 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1115 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1117 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1118 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1119 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1120 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(ewkContext->wkContext());
1122 WKLocalFileSystemManagerDeleteLocalFileSystem(localFileSystemManager, originRef.get());
1126 UNUSED_PARAM(ewkContext);
1127 UNUSED_PARAM(origin);
1133 Eina_Bool ewk_context_local_file_system_origins_get(const Ewk_Context* ewkContext, Ewk_Local_File_System_Origins_Get_Callback callback, void* userData)
1135 #if ENABLE(TIZEN_FILE_SYSTEM)
1136 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1137 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1139 TIZEN_LOGI("callback (%p)", callback);
1140 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1141 context->localFileSystemOriginsCallback= callback;
1142 context->userData = userData;
1143 WKLocalFileSystemManagerRef localFileSystemManager = WKContextGetLocalFileSystemManager(const_cast<Ewk_Context*>(ewkContext)->wkContext());
1145 WKLocalFileSystemManagerGetLocalFileSystemOrigins(localFileSystemManager, context, didGetLocalFileSystemOrigins);
1149 UNUSED_PARAM(ewkContext);
1150 UNUSED_PARAM(callback);
1151 UNUSED_PARAM(userData);
1157 Ewk_Security_Origin* ewk_context_web_database_exceeded_quota_security_origin_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1159 #if ENABLE(TIZEN_SQL_DATABASE)
1160 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1162 return exceededQuota->origin;
1168 const char* ewk_context_web_database_exceeded_quota_database_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("name (%s)", exceededQuota->databaseName);
1174 return exceededQuota->databaseName;
1180 const char* ewk_context_web_database_exceeded_quota_display_name_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1182 #if ENABLE(TIZEN_SQL_DATABASE)
1183 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1185 TIZEN_LOGI("displayName (%s)", exceededQuota->displayName);
1186 return exceededQuota->displayName;
1192 unsigned long long ewk_context_web_database_exceeded_quota_current_quota_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1194 #if ENABLE(TIZEN_SQL_DATABASE)
1195 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1197 TIZEN_LOGI("quota (%d)", exceededQuota->currentQuota);
1198 return exceededQuota->currentQuota;
1204 unsigned long long ewk_context_web_database_exceeded_quota_current_origin_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("currentOriginUsage (%d)", exceededQuota->currentOriginUsage);
1210 return exceededQuota->currentOriginUsage;
1216 unsigned long long ewk_context_web_database_exceeded_quota_current_database_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("currentDatabaseUsage (%d)", exceededQuota->currentDatabaseUsage);
1222 return exceededQuota->currentDatabaseUsage;
1228 unsigned long long ewk_context_web_database_exceeded_quota_expected_usage_get(Ewk_Context_Exceeded_Quota* exceededQuota)
1230 #if ENABLE(TIZEN_SQL_DATABASE)
1231 EINA_SAFETY_ON_NULL_RETURN_VAL(exceededQuota, 0);
1233 TIZEN_LOGI("expectedUsage (%d)", exceededQuota->expectedUsage);
1234 return exceededQuota->expectedUsage;
1240 void ewk_context_web_database_exceeded_quota_new_quota_set(Ewk_Context_Exceeded_Quota* exceededQuota, unsigned long long quota)
1242 #if ENABLE(TIZEN_SQL_DATABASE)
1243 EINA_SAFETY_ON_NULL_RETURN(exceededQuota);
1245 TIZEN_LOGI("quota (%d)", quota);
1246 exceededQuota->newQuota = quota;
1250 Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* ewkContext)
1252 #if ENABLE(TIZEN_SQL_DATABASE)
1253 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1255 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1256 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1257 WKDatabaseManagerDeleteAllDatabases(databaseManager);
1265 Eina_Bool ewk_context_web_database_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1267 #if ENABLE(TIZEN_SQL_DATABASE)
1268 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1269 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1271 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1272 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1273 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1274 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1275 WKDatabaseManagerDeleteDatabasesForOrigin(databaseManager, originRef.get());
1283 Eina_Bool ewk_context_web_database_origins_get(Ewk_Context* ewkContext, Ewk_Web_Database_Origins_Get_Callback callback, void* userData)
1285 #if ENABLE(TIZEN_SQL_DATABASE)
1286 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1287 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1289 TIZEN_LOGI("callback (%p)", callback);
1290 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1291 context->webDatabaseOriginsCallback = callback;
1292 context->userData = userData;
1294 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1295 WKDatabaseManagerGetDatabaseOrigins(databaseManager, context, didGetWebDatabaseOrigins);
1303 Eina_Bool ewk_context_web_database_path_set(Ewk_Context* ewkContext, const char* path)
1305 #if ENABLE(TIZEN_SQL_DATABASE)
1306 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1307 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1309 TIZEN_LOGI("path (%s)", path);
1310 WKRetainPtr<WKStringRef> databasePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1311 WKContextSetDatabaseDirectory(ewkContext->wkContext(), databasePath.get());
1319 Eina_Bool ewk_context_web_database_path_get(Ewk_Context* ewkContext, Ewk_Web_Database_Path_Get_Callback callback, void* userData)
1321 #if ENABLE(TIZEN_WEB_STORAGE)
1322 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1323 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1325 TIZEN_LOGI("callback (%p)", callback);
1326 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1327 context->webDatabasePathCallback= callback;
1328 context->userData = userData;
1330 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1331 WKDatabaseManagerGetDatabasePath(databaseManager, context, didGetWebDatabasePath);
1337 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)
1339 #if ENABLE(TIZEN_SQL_DATABASE)
1340 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1341 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1342 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1344 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1345 context->webDatabaseQuotaCallback = callback;
1346 context->userData = userData;
1348 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1349 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1350 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1351 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1352 WKDatabaseManagerGetQuotaForOrigin(databaseManager, context, didGetWebDatabaseQuota, originRef.get());
1360 Eina_Bool ewk_context_web_database_default_quota_set(Ewk_Context* ewkContext, uint64_t quota)
1362 #if ENABLE(TIZEN_SQL_DATABASE)
1363 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1365 TIZEN_LOGI("quota (%d)", quota);
1366 ewkContext->setDefaultDatabaseQuota(quota);
1374 Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* ewkContext, Ewk_Security_Origin* origin, uint64_t quota)
1376 #if ENABLE(TIZEN_SQL_DATABASE)
1377 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1378 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1380 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1381 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1382 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1383 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1384 WKDatabaseManagerSetQuotaForOrigin(databaseManager, originRef.get(), quota);
1392 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)
1394 #if ENABLE(TIZEN_SQL_DATABASE)
1395 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1396 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1397 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1399 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1400 context->webDatabaseQuotaCallback = callback;
1401 context->userData = userData;
1403 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1404 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1405 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1406 WKDatabaseManagerRef databaseManager = WKContextGetDatabaseManager(ewkContext->wkContext());
1407 WKDatabaseManagerGetUsageForOrigin(databaseManager, context, didGetWebDatabaseUsage, originRef.get());
1415 Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* ewkContext)
1417 #if ENABLE(TIZEN_INDEXED_DATABASE)
1418 WKContextDeleteIndexedDatabaseAll(ewkContext->wkContext());
1426 Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* ewkContext)
1428 #if ENABLE(TIZEN_WEB_STORAGE)
1429 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1431 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1432 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1433 WKKeyValueStorageManagerDeleteAllEntries(storageManager);
1441 Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* ewkContext, Ewk_Security_Origin* origin)
1443 #if ENABLE(TIZEN_WEB_STORAGE)
1444 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1445 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1447 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1448 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1449 WKRetainPtr<WKSecurityOriginRef> securityOriginRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1450 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1451 WKKeyValueStorageManagerDeleteEntriesForOrigin(storageManager, securityOriginRef.get());
1459 Eina_Bool ewk_context_web_storage_origins_get(Ewk_Context* ewkContext, Ewk_Web_Storage_Origins_Get_Callback callback, void* userData)
1461 #if ENABLE(TIZEN_WEB_STORAGE)
1462 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1463 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1465 TIZEN_LOGI("callback (%p)", callback);
1466 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1467 context->webStorageOriginsCallback = callback;
1468 context->userData = userData;
1470 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1471 WKKeyValueStorageManagerGetKeyValueStorageOrigins(storageManager, context, didGetWebStorageOrigins);
1479 Eina_Bool ewk_context_web_storage_path_set(Ewk_Context* ewkContext, const char* path)
1481 #if ENABLE(TIZEN_WEB_STORAGE)
1482 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1483 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1485 TIZEN_LOGI("path (%s)", path);
1486 WKRetainPtr<WKStringRef> webStoragePath(AdoptWK, WKStringCreateWithUTF8CString(path));
1487 WKContextSetLocalStorageDirectory(ewkContext->wkContext(), webStoragePath.get());
1495 Eina_Bool ewk_context_web_storage_path_get(Ewk_Context* ewkContext, Ewk_Web_Storage_Path_Get_Callback callback, void* userData)
1497 #if ENABLE(TIZEN_WEB_STORAGE)
1498 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1499 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1501 TIZEN_LOGI("callback (%p)", callback);
1502 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1503 context->webStoragePathCallback= callback;
1504 context->userData = userData;
1506 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1507 WKKeyValueStorageManagerGetKeyValueStoragePath(storageManager, context, didGetWebStoragePath);
1513 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)
1515 #if ENABLE(TIZEN_WEB_STORAGE) && ENABLE(TIZEN_WEBKIT2_NUMBER_TYPE_SUPPORT)
1516 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1517 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1518 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, false);
1520 Ewk_Context_Callback_Context* context = new Ewk_Context_Callback_Context;
1521 context->webStorageUsageCallback = callback;
1522 context->userData = userData;
1523 WKRetainPtr<WKStringRef> protocolRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_protocol_get(origin)));
1524 WKRetainPtr<WKStringRef> hostRef(AdoptWK, WKStringCreateWithUTF8CString(ewk_security_origin_host_get(origin)));
1525 WKRetainPtr<WKSecurityOriginRef> originRef(AdoptWK, WKSecurityOriginCreate(protocolRef.get(), hostRef.get(), ewk_security_origin_port_get(origin)));
1527 WKKeyValueStorageManagerRef storageManager = WKContextGetKeyValueStorageManager(ewkContext->wkContext());
1528 WKKeyValueStorageManagerGetKeyValueStorageUsageForOrigin(storageManager, context, didGetWebStorageUsage, originRef.get());
1536 //#if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2)
1537 Eina_Bool ewk_context_soup_data_directory_set(Ewk_Context* ewkContext, const char* path)
1539 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1540 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1542 WKRetainPtr<WKStringRef> soupDataDirectory(AdoptWK, WKStringCreateWithUTF8CString(path));
1543 WKContextSetSoupDataDirectory(ewkContext->wkContext(), soupDataDirectory.get());
1548 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_DOCUMENT_VIEWER, kWKCacheModelDocumentViewer);
1549 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_DOCUMENT_BROWSER, kWKCacheModelDocumentBrowser);
1550 COMPILE_ASSERT_MATCHING_ENUM(EWK_CACHE_MODEL_PRIMARY_WEBBROWSER, kWKCacheModelPrimaryWebBrowser);
1552 Eina_Bool ewk_context_cache_model_set(Ewk_Context* ewkContext, Ewk_Cache_Model cacheModel)
1554 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1556 ewkContext->setCacheModel(cacheModel);
1561 Ewk_Cache_Model ewk_context_cache_model_get(Ewk_Context* ewkContext)
1563 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, EWK_CACHE_MODEL_DOCUMENT_VIEWER);
1565 return ewkContext->cacheModel();
1568 Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* ewkContext, Eina_Bool cacheDisabled)
1570 #if ENABLE(TIZEN_CACHE_CONTROL)
1571 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1572 WKContextSetCacheDisabled(ewkContext->wkContext(), cacheDisabled);
1578 Eina_Bool ewk_context_cache_disabled_get(Ewk_Context* ewkContext)
1580 #if ENABLE(TIZEN_CACHE_CONTROL)
1581 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1582 return WKContextGetCacheDisabled(ewkContext->wkContext());
1588 Eina_Bool ewk_context_certificate_file_set(Ewk_Context* context, const char* certificateFile)
1590 EINA_SAFETY_ON_NULL_RETURN_VAL(context, false);
1591 EINA_SAFETY_ON_NULL_RETURN_VAL(certificateFile, false);
1592 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
1593 if (!context->setCertificateFile(certificateFile))
1596 if (fileExists(WTF::String::fromUTF8(certificateFile))) {
1597 long long fileSize = -1;
1598 getFileSize(WTF::String::fromUTF8(certificateFile), fileSize);
1599 TIZEN_LOGE("[Network] ewk_context_certificate_file_set certificateFile fileSize [%lld]\n", fileSize);
1601 TIZEN_LOGE("[Network] ewk_context_certificate_file_set certificateFile does not exist!\n");
1603 WKRetainPtr<WKStringRef> certificateFileRef(AdoptWK, WKStringCreateWithUTF8CString(certificateFile));
1604 WKContextSetCertificateFile(context->wkContext(), certificateFileRef.get());
1607 UNUSED_PARAM(context);
1608 UNUSED_PARAM(certificateFile);
1613 const char* ewk_context_certificate_file_get(const Ewk_Context* context)
1615 EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0);
1616 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
1617 return context->certificateFile();
1619 UNUSED_PARAM(context);
1624 Eina_Bool ewk_context_cache_clear(Ewk_Context* ewkContext)
1626 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1627 WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(ewkContext->wkContext());
1628 #if ENABLE(TIZEN_EWK_CONTEXT_CACHE_MANAGER_NULL_CHECK_WORKAROUND)
1632 WKResourceCacheManagerClearCacheForAllOrigins(cacheManager, WKResourceCachesToClearAll);
1637 void ewk_context_message_post_to_injected_bundle(Ewk_Context* ewkContext, const char* name, const char* body)
1639 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1640 EINA_SAFETY_ON_NULL_RETURN(name);
1641 EINA_SAFETY_ON_NULL_RETURN(body);
1643 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString(name));
1644 WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithUTF8CString(body));
1645 WKContextPostMessageToInjectedBundle(ewkContext->wkContext(), messageName.get(), messageBody.get());
1648 void ewk_context_message_from_injected_bundle_callback_set(Ewk_Context* ewkContext, Ewk_Context_Message_From_Injected_Bundle_Callback callback, void* userData)
1650 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1652 ewkContext->setMessageFromInjectedBundleCallback(callback, userData);
1655 void ewk_context_did_start_download_callback_set(Ewk_Context* ewkContext, Ewk_Context_Did_Start_Download_Callback callback, void* userData)
1657 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1659 ewkContext->setDidStartDownloadCallback(callback, userData);
1662 #if ENABLE(MEMORY_SAMPLER)
1663 void ewk_context_memory_sampler_start(Ewk_Context* ewkContext, double timerInterval)
1665 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1666 WKRetainPtr<WKDoubleRef> interval(AdoptWK, WKDoubleCreate(timerInterval));
1667 WKContextStartMemorySampler(ewkContext->wkContext(), interval.get());
1670 void ewk_context_memory_sampler_stop(Ewk_Context* ewkContext)
1672 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1673 WKContextStopMemorySampler(ewkContext->wkContext());
1677 Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context* ewkContext, const char* path)
1679 #if ENABLE(TIZEN_SUPPORT_PLUGINS)
1680 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1681 EINA_SAFETY_ON_NULL_RETURN_VAL(path, false);
1683 WKRetainPtr<WKStringRef> pluginPath(AdoptWK, WKStringCreateWithUTF8CString(path));
1684 WKContextSetAdditionalPluginsDirectory(ewkContext->wkContext(), pluginPath.get());
1692 #if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE)
1693 void ewk_context_memory_saving_mode_set(Ewk_Context* ewkContext, Eina_Bool mode)
1695 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1697 WKContextRef contextRef = ewkContext->wkContext();
1698 toImpl(contextRef)->setMemorySavingMode(mode);
1702 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
1703 void ewk_context_form_password_data_clear(Ewk_Context* ewkContext)
1705 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1706 ewkContext->clearPasswordFormData();
1709 void ewk_context_form_candidate_data_clear(Ewk_Context* ewkContext)
1711 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1712 ewkContext->clearCandidateFormData();
1715 #endif // #if OS(TIZEN)
1717 Eina_Bool ewk_context_url_scheme_register(Ewk_Context* ewkContext, const char* scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
1719 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1720 EINA_SAFETY_ON_NULL_RETURN_VAL(scheme, false);
1721 EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
1723 ewkContext->requestManager()->registerURLSchemeHandler(String::fromUTF8(scheme), callback, userData);
1728 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)
1730 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1732 TIZEN_LOGI("vibrate (%p)", vibrate);
1733 #if ENABLE(VIBRATION)
1734 ewkContext->vibrationProvider()->setVibrationClientCallbacks(vibrate, cancel, data);
1738 Eina_Bool ewk_context_tizen_extensible_api_set(Ewk_Context* ewkContext, Ewk_Extensible_API extensibleAPI, Eina_Bool enable)
1740 #if ENABLE(TIZEN_EXTENSIBLE_API)
1741 EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
1743 TIZEN_LOGI("extensibleAPI (%d) enable (%d)", extensibleAPI, enable);
1744 WKContextSetTizenExtensibleAPI(ewkContext->wkContext(), static_cast<WKTizenExtensibleAPI>(extensibleAPI), enable);
1748 UNUSED_PARAM(ewkContext);
1749 UNUSED_PARAM(extensibleAPI);
1750 UNUSED_PARAM(enable);
1756 void ewk_context_storage_path_reset(Ewk_Context* ewkContext)
1758 #if ENABLE(TIZEN_RESET_PATH)
1759 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1761 TIZEN_LOGI("ewkContext (%p)", ewkContext);
1762 WKContextResetStoragePath(ewkContext->wkContext());
1764 UNUSED_PARAM(ewkContext);
1768 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)
1770 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1772 ewkContext->historyClient()->setCallbacks(navigate, clientRedirect, serverRedirect, titleUpdate, populateVisitedLinks, data);
1775 void ewk_context_visited_link_add(Ewk_Context* ewkContext, const char* visitedURL)
1777 EINA_SAFETY_ON_NULL_RETURN(ewkContext);
1778 EINA_SAFETY_ON_NULL_RETURN(visitedURL);
1780 ewkContext->addVisitedLink(visitedURL);