From 5ef7c8a6a70875d4430752d146bdcb069605d71d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 21 Aug 2012 10:57:44 +0200 Subject: Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147) New snapshot including various build fixes for newer Qt 5 --- Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp | 48 ++++++------------------- 1 file changed, 11 insertions(+), 37 deletions(-) (limited to 'Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp') diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp index 856179346..ed5950311 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp @@ -29,6 +29,7 @@ #include "WKAPICast.h" #include "WKArray.h" #include "WKDictionary.h" +#include "WKEinaSharedString.h" #include "WKIntentData.h" #include "WKRetainPtr.h" #include "WKString.h" @@ -47,26 +48,23 @@ struct _Ewk_Intent { #if ENABLE(WEB_INTENTS) WKRetainPtr wkIntent; #endif - const char* action; - const char* type; - const char* service; + WKEinaSharedString action; + WKEinaSharedString type; + WKEinaSharedString service; _Ewk_Intent(WKIntentDataRef intentRef) : __ref(1) #if ENABLE(WEB_INTENTS) , wkIntent(intentRef) + , action(AdoptWK, WKIntentDataCopyAction(intentRef)) + , type(AdoptWK, WKIntentDataCopyType(intentRef)) + , service(AdoptWK, WKIntentDataCopyService(intentRef)) #endif - , action(0) - , type(0) - , service(0) { } ~_Ewk_Intent() { ASSERT(!__ref); - eina_stringshare_del(action); - eina_stringshare_del(type); - eina_stringshare_del(service); } }; @@ -103,47 +101,23 @@ void ewk_intent_unref(Ewk_Intent* intent) const char* ewk_intent_action_get(const Ewk_Intent* intent) { -#if ENABLE(WEB_INTENTS) - EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0); - - WKRetainPtr wkAction(AdoptWK, WKIntentDataCopyAction(wkIntent)); - Ewk_Intent* ewkIntent = const_cast(intent); - eina_stringshare_replace(&ewkIntent->action, toImpl(wkAction.get())->string().utf8().data()); + EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0); return intent->action; -#else - return 0; -#endif } const char* ewk_intent_type_get(const Ewk_Intent* intent) { -#if ENABLE(WEB_INTENTS) - EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0); - - WKRetainPtr wkType(AdoptWK, WKIntentDataCopyType(wkIntent)); - Ewk_Intent* ewkIntent = const_cast(intent); - eina_stringshare_replace(&ewkIntent->type, toImpl(wkType.get())->string().utf8().data()); + EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0); return intent->type; -#else - return 0; -#endif } const char* ewk_intent_service_get(const Ewk_Intent* intent) { -#if ENABLE(WEB_INTENTS) - EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0); - - WKRetainPtr wkService(AdoptWK, WKIntentDataCopyService(wkIntent)); - Ewk_Intent* ewkIntent = const_cast(intent); - eina_stringshare_replace(&ewkIntent->service, toImpl(wkService.get())->string().utf8().data()); + EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0); return intent->service; -#else - return 0; -#endif } Eina_List* ewk_intent_suggestions_get(const Ewk_Intent* intent) @@ -171,7 +145,7 @@ const char* ewk_intent_extra_get(const Ewk_Intent* intent, const char* key) EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0); WKRetainPtr keyRef = adoptWK(WKStringCreateWithUTF8CString(key)); - WKRetainPtr wkValue(AdoptWK, WKIntentDataCopyExtra(wkIntent, keyRef.get())); + WKRetainPtr wkValue(AdoptWK, WKIntentDataCopyExtraValue(wkIntent, keyRef.get())); String value = toImpl(wkValue.get())->string(); if (value.isEmpty()) return 0; -- cgit v1.2.1