| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import os.path | 5 import os.path |
| 6 import sys | 6 import sys |
| 7 import optparse | 7 import optparse |
| 8 import collections | 8 import collections |
| 9 import functools | 9 import functools |
| 10 try: | 10 try: |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return { | 280 return { |
| 281 "return_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"]
, | 281 "return_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"]
, |
| 282 "pass_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"], | 282 "pass_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"], |
| 283 "to_raw_type": "%s.get()", | 283 "to_raw_type": "%s.get()", |
| 284 "to_pass_type": "std::move(%s)", | 284 "to_pass_type": "std::move(%s)", |
| 285 "to_rvalue": "std::move(%s)", | 285 "to_rvalue": "std::move(%s)", |
| 286 "type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"], | 286 "type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"], |
| 287 "raw_type": "protocol::Array<%s>" % type["raw_type"], | 287 "raw_type": "protocol::Array<%s>" % type["raw_type"], |
| 288 "raw_pass_type": "protocol::Array<%s>*" % type["raw_type"], | 288 "raw_pass_type": "protocol::Array<%s>*" % type["raw_type"], |
| 289 "raw_return_type": "protocol::Array<%s>*" % type["raw_type"], | 289 "raw_return_type": "protocol::Array<%s>*" % type["raw_type"], |
| 290 "create_type": "wrapUnique(new protocol::Array<%s>())" % type["raw_type"
], | |
| 291 "out_type": "protocol::Array<%s>&" % type["raw_type"], | 290 "out_type": "protocol::Array<%s>&" % type["raw_type"], |
| 292 } | 291 } |
| 293 | 292 |
| 294 | 293 |
| 295 def create_type_definitions(protocol, imported_namespace): | 294 def create_type_definitions(protocol, imported_namespace): |
| 296 protocol.type_definitions = {} | 295 protocol.type_definitions = {} |
| 297 protocol.type_definitions["number"] = create_primitive_type_definition("numb
er") | 296 protocol.type_definitions["number"] = create_primitive_type_definition("numb
er") |
| 298 protocol.type_definitions["integer"] = create_primitive_type_definition("int
eger") | 297 protocol.type_definitions["integer"] = create_primitive_type_definition("int
eger") |
| 299 protocol.type_definitions["boolean"] = create_primitive_type_definition("boo
lean") | 298 protocol.type_definitions["boolean"] = create_primitive_type_definition("boo
lean") |
| 300 protocol.type_definitions["object"] = create_object_type_definition() | 299 protocol.type_definitions["object"] = create_object_type_definition() |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 if up_to_date: | 534 if up_to_date: |
| 536 sys.exit() | 535 sys.exit() |
| 537 | 536 |
| 538 for file_name, content in outputs.iteritems(): | 537 for file_name, content in outputs.iteritems(): |
| 539 out_file = open(file_name, "w") | 538 out_file = open(file_name, "w") |
| 540 out_file.write(content) | 539 out_file.write(content) |
| 541 out_file.close() | 540 out_file.close() |
| 542 | 541 |
| 543 | 542 |
| 544 main() | 543 main() |
| OLD | NEW |