Bug 127261 - [EFL][WK2] Move isEwkViewEvasObject back to ewk_view.cpp
Summary: [EFL][WK2] Move isEwkViewEvasObject back to ewk_view.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryuan Choi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-19 21:39 PST by Ryuan Choi
Modified: 2014-01-20 21:22 PST (History)
7 users (show)

See Also:


Attachments
Patch (7.88 KB, patch)
2014-01-19 21:46 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (7.56 KB, patch)
2014-01-20 19:45 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.