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

Side by Side Diff: third_party/inspector_protocol/CodeGenerator.py

Issue 2467853003: [inspector] migrate Runtime to new style (Closed)
Patch Set: addressed comments Created 4 years, 1 month 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
« no previous file with comments | « src/inspector/v8-value-copier.cc ('k') | third_party/inspector_protocol/README.v8 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 323
324 def resolve_type(protocol, prop): 324 def resolve_type(protocol, prop):
325 if "$ref" in prop: 325 if "$ref" in prop:
326 return protocol.type_definitions[prop["$ref"]] 326 return protocol.type_definitions[prop["$ref"]]
327 if prop["type"] == "array": 327 if prop["type"] == "array":
328 return wrap_array_definition(resolve_type(protocol, prop["items"])) 328 return wrap_array_definition(resolve_type(protocol, prop["items"]))
329 return protocol.type_definitions[prop["type"]] 329 return protocol.type_definitions[prop["type"]]
330 330
331 331
332 def new_style(domain): 332 def new_style(domain):
333 domains = [ "Schema", "Console", "Profiler", "HeapProfiler" ] 333 domains = [ "Schema", "Console", "Profiler", "HeapProfiler", "Runtime" ]
334 return domain["domain"] in domains 334 return domain["domain"] in domains
335 335
336 336
337 def join_arrays(dict, keys): 337 def join_arrays(dict, keys):
338 result = [] 338 result = []
339 for key in keys: 339 for key in keys:
340 if key in dict: 340 if key in dict:
341 result += dict[key] 341 result += dict[key]
342 return result 342 return result
343 343
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 if up_to_date: 495 if up_to_date:
496 sys.exit() 496 sys.exit()
497 497
498 for file_name, content in outputs.iteritems(): 498 for file_name, content in outputs.iteritems():
499 out_file = open(file_name, "w") 499 out_file = open(file_name, "w")
500 out_file.write(content) 500 out_file.write(content)
501 out_file.close() 501 out_file.close()
502 502
503 503
504 main() 504 main()
OLDNEW
« no previous file with comments | « src/inspector/v8-value-copier.cc ('k') | third_party/inspector_protocol/README.v8 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698