<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    IMHO, scoping the function by its class is cleaner.<br>
    <a class="moz-txt-link-freetext" href="http://trac.webkit.org/changeset/179247">http://trac.webkit.org/changeset/179247</a> looks like an improvement to
    me.<br>
    <br>
    Benjamin<br>
    <br>
    <div class="moz-cite-prefix">On 1/28/15 11:30 AM, Chris Dumez wrote:<br>
    </div>
    <blockquote
      cite="mid:44185F6C-6185-4EB9-AA51-9279580501F2@apple.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      Hi,
      <div class=""><br class="">
      </div>
      <div class="">I noticed that we are currently not very consistent
        in WebKit in the way we implement singleton classes instance
        getters.</div>
      <div class="">- Some classes use free functions (like MemoryCache,
        and PageCache until I updated it yesterday). e.g.
        memoryCache().xxx()</div>
      <div class="">- Some classes are using static functions in the
        class (e.g. DatabaseProcess::shared(), PluginProcess::shared()).</div>
      <div class=""><br class="">
      </div>
      <div class="">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 class="">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 class="">as part of our coding style.</div>
      <div class=""><br class="">
      </div>
      <div class="">Any feedback on this matter?</div>
      <div class=""><br class="">
      </div>
      <div class="">Kr,<br class="">
        <div class="">
          <div style="color: rgb(0, 0, 0); letter-spacing: normal;
            orphans: auto; text-align: start; text-indent: 0px;
            text-transform: none; white-space: normal; widows: auto;
            word-spacing: 0px; -webkit-text-stroke-width: 0px;
            word-wrap: break-word; -webkit-nbsp-mode: space;
            -webkit-line-break: after-white-space;" class="">
            <div class="">--</div>
            <div class="">Chris Dumez - Apple Inc.</div>
            <div class="">Cupertino, CA</div>
            <div class=""><br class="">
            </div>
          </div>
          <br class="Apple-interchange-newline">
          <br class="Apple-interchange-newline">
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
webkit-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a>
<a class="moz-txt-link-freetext" href="https://lists.webkit.org/mailman/listinfo/webkit-dev">https://lists.webkit.org/mailman/listinfo/webkit-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>