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

Side by Side Diff: CodeGenerator.py

Issue 2515343005: [inspector_protocol] Fixed domain_json["has_exports"] flag for exported domains (Closed)
Patch Set: 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 | « no previous file | no next file » | 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 import re 10 import re
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 exported_domains = protocol.generate_domains 193 exported_domains = protocol.generate_domains
194 194
195 protocol.imported_domains = [] 195 protocol.imported_domains = []
196 protocol.exported_domains = [] 196 protocol.exported_domains = []
197 for domain_json in protocol.json_api["domains"]: 197 for domain_json in protocol.json_api["domains"]:
198 domain = domain_json["domain"] 198 domain = domain_json["domain"]
199 clear = domain not in exported_domains and domain not in imported_domain s 199 clear = domain not in exported_domains and domain not in imported_domain s
200 if not has_exports(domain_json, clear): 200 if not has_exports(domain_json, clear):
201 continue 201 continue
202 if domain in exported_domains: 202 if domain in exported_domains:
203 domain_json["has_exports"] = True
203 protocol.exported_domains.append(domain) 204 protocol.exported_domains.append(domain)
204 if domain in imported_domains: 205 if domain in imported_domains:
205 protocol.imported_domains.append(domain) 206 protocol.imported_domains.append(domain)
206 207
207 208
208 def create_imported_type_definition(domain_name, type, imported_namespace): 209 def create_imported_type_definition(domain_name, type, imported_namespace):
209 # pylint: disable=W0622 210 # pylint: disable=W0622
210 return { 211 return {
211 "return_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]), 212 "return_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]),
212 "pass_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, d omain_name, type["id"]), 213 "pass_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, d omain_name, type["id"]),
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 if up_to_date: 581 if up_to_date:
581 sys.exit() 582 sys.exit()
582 583
583 for file_name, content in outputs.iteritems(): 584 for file_name, content in outputs.iteritems():
584 out_file = open(file_name, "w") 585 out_file = open(file_name, "w")
585 out_file.write(content) 586 out_file.write(content)
586 out_file.close() 587 out_file.close()
587 588
588 589
589 main() 590 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698