Bug 157693 - Extend protector naming code style guideline to cover operator= assignment
Summary: Extend protector naming code style guideline to cover operator= assignment
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-13 16:41 PDT by Brady Eidson
Modified: 2016-05-13 21:44 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.79 KB, patch)
2016-05-13 16:57 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.