[webkit-efl] Encapsulation of ref counting in EWK classes (WK2 EFL)

Pozdnyakov, Mikhail mikhail.pozdnyakov at intel.com
Mon Oct 29 09:23:42 PDT 2012


FOA, I'm glad  to say that there is no manual ref counting in WK2 EFL classes any more :)

This however also gives us another enhancement opportunity which I'd like to discuss now.

As all the ref-counting EWK classes are inherited from WTF::RefCounted
it is possible now to have generic REF/UNREF functions in the public API instead of 
having separate pair of such functions for every object.

To say in more details we could introduce 
struct Ewk_Ref_Counted Ewk_Ref_Counted;
and following generic functions:
EAPI Ewk_Ref_Counted*  ewk_ref(Ewk_Ref_Counted*);
EAPI  ewk_unref(Ewk_Ref_Counted*);

then Ewk_Back_Forward_List_Item for instance can be declared as

typedef Ewk_Ref_Counted Ewk_Back_Forward_List_Item;

so that it's clear that Ewk_Back_Forward_List_Item is ref-countable.

Would like to hear your opinion about this proposal.


From: Pozdnyakov, Mikhail
Sent: Tuesday, October 16, 2012 4:48 PM
To: webkit-efl at lists.webkit.org
Subject: Encapsulation of ref counting in EWK classes (WK2 EFL)

Hi all,

The idea is that EWK internal structures (those which use ref counting) can be inherited from WTF::RefCounted class,
It gives following benefits:

1)      Ref counting code is encapsulated and not copy/pasted between EWK structures.

2)      It is possible to use internally RefPtr and PassRefPtr smart pointers which also saves a lot of lines of code

Here you can see an example http://trac.webkit.org/changeset/131298 of the described approach applied.

There is also a meta bug https://bugs.webkit.org/show_bug.cgi?id=99321 for gradual refactoring of all of the EWK classes.
If someone is volunteering to modify  a certain EWK class accordingly to the described approach please
put your bug as a dependency for the meta bug.

Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

More information about the webkit-efl mailing list