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

Side by Side Diff: cc/PRESUBMIT.py

Issue 126073002: [#1] Pass gfx structs by const ref (presubmit check) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | 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 for 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
8 details on the presubmit API built into gcl. 8 details on the presubmit API built into gcl.
9 """ 9 """
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 black_list = tuple(black_list or input_api.DEFAULT_BLACK_LIST) 109 black_list = tuple(black_list or input_api.DEFAULT_BLACK_LIST)
110 source_file_filter = lambda x: input_api.FilterSourceFile(x, 110 source_file_filter = lambda x: input_api.FilterSourceFile(x,
111 white_list, 111 white_list,
112 black_list) 112 black_list)
113 113
114 local_errors = [] 114 local_errors = []
115 115
116 # Well-defined simple classes containing only <= 4 ints, or <= 2 floats. 116 # Well-defined simple classes containing only <= 4 ints, or <= 2 floats.
117 pass_by_value_types = ['base::Time', 117 pass_by_value_types = ['base::Time',
118 'base::TimeTicks', 118 'base::TimeTicks',
119 'gfx::Point',
120 'gfx::PointF',
121 'gfx::Rect',
122 'gfx::Size',
123 'gfx::SizeF',
124 'gfx::Vector2d',
125 'gfx::Vector2dF',
126 ] 119 ]
127 120
128 for f in input_api.AffectedSourceFiles(source_file_filter): 121 for f in input_api.AffectedSourceFiles(source_file_filter):
129 contents = input_api.ReadFile(f, 'rb') 122 contents = input_api.ReadFile(f, 'rb')
130 match = re.search( 123 match = re.search(
131 r'\bconst +' + '(?P<type>(%s))&' % 124 r'\bconst +' + '(?P<type>(%s))&' %
132 string.join(pass_by_value_types, '|'), 125 string.join(pass_by_value_types, '|'),
133 contents) 126 contents)
134 if match: 127 if match:
135 local_errors.append(output_api.PresubmitError( 128 local_errors.append(output_api.PresubmitError(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return results 224 return results
232 225
233 def GetPreferredTrySlaves(project, change): 226 def GetPreferredTrySlaves(project, change):
234 return [ 227 return [
235 'linux_layout_rel', 228 'linux_layout_rel',
236 'win_gpu', 229 'win_gpu',
237 'linux_gpu', 230 'linux_gpu',
238 'mac_gpu', 231 'mac_gpu',
239 'mac_gpu_retina', 232 'mac_gpu_retina',
240 ] 233 ]
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698