Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: cc/PRESUBMIT.py

Issue 663243003: Clean up final uses of scoped_ptr<T>::PassAs() and remove it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/memory/scoped_ptr_unittest.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Top-level presubmit script for cc. 5 """Top-level presubmit script for cc.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into depot_tools. 8 for more details about the presubmit API built into depot_tools.
9 """ 9 """
10 10
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if re.search(r'(=|\breturn)\s*scoped_ptr<.*?(?<!])>\([^)]+\)', line): 184 if re.search(r'(=|\breturn)\s*scoped_ptr<.*?(?<!])>\([^)]+\)', line):
185 errors.append(output_api.PresubmitError( 185 errors.append(output_api.PresubmitError(
186 ('%s:%d uses explicit scoped_ptr constructor. ' + 186 ('%s:%d uses explicit scoped_ptr constructor. ' +
187 'Use make_scoped_ptr() instead.') % (f.LocalPath(), line_number))) 187 'Use make_scoped_ptr() instead.') % (f.LocalPath(), line_number)))
188 # Disallow: 188 # Disallow:
189 # scoped_ptr<T>() 189 # scoped_ptr<T>()
190 if re.search(r'\bscoped_ptr<.*?>\(\)', line): 190 if re.search(r'\bscoped_ptr<.*?>\(\)', line):
191 errors.append(output_api.PresubmitError( 191 errors.append(output_api.PresubmitError(
192 '%s:%d uses scoped_ptr<T>(). Use nullptr instead.' % 192 '%s:%d uses scoped_ptr<T>(). Use nullptr instead.' %
193 (f.LocalPath(), line_number))) 193 (f.LocalPath(), line_number)))
194 # Disallow:
195 # foo.PassAs<T>();
196 if re.search(r'\bPassAs<.*?>\(\)', line):
197 errors.append(output_api.PresubmitError(
198 '%s:%d uses PassAs<T>(). Use Pass() instead.' %
199 (f.LocalPath(), line_number)))
200 return errors 194 return errors
201 195
202 def FindUnquotedQuote(contents, pos): 196 def FindUnquotedQuote(contents, pos):
203 match = re.search(r"(?<!\\)(?P<quote>\")", contents[pos:]) 197 match = re.search(r"(?<!\\)(?P<quote>\")", contents[pos:])
204 return -1 if not match else match.start("quote") + pos 198 return -1 if not match else match.start("quote") + pos
205 199
206 def FindUselessIfdefs(input_api, output_api): 200 def FindUselessIfdefs(input_api, output_api):
207 errors = [] 201 errors = []
208 source_file_filter = lambda x: x 202 source_file_filter = lambda x: x
209 for f in input_api.AffectedSourceFiles(source_file_filter): 203 for f in input_api.AffectedSourceFiles(source_file_filter):
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 results += CheckOverrideFinal(input_api, output_api) 377 results += CheckOverrideFinal(input_api, output_api)
384 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) 378 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
385 return results 379 return results
386 380
387 def GetPreferredTryMasters(project, change): 381 def GetPreferredTryMasters(project, change):
388 return { 382 return {
389 'tryserver.blink': { 383 'tryserver.blink': {
390 'linux_blink_rel': set(['defaulttests']), 384 'linux_blink_rel': set(['defaulttests']),
391 }, 385 },
392 } 386 }
OLDNEW
« no previous file with comments | « base/memory/scoped_ptr_unittest.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698