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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_handler_generator.py

Issue 2515613006: [DevTools] Move Memory, SystemInfo and Tethering domains to new generator. (Closed)
Patch Set: fixed review comments Created 4 years 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
OLDNEW
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
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 = ["Inspector", "Memory", "Page", "Emulation", "Security", 646 browser_domains_list = ["Inspector", "Page", "Emulation", "Security",
647 "Target", "ServiceWorker", "Input", "Storage", 647 "Target", "ServiceWorker", "Input", "Storage", "Schema"]
648 "SystemInfo", "Tethering", "Schema"]
649 browser_commands_list = [ 648 browser_commands_list = [
650 "DOM.setFileInputFiles", 649 "DOM.setFileInputFiles",
651 "Network.enable", 650 "Network.enable",
652 "Network.disable", 651 "Network.disable",
653 "Network.clearBrowserCache", 652 "Network.clearBrowserCache",
654 "Network.clearBrowserCookies", 653 "Network.clearBrowserCookies",
655 "Network.getCookies", 654 "Network.getCookies",
656 "Network.deleteCookie", 655 "Network.deleteCookie",
657 "Network.setCookie", 656 "Network.setCookie",
658 "Network.canEmulateNetworkConditions", 657 "Network.canEmulateNetworkConditions",
659 "Network.emulateNetworkConditions"] 658 "Network.emulateNetworkConditions"]
660 async_commands_list = [ 659 async_commands_list = [
661 "Page.getResourceContent", 660 "Page.getResourceContent",
662 "Page.searchInResource", 661 "Page.searchInResource",
663 "Page.captureScreenshot", 662 "Page.captureScreenshot",
664 "Network.getCookies", 663 "Network.getCookies",
665 "Network.deleteCookie", 664 "Network.deleteCookie",
666 "Network.setCookie", 665 "Network.setCookie",
667 "Input.synthesizePinchGesture", 666 "Input.synthesizePinchGesture",
668 "Input.synthesizeScrollGesture", 667 "Input.synthesizeScrollGesture",
669 "Input.synthesizeTapGesture", 668 "Input.synthesizeTapGesture"]
670 "SystemInfo.getInfo",
671 "Tethering.bind",
672 "Tethering.unbind"]
673 669
674 for json_domain in all_domains: 670 for json_domain in all_domains:
675 domain_map = {} 671 domain_map = {}
676 domain_map["Domain"] = json_domain["domain"] 672 domain_map["Domain"] = json_domain["domain"]
677 domain_map["domain"] = Uncamelcase(json_domain["domain"]) 673 domain_map["domain"] = Uncamelcase(json_domain["domain"])
678 674
679 initializations = [] 675 initializations = []
680 client_methods = [] 676 client_methods = []
681 client_method_impls = [] 677 client_method_impls = []
682 domain_empty = True 678 domain_empty = True
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 output_h_file.close() 827 output_h_file.close()
832 828
833 output_cc_file.write(template_cc.substitute({}, 829 output_cc_file.write(template_cc.substitute({},
834 major = blink_protocol["version"]["major"], 830 major = blink_protocol["version"]["major"],
835 minor = blink_protocol["version"]["minor"], 831 minor = blink_protocol["version"]["minor"],
836 includes = "".join(sorted(includes)), 832 includes = "".join(sorted(includes)),
837 fields_init = ",\n ".join(fields_init), 833 fields_init = ",\n ".join(fields_init),
838 methods = "\n".join(handler_method_impls), 834 methods = "\n".join(handler_method_impls),
839 types = "\n".join(type_impls))) 835 types = "\n".join(type_impls)))
840 output_cc_file.close() 836 output_cc_file.close()
OLDNEW
« no previous file with comments | « content/browser/devtools/browser_devtools_agent_host.cc ('k') | content/browser/devtools/protocol/memory_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698