Bug 100232 - [EFL][WK2] Clean up construction/destruction code in Ewk_view
Summary: [EFL][WK2] Clean up construction/destruction code in Ewk_view
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: Mikhail Pozdnyakov
URL:
Keywords:
Depends on: 100228 100552
Blocks: 100226 100273
  Show dependency treegraph
 
Reported: 2012-10-24 04:39 PDT by Mikhail Pozdnyakov
Modified: 2012-10-26 14:28 PDT (History)
9 users (show)

See Also:


Attachments
patch (39.08 KB, patch)
2012-10-26 04:15 PDT, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
rebased (39.05 KB, patch)
2012-10-26 04:42 PDT, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
patch v2 (39.05 KB, patch)
2012-10-26 04:54 PDT, Mikhail Pozdnyakov
kenneth: review+
Details | Formatted Diff | Diff
patch v3 (39.13 KB, patch)
2012-10-26 05:40 PDT, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Pozdnyakov 2012-10-24 04:39:25 PDT
Currently construction/destruction code in Ewk_view is really overcomplicated, it comprises of multiple stages and multiple functions to be invoked, this should be simplified as much as possible. Most of the code should go to destructor/constructor of EwkViewImpl class see bug#100228.
Comment 1 Mikhail Pozdnyakov 2012-10-26 04:15:16 PDT
Created attachment 170882 [details]
patch
Comment 2 Mikhail Pozdnyakov 2012-10-26 04:42:15 PDT
Created attachment 170890 [details]
rebased
Comment 3 Chris Dumez 2012-10-26 04:47:01 PDT
Comment on attachment 170890 [details]
rebased

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:537
> +    smartData->priv = new EwkViewImpl(ewkView, context, pageGroup);

I would add a ASSERT(!smartData->priv); right before this line to be safe

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:553
> +    return createEwkView(canvas, smart, context, 0);

Maybe you can add an inline comment to clarify what the 0 stands for
Comment 4 Chris Dumez 2012-10-26 04:49:17 PDT
Comment on attachment 170890 [details]
rebased

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

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:537
>> +    smartData->priv = new EwkViewImpl(ewkView, context, pageGroup);
> 
> I would add a ASSERT(!smartData->priv); right before this line to be safe

Oh, it's there already, sorry :)
Comment 5 Mikhail Pozdnyakov 2012-10-26 04:50:25 PDT
> > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:553
> > +    return createEwkView(canvas, smart, context, 0);
> 
> Maybe you can add an inline comment to clarify what the 0 stands for
would better make it default value :)
Comment 6 Mikhail Pozdnyakov 2012-10-26 04:54:27 PDT
Created attachment 170893 [details]
patch v2

added default value for pageGroupRef in createEwkView.
Comment 7 Chris Dumez 2012-10-26 05:00:38 PDT
Comment on attachment 170893 [details]
patch v2

LGTM.
Comment 8 Kenneth Rohde Christiansen 2012-10-26 05:16:11 PDT
Comment on attachment 170893 [details]
patch v2

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

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h:111
> +    WebKit::WebPageProxy* page() { return m_pageProxy.get(); }

why remove the inline?

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h:230
> +    // Note, initialization order is important.

initialization order matters :-) it is not just important

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h:249
> +    Evas_GL* m_evasGl;
> +    Evas_GL_Context* m_evasGlContext;
> +    Evas_GL_Surface* m_evasGlSurface;

maybe we should add OwnPtr support for these
Comment 9 Chris Dumez 2012-10-26 05:18:00 PDT
Comment on attachment 170893 [details]
patch v2

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

>> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h:111
>> +    WebKit::WebPageProxy* page() { return m_pageProxy.get(); }
> 
> why remove the inline?

They are defined in the header so they are inlined anyway.

>> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h:249
>> +    Evas_GL_Surface* m_evasGlSurface;
> 
> maybe we should add OwnPtr support for these

I thought about this but it is not easy because the free functions for Evas_GL_Context and Evas_GL_Surface require the Evas_GL object as well.
Comment 10 Kenneth Rohde Christiansen 2012-10-26 05:20:10 PDT
(In reply to comment #9)
> (From update of attachment 170893 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=170893&action=review
> 
> >> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h:111
> >> +    WebKit::WebPageProxy* page() { return m_pageProxy.get(); }
> > 
> > why remove the inline?
> 
> They are defined in the header so they are inlined anyway.

Only when called from the same class no? which is mostly the case right
Comment 11 Mikhail Pozdnyakov 2012-10-26 05:27:24 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > (From update of attachment 170893 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=170893&action=review
> > 
> > >> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h:111
> > >> +    WebKit::WebPageProxy* page() { return m_pageProxy.get(); }
> > > 
> > > why remove the inline?
> > 
> > They are defined in the header so they are inlined anyway.
> 
> Only when called from the same class no? which is mostly the case right

As far as I know member functions are implicit inline provided they are defined inside their class independently from where they called. Anyway methods should be consistent with each other: either all of them (defined in header) have 'inline' or all not have.
Comment 12 Mikhail Pozdnyakov 2012-10-26 05:40:11 PDT
Created attachment 170904 [details]
patch v3

initialization order matters :)
Comment 13 WebKit Review Bot 2012-10-26 06:43:51 PDT
Comment on attachment 170904 [details]
patch v3

Clearing flags on attachment: 170904

Committed r132647: <http://trac.webkit.org/changeset/132647>
Comment 14 WebKit Review Bot 2012-10-26 06:43:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Chris Dumez 2012-10-26 14:11:26 PDT
Comment on attachment 170904 [details]
patch v3

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:-576
> -    impl->pageProxy->pageGroup()->preferences()->setWebGLEnabled(true);

It seems like you lost some code here. This new WebGL code is removed from ewk_view.cpp but wasn't added to EwkViewImpl.cpp. Rebasing problem?