<div dir="ltr">Class::shared() pattern seems good to me.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">- R. Niwa</div></div>
<br><div class="gmail_quote">On Wed, Jan 28, 2015 at 11:38 AM, Benjamin Poulain <span dir="ltr"><<a href="mailto:benjamin@webkit.org" target="_blank">benjamin@webkit.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
IMHO, scoping the function by its class is cleaner.<br>
<a href="http://trac.webkit.org/changeset/179247" target="_blank">http://trac.webkit.org/changeset/179247</a> looks like an improvement to
me.<br>
<br>
Benjamin<div><div class="h5"><br>
<br>
<div>On 1/28/15 11:30 AM, Chris Dumez wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
Hi,
<div><br>
</div>
<div>I noticed that we are currently not very consistent
in WebKit in the way we implement singleton classes instance
getters.</div>
<div>- Some classes use free functions (like MemoryCache,
and PageCache until I updated it yesterday). e.g.
memoryCache().xxx()</div>
<div>- Some classes are using static functions in the
class (e.g. DatabaseProcess::shared(), PluginProcess::shared()).</div>
<div><br>
</div>
<div>As I said, I landed a patch yesterday so that the
global page cache is now accessed via PageCache::shared()
because I thought this was the currently preferred pattern
(given it seems very common in WebKit2 code).</div>
<div>However, I thought I would email webkit-dev to make
sure this is actually the case and make sure we agree on a given
pattern (one way or another) for current and future code. We
could then maybe document this</div>
<div>as part of our coding style.</div>
<div><br>
</div>
<div>Any feedback on this matter?</div>
<div><br>
</div>
<div>Kr,<br>
<div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div>--</div>
<div>Chris Dumez - Apple Inc.</div>
<div>Cupertino, CA</div>
<div><br>
</div>
</div>
<br>
<br>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
webkit-dev mailing list
<a href="mailto:webkit-dev@lists.webkit.org" target="_blank">webkit-dev@lists.webkit.org</a>
<a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank">https://lists.webkit.org/mailman/listinfo/webkit-dev</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
webkit-dev mailing list<br>
<a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>
<a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank">https://lists.webkit.org/mailman/listinfo/webkit-dev</a><br>
<br></blockquote></div><br></div>