Changeset 242273 in webkit


Ignore:
Timestamp:
Mar 1, 2019 11:21:15 AM (5 years ago)
Author:
rniwa@webkit.org
Message:

Codify the naming convention for fooIfExists
https://bugs.webkit.org/show_bug.cgi?id=194930

Reviewed by Darin Adler.

Updating the coding style guideline after the discussion following
https://lists.webkit.org/pipermail/webkit-dev/2013-June/025056.html

  • code-style.md:
Location:
trunk/Websites/webkit.org
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/webkit.org/ChangeLog

    r241839 r242273  
     12019-02-21  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Codify the naming convention for fooIfExists
     4        https://bugs.webkit.org/show_bug.cgi?id=194930
     5
     6        Reviewed by Darin Adler.
     7
     8        Updating the coding style guideline after the discussion following
     9        https://lists.webkit.org/pipermail/webkit-dev/2013-June/025056.html
     10
     11        * code-style.md:
     12
    1132019-02-20  Jon Davis  <jond@apple.com>
    214
  • trunk/Websites/webkit.org/code-style.md

    r235717 r242273  
    675675```cpp
    676676bool toASCII(short*, size_t);
     677```
     678
     679[](#names-if-exists) The getter function for a member variable should not have any suffix or prefix indicating the function can optionally create or initialize the member variable. Suffix the getter function which does not automatically create the object with `IfExists` if there is a variant which does.
     680
     681###### Right:
     682
     683```cpp
     684StyleResolver* styleResolverIfExists();
     685StyleResolver& styleResolver();
     686```
     687
     688###### Wrong:
     689
     690```cpp
     691StyleResolver* styleResolver();
     692StyleResolver& ensureStyleResolver();
     693```
     694
     695###### Right:
     696
     697```cpp
     698Frame* frame();
     699```
     700
     701###### Wrong:
     702
     703```cpp
     704Frame* frameIfExists();
    677705```
    678706
Note: See TracChangeset for help on using the changeset viewer.