Commit 2857611d authored by levin@chromium.org's avatar levin@chromium.org
Browse files

check-webkit-style: Ref|Own Ptr& should be allowed as a parameter.

https://bugs.webkit.org/show_bug.cgi?id=67797

Reviewed by Eric Seidel.

* Scripts/webkitpy/style/checkers/cpp.py: Allow Ref/Own Ptr when it ends with &.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Added test cases for this.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 452cb41a
2011-09-08 David Levin <levin@chromium.org>
check-webkit-style: Ref|Own Ptr& should be allowed as a parameter.
https://bugs.webkit.org/show_bug.cgi?id=67797
Reviewed by Eric Seidel.
* Scripts/webkitpy/style/checkers/cpp.py: Allow Ref/Own Ptr when it ends with &.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Added test cases for this.
2011-09-08 Fady Samuel <fsamuel@chromium.org>
 
Fixed Layout Mode should be adjustable from layoutTestController for testing on Chromium platforms
......@@ -1577,7 +1577,7 @@ def check_function_definition_and_pass_ptr(type_text, row, location_description,
"""
match_ref_or_own_ptr = '(?=\W|^)(Ref|Own)Ptr(?=\W)'
bad_type_usage = search(match_ref_or_own_ptr, type_text)
if not bad_type_usage:
if not bad_type_usage or type_text.endswith('&'):
return
type_name = bad_type_usage.group(0)
error(row, 'readability/pass_ptr', 5,
......
......@@ -3275,6 +3275,11 @@ class PassPtrTest(CppStyleTestBase):
'{\n'
'}',
'The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5]')
self.assert_pass_ptr_check(
'int myFunction(RefPtr<Type1>&)\n'
'{\n'
'}',
'')
def test_own_ptr_parameter_value(self):
self.assert_pass_ptr_check(
......@@ -3287,6 +3292,11 @@ class PassPtrTest(CppStyleTestBase):
'{\n'
'}',
'The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5]')
self.assert_pass_ptr_check(
'int myFunction(OwnPtr<Type1>& simple)\n'
'{\n'
'}',
'')
def test_ref_ptr_member_variable(self):
self.assert_pass_ptr_check(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment