Bug 100370

Summary: [EFL][WK2] Remove some C'ism from EwkView
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit EFLAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, gyuyoung.kim, kenneth, laszlo.gombos, lucas.de.marchi, mikhail.pozdnyakov, rakuco, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 100273    
Attachments:
Description Flags
Patch
gyuyoung.kim: review+
Patch
none
Patch none

Description Chris Dumez 2012-10-25 05:00:23 PDT
EwkView still contains quite a bit of C'ism. We should gradually get rid of it.
Comment 1 Chris Dumez 2012-10-25 06:18:11 PDT
Created attachment 170623 [details]
Patch
Comment 2 Mikhail Pozdnyakov 2012-10-25 06:21:21 PDT
Comment on attachment 170623 [details]
Patch

looks good
Comment 3 Gyuyoung Kim 2012-10-25 06:27:56 PDT
Comment on attachment 170623 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=170623&action=review

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:112
> +PassOwnPtr<Ecore_IMF_Context> EwkViewImpl::createIMFContext(Ewk_View_Smart_Data* sd)

Why not using smartData instead of sd ?
Comment 4 Chris Dumez 2012-10-25 06:52:01 PDT
(In reply to comment #3)
> (From update of attachment 170623 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=170623&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:112
> > +PassOwnPtr<Ecore_IMF_Context> EwkViewImpl::createIMFContext(Ewk_View_Smart_Data* sd)
> 
> Why not using smartData instead of sd ?

Because it conflicts with the method name smartData() in the same class.
Comment 5 Chris Dumez 2012-10-25 06:59:47 PDT
Created attachment 170636 [details]
Patch

Requesting r? again because I had to move the mouse / touch callbacks to EwkViewImpl to address an API tests regression.
Comment 6 Kenneth Rohde Christiansen 2012-10-25 07:05:22 PDT
Comment on attachment 170636 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=170636&action=review

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:225
> +    data = edje_object_data_get(m_cursorObject.get(), "hot.y");

This is getting quite hot :-)

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:559
> +bool EwkViewImpl::focused() const

why not isFocused() that is like webkit style

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:576
> +Ecore_IMF_Context* EwkViewImpl::imfContext()

i really dislike the imf abbrivation
Comment 7 Antonio Gomes 2012-10-25 07:11:31 PDT
Comment on attachment 170636 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=170636&action=review

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:106
> +    free(buffer);

Unrelated?

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:588
> -    _ewk_view_imf_context_destroy(imfContext);
> -
>      void* item;
>      EINA_LIST_FREE(popupMenuItems, item)
>          delete static_cast<Ewk_Popup_Menu_Item*>(item);
> +    if (m_theme != theme) {

Do you really want to compare the memory addresses here?
Comment 8 Chris Dumez 2012-10-25 07:27:15 PDT
Comment on attachment 170636 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=170636&action=review

>> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:106
>> +    free(buffer);
> 
> Unrelated?

Hmm. Yes, this is a memory leak fix. Do you really want me to move it to a separate patch?

>> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:559
>> +bool EwkViewImpl::focused() const
> 
> why not isFocused() that is like webkit style

Ok.

>> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:588
>> +    if (m_theme != theme) {
> 
> Do you really want to compare the memory addresses here?

I am not :) m_theme is a WKEinaSharedString. Therefore it is safe.
Comment 9 Chris Dumez 2012-10-25 07:43:06 PDT
Comment on attachment 170636 [details]
Patch

Will take feedback into consideration and reupload.
Comment 10 Chris Dumez 2012-10-25 08:33:25 PDT
Created attachment 170657 [details]
Patch

Take feedback from Kenneth and Antonio into consideration:
- Renamed visible() / focused() to isVisible() / isFocused()
- Moved memory leak fix to another patch (Bug 100380)
- renamed "imf" to "inputMethod"
- Rebase on master since some AC fixes landed
Comment 11 Chris Dumez 2012-10-25 08:45:13 PDT
Comment on attachment 170657 [details]
Patch

Could someone please cq+ ?
Comment 12 WebKit Review Bot 2012-10-25 09:55:18 PDT
Comment on attachment 170657 [details]
Patch

Clearing flags on attachment: 170657

Committed r132498: <http://trac.webkit.org/changeset/132498>
Comment 13 WebKit Review Bot 2012-10-25 09:55:23 PDT
All reviewed patches have been landed.  Closing bug.