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

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

Issue 1722643003: Reland of [DevTools] Move screen orientation override to RenderWidgetScreenMetricsEmulator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 item_raw_type = items_map["raw_type"], 561 item_raw_type = items_map["raw_type"],
562 item_pass = items_map["pass_template"].substitute(name="item", opt=""), 562 item_pass = items_map["pass_template"].substitute(name="item", opt=""),
563 ItemType = items_map["Type"]) 563 ItemType = items_map["Type"])
564 mapping["arg_out"] = "&out_%s" % mapping["param"] 564 mapping["arg_out"] = "&out_%s" % mapping["param"]
565 565
566 def ResolveObject(json, mapping): 566 def ResolveObject(json, mapping):
567 mapping["Type"] = "Dictionary" 567 mapping["Type"] = "Dictionary"
568 mapping["storage_type"] = "scoped_ptr<base::DictionaryValue>" 568 mapping["storage_type"] = "scoped_ptr<base::DictionaryValue>"
569 mapping["raw_type"] = "base::DictionaryValue*" 569 mapping["raw_type"] = "base::DictionaryValue*"
570 mapping["pass_template"] = tmpl_object_pass 570 mapping["pass_template"] = tmpl_object_pass
571 mapping["init"] = " = nullptr"
571 if "properties" in json: 572 if "properties" in json:
572 if not "declared_name" in mapping: 573 if not "declared_name" in mapping:
573 mapping["declared_name"] = ("%s%s" % 574 mapping["declared_name"] = ("%s%s" %
574 (mapping["Command"], Capitalize(mapping["proto_param"]))) 575 (mapping["Command"], Capitalize(mapping["proto_param"])))
575 mapping["param_type"] = ("scoped_refptr<%s>" % 576 mapping["param_type"] = ("scoped_refptr<%s>" %
576 tmpl_typename.substitute(mapping)) 577 tmpl_typename.substitute(mapping))
577 DeclareStruct(json["properties"], mapping) 578 DeclareStruct(json["properties"], mapping)
578 else: 579 else:
579 mapping["param_type"] = ("scoped_refptr<%s>" % 580 mapping["param_type"] = ("scoped_refptr<%s>" %
580 tmpl_typename.substitute(mapping)) 581 tmpl_typename.substitute(mapping))
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 output_h_file.close() 797 output_h_file.close()
797 798
798 output_cc_file.write(template_cc.substitute({}, 799 output_cc_file.write(template_cc.substitute({},
799 major = blink_protocol["version"]["major"], 800 major = blink_protocol["version"]["major"],
800 minor = blink_protocol["version"]["minor"], 801 minor = blink_protocol["version"]["minor"],
801 includes = "".join(sorted(includes)), 802 includes = "".join(sorted(includes)),
802 fields_init = ",\n ".join(fields_init), 803 fields_init = ",\n ".join(fields_init),
803 methods = "\n".join(handler_method_impls), 804 methods = "\n".join(handler_method_impls),
804 types = "\n".join(type_impls))) 805 types = "\n".join(type_impls)))
805 output_cc_file.close() 806 output_cc_file.close()
OLDNEW
« no previous file with comments | « components/test_runner/web_test_proxy.cc ('k') | content/browser/devtools/protocol/emulation_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698