[Webkit-unassigned] [Bug 89186] [EFL][WK2] Add APIs to create, delete and get ewk_context.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 12 20:19:24 PDT 2012


--- Comment #11 from EunMi Lee <eunmi15.lee at samsung.com>  2012-07-12 20:19:24 PST ---
(In reply to comment #10)
> (From update of attachment 149910 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=149910&action=review
> This patch probably needs updating because the Ewk Context now contains the BatteryProvider.

OK, I will rebase the patch, thanks for your information.

> > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:35
> > +    _Ewk_Context(WKRetainPtr<WKContextRef> contextRef)
> Why this change?
> > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:54
> > +    return new Ewk_Context(adoptWK(WKContextCreate()));
> return new Ewk_Context(WKContextCreate()); ?

We have to use adoptWK() here because WKContextCreate() returns leakPtr(),
and we have to get that using WKRetainPtr in the line 35 to prevent memory leak.

> > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:65
> > +Eina_Bool ewk_context_free(Ewk_Context* ewkContext)
> Our *_free() functions usually don't return a boolean I believe.
> > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:69
> > +    if (toImpl(ewkContext->context.get())->refCount() > 1)
> This check does not look right. You need to free the ewkContext no matter what, the WKContext ref count does not matter here.

Actually, there is a matter for ewk_view when we free ewk_context directly even though there is no matter for WKContext.
Suppose that there is a ewk_view which has a reference of ewk_context,
it will have the freed memory's reference if we free the ewk_context whenever ewk_context_free() is called.
So, I want to check that there is a reference of ewk_context or not by using WKContext's refCount because ewk_context and WKContext have the same reference count.

> > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:524
> > +    return priv->context;
> Blank line before return?

OK, I will add blank line when I rebase the patch :)

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