Bug 157693

Summary: Extend protector naming code style guideline to cover operator= assignment
Product: WebKit Reporter: Brady Eidson <beidson>
Component: Tools / TestsAssignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, glenn, lforschler
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=157591
Attachments:
Description Flags
Patch none

Description Brady Eidson 2016-05-13 16:41:14 PDT
Extend protector naming code style guideline to = assignment

https://bugs.webkit.org/show_bug.cgi?id=157591 implemented protector naming rules like so:
RefPtr<Node> protector(node);
RefPtr<Node> protectedThis(this);

But we need to cover operator= assignment, as well.
RefPtr<Node> protector = node;
RefPtr<Node> protectedThis = this;
Comment 1 Brady Eidson 2016-05-13 16:43:33 PDT
(In reply to comment #0)
> 
> But we need to cover operator= assignment, as well.
> RefPtr<Node> protector = node;
> RefPtr<Node> protectedThis = this;

There's two ways to cover these cases:
1 - Extend the rule to enforce proper naming in these cases
2 - Extend the rule to disallow these cases and to prefer protector(node)-style initialization, instead.
Comment 2 Brady Eidson 2016-05-13 16:44:58 PDT
Since a consensus has been reached on the name of these variables, but no discussion has taken place on disallowing operator= style assignment to these protectors, I'm going to go with #1 and just enforce the name.

If contributors later decide to disallow operator= style, that can be an easy change.
Comment 3 Brady Eidson 2016-05-13 16:57:24 PDT
Created attachment 278895 [details]
Patch
Comment 4 WebKit Commit Bot 2016-05-13 21:44:49 PDT
Comment on attachment 278895 [details]
Patch

Clearing flags on attachment: 278895

Committed r200913: <http://trac.webkit.org/changeset/200913>
Comment 5 WebKit Commit Bot 2016-05-13 21:44:53 PDT
All reviewed patches have been landed.  Closing bug.