OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 import sys | 6 import sys |
7 import string | 7 import string |
8 import json | 8 import json |
9 | 9 |
10 blink_protocol_path = sys.argv[1] | 10 blink_protocol_path = sys.argv[1] |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 else: | 636 else: |
637 raise Exception("Unknown type at %s.%s %s" % | 637 raise Exception("Unknown type at %s.%s %s" % |
638 (mapping["Domain"], mapping["command"], mapping["proto_param"])) | 638 (mapping["Domain"], mapping["command"], mapping["proto_param"])) |
639 | 639 |
640 setters = [] | 640 setters = [] |
641 fields = [] | 641 fields = [] |
642 | 642 |
643 includes = [] | 643 includes = [] |
644 fields_init = [] | 644 fields_init = [] |
645 | 645 |
646 browser_domains_list = ["Security", | 646 browser_domains_list = ["Target", "ServiceWorker", "Input", "Storage"] |
647 "Target", "ServiceWorker", "Input", "Storage"] | |
648 browser_commands_list = [] | 647 browser_commands_list = [] |
649 async_commands_list = [ | 648 async_commands_list = [ |
650 "Input.synthesizePinchGesture", | 649 "Input.synthesizePinchGesture", |
651 "Input.synthesizeScrollGesture", | 650 "Input.synthesizeScrollGesture", |
652 "Input.synthesizeTapGesture"] | 651 "Input.synthesizeTapGesture"] |
653 | 652 |
654 for json_domain in all_domains: | 653 for json_domain in all_domains: |
655 domain_map = {} | 654 domain_map = {} |
656 domain_map["Domain"] = json_domain["domain"] | 655 domain_map["Domain"] = json_domain["domain"] |
657 domain_map["domain"] = Uncamelcase(json_domain["domain"]) | 656 domain_map["domain"] = Uncamelcase(json_domain["domain"]) |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 output_h_file.close() | 810 output_h_file.close() |
812 | 811 |
813 output_cc_file.write(template_cc.substitute({}, | 812 output_cc_file.write(template_cc.substitute({}, |
814 major = blink_protocol["version"]["major"], | 813 major = blink_protocol["version"]["major"], |
815 minor = blink_protocol["version"]["minor"], | 814 minor = blink_protocol["version"]["minor"], |
816 includes = "".join(sorted(includes)), | 815 includes = "".join(sorted(includes)), |
817 fields_init = ",\n ".join(fields_init), | 816 fields_init = ",\n ".join(fields_init), |
818 methods = "\n".join(handler_method_impls), | 817 methods = "\n".join(handler_method_impls), |
819 types = "\n".join(type_impls))) | 818 types = "\n".join(type_impls))) |
820 output_cc_file.close() | 819 output_cc_file.close() |
OLD | NEW |