[Webkit-unassigned] [Bug 101904] [EFL][WK2] Add API to execute js script

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 14 01:56:41 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=101904





--- Comment #8 from Gyuyoung Kim <gyuyoung.kim at samsung.com>  2012-12-14 01:59:01 PST ---
(From update of attachment 173587)
View in context: https://bugs.webkit.org/attachment.cgi?id=173587&action=review

>>>>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:926
>>>>> +struct _Ewk_View_Script_Execute_Callback_Context {
>>>> 
>>>> I think ewk_view_private.h or EwkViewImpl.h is more better place for this struct.
>>> 
>>> Why? if this struct is used only in ewk_view.cpp, then I think this is the right place for it. However, we don't use _ prefix for such structures anymore.
>> 
>> If so, what do you think ewk_view_private.h role ? Do you think it isn't for internal data type or struct ?
> 
> ewk_view_private.h should be used for structures / macros that need to be shared between several files.
> In this case, Ewk_View_Script_Execute_Callback_Context is only used internally by ewk_view.cpp. There is no point in sharing it with other implementation files since none of them will use it. It would only make compile time longer.

I agree. Thanks.

>>>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:943
>>>> +    JSGlobalContextRef jsGlobalContext = impl->ewkContext()->jsGlobalContext();
>>> 
>>> Don't you need to free jsGlobalContext using JSGlobalContextRelease() after finishing to use it ?
>> 
>> Looks like the global context object is owned by Ewk_Context so I don't think we should free it here.
> 
> Ok

BTW, could you explain why jsGlobalContext should be maintained by ewkContext ? Because, it seems jsGlobalContext() is just used by this callback now.
If there is no reason, is below code enough ?

JSGlobalContextRef jsGlobalContext = JSGlobalContextCreate(0);
...
...
JSGlobalContextRelease(jsGlobalContext);

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list