Changeset 200913 in webkit
- Timestamp:
- May 13, 2016 9:45:42 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r200880 r200913 1 2016-05-13 Brady Eidson <beidson@apple.com> 2 3 Extend protector naming code style guideline to cover operator= assignment. 4 https://bugs.webkit.org/show_bug.cgi?id=157693 5 6 Reviewed by Darin Adler. 7 8 * Scripts/webkitpy/style/checkers/cpp.py: 9 (check_identifier_name_in_declaration): 10 * Scripts/webkitpy/style/checkers/cpp_unittest.py: 11 (WebKitStyleTest.test_names): 12 1 13 2016-05-13 Aakash Jain <aakash_jain@apple.com> 2 14 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r200859 r200913 3293 3293 3294 3294 # Make sure Ref/RefPtrs used as protectors are named correctly, and do this before we start stripping things off the input. 3295 ref_regexp = r'^\s*Ref(Ptr)?<([\w_]|::)+> (?P<protector_name>[\w_]+) \((\*|&)*(m_)?(?P<protected_name>[\w_]+)\);'3295 ref_regexp = r'^\s*Ref(Ptr)?<([\w_]|::)+> (?P<protector_name>[\w_]+)(\(| = )(\*|&)*(m_)?(?P<protected_name>[\w_]+)\)?;' 3296 3296 ref_check = match(ref_regexp, line) 3297 3297 if ref_check: -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r200859 r200913 5205 5205 self.assert_lint('RefPtr<SomeNamespace::Node> protectedThis(this);', '') 5206 5206 self.assert_lint('RefPtr<SomeClass::InternalClass::Node> protectedThis(this);', '') 5207 self.assert_lint('RefPtr<Node> protectedThis = this;', '') 5208 self.assert_lint('Ref<Node> protectedThis = *this;', '') 5209 self.assert_lint('RefPtr<Node> protectedNode = node;', '') 5210 self.assert_lint('RefPtr<Node> protectedNode = &node;', '') 5211 self.assert_lint('RefPtr<Node> protector = node;', '') 5212 self.assert_lint('RefPtr<Node> protector = &node;', '') 5213 self.assert_lint('Ref<Node> protectedNode = node;', '') 5214 self.assert_lint('Ref<Node> protectedNode =*node;', '') 5215 self.assert_lint('Ref<Node> protector = node;', '') 5216 self.assert_lint('Ref<Node> protector = *node;', '') 5217 5207 5218 5208 5219 # Invalid protector RefPtr/Ref variable names. 5209 5220 self.assert_lint('RefPtr<Node> protector(this);', "'protector' is incorrectly named. It should be named 'protectedThis'. [readability/naming/protected] [4]") 5210 5221 self.assert_lint('Ref<Node> protector(*this);', "'protector' is incorrectly named. It should be named 'protectedThis'. [readability/naming/protected] [4]") 5222 self.assert_lint('RefPtr<Node> protector = this;', "'protector' is incorrectly named. It should be named 'protectedThis'. [readability/naming/protected] [4]") 5223 self.assert_lint('Ref<Node> protector = *this;', "'protector' is incorrectly named. It should be named 'protectedThis'. [readability/naming/protected] [4]") 5211 5224 self.assert_lint('RefPtr<Node> self(this);', "'self' is incorrectly named. It should be named 'protectedThis'. [readability/naming/protected] [4]") 5212 5225 self.assert_lint('Ref<Node> self(*this);', "'self' is incorrectly named. It should be named 'protectedThis'. [readability/naming/protected] [4]") … … 5219 5232 self.assert_lint('Ref<Node> protectedNode(otherNode);', "'protectedNode' is incorrectly named. It should be named 'protector' or 'protectedOtherNode'. [readability/naming/protected] [4]") 5220 5233 self.assert_lint('Ref<Node> protectedNode(*otherNode);', "'protectedNode' is incorrectly named. It should be named 'protector' or 'protectedOtherNode'. [readability/naming/protected] [4]") 5234 self.assert_lint('RefPtr<Node> protectedNode = otherNode;', "'protectedNode' is incorrectly named. It should be named 'protector' or 'protectedOtherNode'. [readability/naming/protected] [4]") 5235 self.assert_lint('RefPtr<Node> protectedNode = &otherNode;', "'protectedNode' is incorrectly named. It should be named 'protector' or 'protectedOtherNode'. [readability/naming/protected] [4]") 5236 self.assert_lint('Ref<Node> protectedNode = otherNode;', "'protectedNode' is incorrectly named. It should be named 'protector' or 'protectedOtherNode'. [readability/naming/protected] [4]") 5237 self.assert_lint('Ref<Node> protectedNode = *otherNode;', "'protectedNode' is incorrectly named. It should be named 'protector' or 'protectedOtherNode'. [readability/naming/protected] [4]") 5221 5238 self.assert_lint('RefPtr<Node> nodeRef(node);', "'nodeRef' is incorrectly named. It should be named 'protector' or 'protectedNode'. [readability/naming/protected] [4]") 5222 5239 self.assert_lint('Ref<Node> nodeRef(*node);', "'nodeRef' is incorrectly named. It should be named 'protector' or 'protectedNode'. [readability/naming/protected] [4]") -
trunk/Websites/webkit.org/ChangeLog
r200859 r200913 1 2016-05-13 Brady Eidson <beidson@apple.com> 2 3 Extend protector naming code style guideline to cover operator= assignment. 4 https://bugs.webkit.org/show_bug.cgi?id=157693 5 6 Reviewed by Darin Adler. 7 8 * code-style.md: 9 1 10 2016-05-13 Brady Eidson <beidson@apple.com> 2 11 -
trunk/Websites/webkit.org/code-style.md
r200859 r200913 721 721 RefPtr<Node> protectedThis(this); 722 722 Ref<Element> protectedThis(*this); 723 RefPtr<Widget> protectedThis = this; 723 724 ``` 724 725 … … 727 728 ```cpp 728 729 RefPtr<Node> protector(this); 730 Ref<Node> protector = *this; 729 731 RefPtr<Widget> self(this); 730 732 Ref<Element> elementRef(*this); … … 737 739 ```cpp 738 740 RefPtr<Element> protector(&element); 741 RefPtr<Element> protector = &element; 739 742 RefPtr<Node> protectedNode(node); 740 743 RefPtr<Widget> protectedMainWidget(m_mainWidget); 744 RefPtr<Loader> protectedFontLoader = m_fontLoader; 741 745 ``` 742 746 … … 746 750 RefPtr<Node> nodeRef(&rootNode); 747 751 Ref<Element> protect(*element); 748 RefPtr<Widget> protected(widget);749 752 RefPtr<Node> protectorNode(node); 753 RefPtr<Widget> protected = widget; 750 754 ``` 751 755
Note: See TracChangeset
for help on using the changeset viewer.