[Webkit-unassigned] [Bug 70404] [EFL] Implement port layer of keygen element.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 27 03:02:37 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=70404





--- Comment #15 from Soo-Hyun Choi <s.choi at hackerslab.eu>  2011-10-27 03:02:37 PST ---
(In reply to comment #14)
> (In reply to comment #12)
> > I use the static variables because I use singletone pattern here.
> > 
> > If I use the "DEFINE_STATIC_LOCAL" macro,
> > source code might look like this.
> > 
> > SSLPrivateKeyStoreEfl* SSLPrivateKeyStoreEfl::getInstance()
> > {
> >     DEFINE_STATIC_LOCAL(SSLPrivateKeyStoreEfl, s_SSLPrivateKeyStoreEfl, ());
> >     return &s_SSLPrivateKeyStoreEfl;
> > }
> > 
> > I don't understand deeply about DEFINE_STATIC_LOCAL, 
> > is it secure enough for singtone??
> > 
> > Or, do I need to make it as critical section?
> 
> If you're in doubt, it's worth taking a look at the macro in Source/JavaScriptCore/wtf/StdLibExtras.h -- the code is very simple.

Having looked at the code mentioned in the above, it doesn't seem to guarantee the singleton pattern when used as is - i.e., it may instantiate another object if you simply use the "DEFINE_STATIC_LOCAL", in which Dongwoo have tried to avoid from in the first place.

IMHO, I'd rather suggest you to write a separate macro that guarantees the singleton pattern, if you have to use macro function instead of using in-function "static local". Alternatively, you might be able to use 

My question to the previous reviewers is that if it is mandatory to use the defined set of macros all the times, or if there is a room to use a customized macro or more specifically "static local" inside a function when necessary?

Kind regards,
Soo-Hyun

-- 
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