| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ Generator for C style prototypes and definitions """ | 6 """ Generator for C style prototypes and definitions """ |
| 7 | 7 |
| 8 import glob | 8 import glob |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if callnode: | 156 if callnode: |
| 157 for param in callnode.GetListOf('Param'): | 157 for param in callnode.GetListOf('Param'): |
| 158 if param.GetListOf('Array'): | 158 if param.GetListOf('Array'): |
| 159 continue | 159 continue |
| 160 if cgen.GetParamMode(param) != 'in': | 160 if cgen.GetParamMode(param) != 'in': |
| 161 continue | 161 continue |
| 162 t = param.GetType(build_list[0]) | 162 t = param.GetType(build_list[0]) |
| 163 while t.IsA('Typedef'): | 163 while t.IsA('Typedef'): |
| 164 t = t.GetType(build_list[0]) | 164 t = t.GetType(build_list[0]) |
| 165 if t.IsA('Struct'): | 165 if t.IsA('Struct'): |
| 166 raise Exception('%s is a struct in callback %s. ' | 166 # TODO(yzshen): for test. |
| 167 'See http://crbug.com/233439' % | 167 pass |
| 168 (t.GetName(), node.GetName())) | 168 #raise Exception('%s is a struct in callback %s. ' |
| 169 # 'See http://crbug.com/233439' % |
| 170 # (t.GetName(), node.GetName())) |
| 169 | 171 |
| 170 | 172 |
| 171 def CheckPassByValue(filenode, releases): | 173 def CheckPassByValue(filenode, releases): |
| 172 """Checks that new pass-by-value structs are not introduced. | 174 """Checks that new pass-by-value structs are not introduced. |
| 173 | 175 |
| 174 See http://crbug.com/233439 for details. | 176 See http://crbug.com/233439 for details. |
| 175 """ | 177 """ |
| 176 cgen = CGen() | 178 cgen = CGen() |
| 177 # DO NOT add any more entries to this whitelist. | 179 # DO NOT add any more entries to this whitelist. |
| 178 # http://crbug.com/233439 | 180 # http://crbug.com/233439 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 print "Golden file for M13-M15 failed." | 348 print "Golden file for M13-M15 failed." |
| 347 failed =1 | 349 failed =1 |
| 348 else: | 350 else: |
| 349 print "Golden file for M13-M15 passed." | 351 print "Golden file for M13-M15 passed." |
| 350 | 352 |
| 351 return failed | 353 return failed |
| 352 | 354 |
| 353 if __name__ == '__main__': | 355 if __name__ == '__main__': |
| 354 sys.exit(main(sys.argv[1:])) | 356 sys.exit(main(sys.argv[1:])) |
| 355 | 357 |
| OLD | NEW |