[Webkit-unassigned] [Bug 157591] New: Protector Ref/RefPtrs should have a specified naming style

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 11 15:42:25 PDT 2016


            Bug ID: 157591
           Summary: Protector Ref/RefPtrs should have a specified naming
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Website
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: beidson at apple.com
                CC: jond at apple.com, timothy at apple.com

Protector Ref/RefPtrs should have a specified naming style

This came up during patch review of https://bugs.webkit.org/show_bug.cgi?id=157448 but has also come up many times before.

The name for a Ref/RefPtr protector should be "protectedVariableName(variableName)"

Proper naming for a protector should be like the following examples:

RefPtr<Node> protectedThis(this);
Ref<Node> protectedThis(*this);
RefPtr<Node> protectedNode(node);
RefPtr<Connection> protectedOtherConnection(&otherConnection);
RefPtr<Widget> protectedWidget(m_widget);

Improper naming for which there are many examples in WebCore:

RefPtr<Node> protect(this);
RefPtr<Node> protector(this);
RefPtr<Node> self(this);
RefPtr<Element> elementRef(this);
RefPtr<Tree> someWeirdoOtherName(tree);

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160511/73f77d0c/attachment.html>

More information about the webkit-unassigned mailing list