The style checker shouldn't complain about returning or passing OwnPtr
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Sep 2013 16:43:29 +0000 (16:43 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Sep 2013 16:43:29 +0000 (16:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121163

Reviewed by Antti Koivisto.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_function_definition_and_pass_ptr):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(PassPtrTest.test_pass_ref_ptr_return_value):
(PassPtrTest.test_own_ptr_parameter_value):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155535 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/style/checkers/cpp.py
Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

index 86595b1..722b321 100644 (file)
@@ -1,3 +1,16 @@
+2013-09-11  Anders Carlsson  <andersca@apple.com>
+
+        The style checker shouldn't complain about returning or passing OwnPtr
+        https://bugs.webkit.org/show_bug.cgi?id=121163
+
+        Reviewed by Antti Koivisto.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_function_definition_and_pass_ptr):
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (PassPtrTest.test_pass_ref_ptr_return_value):
+        (PassPtrTest.test_own_ptr_parameter_value):
+
 2013-09-11  Mario Sanchez Prada  <mario.prada@samsung.com>
 
         [GTK] Remove Gail dependency from build system for GTK3
index aa29e91..64ccb4f 100644 (file)
@@ -1639,8 +1639,8 @@ def check_function_definition_and_pass_ptr(type_text, row, location_description,
        location_description: Used to indicate where the type is. This is either 'parameter' or 'return'.
        error: The function to call with any errors found.
     """
-    match_ref_or_own_ptr = '(?=\W|^)(Ref|Own)Ptr(?=\W)'
-    bad_type_usage = search(match_ref_or_own_ptr, type_text)
+    match_ref_ptr = '(?=\W|^)RefPtr(?=\W)'
+    bad_type_usage = search(match_ref_ptr, type_text)
     if not bad_type_usage or type_text.endswith('&') or type_text.endswith('*'):
         return
     type_name = bad_type_usage.group(0)
index 7f2c9f2..fb64d05 100644 (file)
@@ -3445,7 +3445,7 @@ class PassPtrTest(CppStyleTestBase):
             'OwnPtr<Type1> myFunction(int)\n'
             '{\n'
             '}',
-            'The return type should use PassOwnPtr instead of OwnPtr.  [readability/pass_ptr] [5]')
+            '')
 
     def test_ref_ptr_parameter_value(self):
         self.assert_pass_ptr_check(
@@ -3479,7 +3479,7 @@ class PassPtrTest(CppStyleTestBase):
             'int myFunction(OwnPtr<Type1>)\n'
             '{\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'