[Webkit-unassigned] [Bug 95672] [EFL][WK2] Add javascript popup api.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 4 06:41:40 PDT 2012


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





--- Comment #5 from Christophe Dumez <christophe.dumez at intel.com>  2012-09-04 06:41:52 PST ---
(From update of attachment 161938)
View in context: https://bugs.webkit.org/attachment.cgi?id=161938&action=review

>>> Source/WebKit2/UIProcess/API/efl/ewk_view.h:239
>>> + */
>> 
>> You should document that the strings are stringshared.
> 
> I think this structure have no need to use the stringshared.
> There is no use case to return some string with this structure from application side to webkit side.
> This structure type just passes the message or default value string through the callback function.
> So user can just read strings and use it, and have no need to delete or change this.

The point is that the client application may want to keep the strings and they could use eina_stringshare_ref() for this instead of strdup(). Exposing non-stringshared strings is unexpected for EFL port and is error prone.

>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:276
>>> +    destination->alert.message = strdup(source->alert.message);
>> 
>> Should use eina_stringshare_ref() instead of strdup().
> 
> Should this structure be changed to using eina stringshare because of this test case code?
> Actually test case just use this structure to keep the strings for checking,
> and can use some other way or define other structure for keeping the data.
> 
> If strdup in test case is a problem, how about changing the test case code?

The point is that the application may need to "copy" the strings in the structure as well. And using eina_stringshare_ref() should be more efficient than strdup(). As far as I know, we never expose "raw" strings to the client so it knows it can safely can eina_stringshare_ref() on them.

-- 
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