Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Ryosuke Niwa
On Wed, Jan 28, 2015 at 9:19 PM, Maciej Stachowiak wrote: > > This may be a question of what jargon we've encountered, but to me, > "singleton" clearly means "the one unique instance of this class" while > "instance" means "any instance of this class". If I hadn't seen this > thread, I would inte

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Timothy Hatcher
Yeah, that is exactly what I was thinking. Instance does not imply "only one" like singleton does. Call a singleton a singleton, we have a word for it. — Timothy Hatcher > On Jan 28, 2015, at 9:19 PM, Maciej Stachowiak wrote: > > This may be a question of what jargon we’ve encountered, but to

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Chris Dumez
Fair enough, singleton() is very explicit indeed. I would be happy with this naming too. -- Chris Dumez - Apple Inc. Cupertino, CA > On Jan 28, 2015, at 9:19 PM, Maciej Stachowiak wrote: > > > This may be a question of what jargon we’ve encountered, but to me, > “singleton" clearly means "th

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Maciej Stachowiak
This may be a question of what jargon we’ve encountered, but to me, “singleton" clearly means "the one unique instance of this class" while “instance" means "any instance of this class". If I hadn’t seen this thread, I would interpret Class::instance() to mean “create a brand new instance of th

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Chris Dumez
Yes, instance() is what I’ve seen mostly outside WebKit as well. This would be my preference. Kr, -- Chris Dumez - Apple Inc. Cupertino, CA > On Jan 28, 2015, at 8:44 PM, Michael Catanzaro wrote: > > On Wed, Jan 28, 2015 at 8:11 PM, Maciej Stachowiak wrote: >> Yet another possibility is findi

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Filip Pizlo
> On Jan 28, 2015, at 8:44 PM, Michael Catanzaro wrote: > > On Wed, Jan 28, 2015 at 8:11 PM, Maciej Stachowiak wrote: >> Yet another possibility is finding a better name than ‘shared’ for the >> singleton pattern function, but I don’t have any better ideas. >> Class::getSingleton() is more ex

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Michael Catanzaro
On Wed, Jan 28, 2015 at 8:11 PM, Maciej Stachowiak wrote: Yet another possibility is finding a better name than ‘shared’ for the singleton pattern function, but I don’t have any better ideas. Class::getSingleton() is more explicit but the extra verbosity doesn’t seem helpful to me. I recomme

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Gavin Barraclough
Gotta say, ‘singleton’ seems like a really good name for singletons. G. > On Jan 28, 2015, at 7:06 PM, Filip Pizlo wrote: > > This is shorter: Class::singleton() > > It's also more consistent with the rest of our style (we usually don't put > "get" in getter names). > > -Filip > >> On Jan

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Yong Li
"Class::unique()" is one of the known names for singletons Yong Li From: Maciej Stachowiak Sent: ‎1/‎28/‎2015 9:11 PM To: Darin Adler Cc: WebKit Development Subject: Re: [webkit-dev]

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Filip Pizlo
This is shorter: Class::singleton() It's also more consistent with the rest of our style (we usually don't put "get" in getter names). -Filip > On Jan 28, 2015, at 6:11 PM, Maciej Stachowiak wrote: > > >> On Jan 28, 2015, at 4:28 PM, Darin Adler wrote: >> >> I like the economy of the smal

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Maciej Stachowiak
> On Jan 28, 2015, at 4:28 PM, Darin Adler wrote: > > I like the economy of the smaller non-member function name; it seems overly > wordy to be constantly stating the class name as well as the nearly > meaningless word “shared”. I think the word “shared” is what I like least > about the membe

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Darin Adler
I like the economy of the smaller non-member function name; it seems overly wordy to be constantly stating the class name as well as the nearly meaningless word “shared”. I think the word “shared” is what I like least about the member function approach. It had always thought that we used static

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Maciej Stachowiak
Perhaps we should document this in the coding style guidelines. I like consistency and static member function seems like a good way to go, particularly since it matches the Class::create() pattern we often use for non-singletons. > On Jan 28, 2015, at 12:10 PM, Ryosuke Niwa wrote: > > Class:

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Ryosuke Niwa
Class::shared() pattern seems good to me. - R. Niwa On Wed, Jan 28, 2015 at 11:38 AM, Benjamin Poulain wrote: > IMHO, scoping the function by its class is cleaner. > http://trac.webkit.org/changeset/179247 looks like an improvement to me. > > Benjamin > > > On 1/28/15 11:30 AM, Chris Dumez wro

Re: [webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Benjamin Poulain
IMHO, scoping the function by its class is cleaner. http://trac.webkit.org/changeset/179247 looks like an improvement to me. Benjamin On 1/28/15 11:30 AM, Chris Dumez wrote: Hi, I noticed that we are currently not very consistent in WebKit in the way we implement singleton classes instance ge

[webkit-dev] Pattern for singleton classes instance getters

2015-01-28 Thread Chris Dumez
Hi, I noticed that we are currently not very consistent in WebKit in the way we implement singleton classes instance getters. - Some classes use free functions (like MemoryCache, and PageCache until I updated it yesterday). e.g. memoryCache().xxx() - Some classes are using static functions in th

[webkit-dev] Please try out the SVG -> OTF Font converter!

2015-01-28 Thread Myles C. Maxfield
Hello, I’ve been working on a cross-platform converter to translate SVG fonts into OpenType fonts, with the goal of eventually replacing WebKit support of SVG fonts with platform support of OpenType fonts. This work has reached a point where we have turned it on in the Mac port. It would be us

Re: [webkit-dev] WebRTC in WebKit

2015-01-28 Thread Benjamin Poulain
Getting WebRTC working on WebKitGTK sounds awesome. I am a little concerned with the use of an abstraction layer as a backend. I am afraid this could lead to weird abstractions. Typically in WebKit we try to have baseline code in C++ that handles everything that can be shared between ports, a

[webkit-dev] WebRTC in WebKit

2015-01-28 Thread Adam Bergkvist
Hi Back in 2011-2012 there was some work done to implement WebRTC in WebKit by Google and Ericsson [1]. At the time, it was only the chromium port that had a WebRTC backend implemented (webrtc.org) and a fully testable implementation. As of late 2014, there is an alternative WebRTC implementation