Bug 127261

Summary: [EFL][WK2] Move isEwkViewEvasObject back to ewk_view.cpp
Product: WebKit Reporter: Ryuan Choi <ryuan.choi>
Component: WebKit EFLAssignee: Ryuan Choi <ryuan.choi>
Status: RESOLVED FIXED    
Severity: Normal CC: bunhere, cdumez, commit-queue, gyuyoung.kim, gyuyoung.kim, lucas.de.marchi, rakuco
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Ryuan Choi 2014-01-19 21:39:24 PST
isEwkViewEvasObject is general check routine of EFL and mainly used in ewk_view.cpp but it was in EwkView.cpp since separated EwkView.cpp from ewk_view.cpp
Comment 1 Ryuan Choi 2014-01-19 21:46:39 PST
Created attachment 221610 [details]
Patch
Comment 2 Gyuyoung Kim 2014-01-19 22:01:51 PST
Comment on attachment 221610 [details]
Patch

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

> Source/WebKit2/ChangeLog:9
> +        ewk_view.cpp but it was in EwkView.cpp since separated EwkView.cpp from ewk_view.cpp

Isn't any possibility used by other ewk files ?
Comment 3 Ryuan Choi 2014-01-19 22:12:21 PST
(In reply to comment #2)
> (From update of attachment 221610 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221610&action=review
> 
> > Source/WebKit2/ChangeLog:9
> > +        ewk_view.cpp but it was in EwkView.cpp since separated EwkView.cpp from ewk_view.cpp
> 
> Isn't any possibility used by other ewk files ?

Sure, I believe that internal files must use the object correctly and they should not call it directly (except EwkView.cpp).

The major purpose of this function is for public APIs which we can not guarantee the argument.
Comment 4 Gyuyoung Kim 2014-01-20 00:07:39 PST
Comment on attachment 221610 [details]
Patch

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

>>> Source/WebKit2/ChangeLog:9
>>> +        ewk_view.cpp but it was in EwkView.cpp since separated EwkView.cpp from ewk_view.cpp
>> 
>> Isn't any possibility used by other ewk files ?
> 
> Sure, I believe that internal files must use the object correctly and they should not call it directly (except EwkView.cpp).
> 
> The major purpose of this function is for public APIs which we can not guarantee the argument.

I don't have a big opinion to move it to ewk_view.cpp. However, I don't see what is benefit when we move it from EwkView.cpp to ewk_view.cpp. 

Rather, we need to add additional a member function as below,
 static const char smartClassName[];

Is there any benefit ?
Comment 5 Ryuan Choi 2014-01-20 00:15:04 PST
(In reply to comment #4)
> (From update of attachment 221610 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221610&action=review
> 
> >>> Source/WebKit2/ChangeLog:9
> >>> +        ewk_view.cpp but it was in EwkView.cpp since separated EwkView.cpp from ewk_view.cpp
> >> 
> >> Isn't any possibility used by other ewk files ?
> > 
> > Sure, I believe that internal files must use the object correctly and they should not call it directly (except EwkView.cpp).
> > 
> > The major purpose of this function is for public APIs which we can not guarantee the argument.
> 
> I don't have a big opinion to move it to ewk_view.cpp. However, I don't see what is benefit when we move it from EwkView.cpp to ewk_view.cpp. 
> 
> Rather, we need to add additional a member function as below,
>  static const char smartClassName[];
> 
> Is there any benefit ?

Now, every API should call it to check validity.
After moved, it will be inlined.

Although it is not big advantage, I think that it should be better and logically right.

smartClassName is exposed but it's only static and it is already defined in code.
So, I think that it's fine.
Comment 6 Gyuyoung Kim 2014-01-20 00:38:39 PST
Comment on attachment 221610 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:-126
> -    ASSERT(isEwkViewEvasObject(evasObject));

Are you sure we don't need to check this one here ?
Comment 7 Ryuan Choi 2014-01-20 01:24:38 PST
(In reply to comment #6)
> (From update of attachment 221610 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221610&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/EwkView.cpp:-126
> > -    ASSERT(isEwkViewEvasObject(evasObject));
> 
> Are you sure we don't need to check this one here ?

I briefly checked and I think that its call path is too simple to doubt the type of evasObject.

Callers only called using m_evasObject in EwkView.cpp locally.

Anyway,
We may want to use isEwkViewEvasObject for assertion in EwkView.cpp (There are only few cases like above) while we must use it for verification in ewk_view.cpp.

If we should consider the assertions, I can move it to EwkView.h.
Comment 8 Gyuyoung Kim 2014-01-20 18:47:56 PST
Comment on attachment 221610 [details]
Patch

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

>>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:-126
>>> -    ASSERT(isEwkViewEvasObject(evasObject));
>> 
>> Are you sure we don't need to check this one here ?
> 
> I briefly checked and I think that its call path is too simple to doubt the type of evasObject.
> 
> Callers only called using m_evasObject in EwkView.cpp locally.
> 
> Anyway,
> We may want to use isEwkViewEvasObject for assertion in EwkView.cpp (There are only few cases like above) while we must use it for verification in ewk_view.cpp.
> 
> If we should consider the assertions, I can move it to EwkView.h.

I think it is safer to keep this assertion on debug. Please keep it.
Comment 9 Ryuan Choi 2014-01-20 19:45:33 PST
Created attachment 221714 [details]
Patch
Comment 10 Ryuan Choi 2014-01-20 19:46:29 PST
(In reply to comment #8)
> (From update of attachment 221610 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221610&action=review
> 
> >>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:-126
> >>> -    ASSERT(isEwkViewEvasObject(evasObject));
> >> 
> >> Are you sure we don't need to check this one here ?
> > 
> > I briefly checked and I think that its call path is too simple to doubt the type of evasObject.
> > 
> > Callers only called using m_evasObject in EwkView.cpp locally.
> > 
> > Anyway,
> > We may want to use isEwkViewEvasObject for assertion in EwkView.cpp (There are only few cases like above) while we must use it for verification in ewk_view.cpp.
> > 
> > If we should consider the assertions, I can move it to EwkView.h.
> 
> I think it is safer to keep this assertion on debug. Please keep it.

OK, I moved.
Comment 11 Gyuyoung Kim 2014-01-20 20:52:44 PST
Comment on attachment 221714 [details]
Patch

Though I don't this this patch has a big benefit, it looks there is no critical problem. rs=me.
Comment 12 Gyuyoung Kim 2014-01-20 20:53:36 PST
(In reply to comment #11)
> (From update of attachment 221714 [details])
> Though I don't this this patch has a big benefit, it looks there is no critical problem. rs=me.

s/don't this/don't think/g
Comment 13 WebKit Commit Bot 2014-01-20 21:22:23 PST
Comment on attachment 221714 [details]
Patch

Clearing flags on attachment: 221714

Committed r162426: <http://trac.webkit.org/changeset/162426>
Comment 14 WebKit Commit Bot 2014-01-20 21:22:27 PST
All reviewed patches have been landed.  Closing bug.