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

Side by Side Diff: mojo/public/tools/bindings/generators/mojom_dart_generator.py

Issue 800523004: Dart: Simplifies the handle watcher. Various cleanups and bugfixes. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: cleanup Created 5 years, 11 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
« no previous file with comments | « mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl ('k') | 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Generates Dart source files from a mojom.Module.""" 5 """Generates Dart source files from a mojom.Module."""
6 6
7 import mojom.generate.generator as generator 7 import mojom.generate.generator as generator
8 import mojom.generate.module as mojom 8 import mojom.generate.module as mojom
9 import mojom.generate.pack as pack 9 import mojom.generate.pack as pack
10 from mojom.generate.template_expander import UseJinja 10 from mojom.generate.template_expander import UseJinja
(...skipping 27 matching lines...) Expand all
38 38
39 _kind_to_dart_decl_type = { 39 _kind_to_dart_decl_type = {
40 mojom.BOOL: "bool", 40 mojom.BOOL: "bool",
41 mojom.INT8: "int", 41 mojom.INT8: "int",
42 mojom.UINT8: "int", 42 mojom.UINT8: "int",
43 mojom.INT16: "int", 43 mojom.INT16: "int",
44 mojom.UINT16: "int", 44 mojom.UINT16: "int",
45 mojom.INT32: "int", 45 mojom.INT32: "int",
46 mojom.UINT32: "int", 46 mojom.UINT32: "int",
47 mojom.FLOAT: "double", 47 mojom.FLOAT: "double",
48 mojom.HANDLE: "core.RawMojoHandle", 48 mojom.HANDLE: "core.MojoHandle",
49 mojom.DCPIPE: "core.RawMojoHandle", 49 mojom.DCPIPE: "core.MojoHandle",
50 mojom.DPPIPE: "core.RawMojoHandle", 50 mojom.DPPIPE: "core.MojoHandle",
51 mojom.MSGPIPE: "core.RawMojoHandle", 51 mojom.MSGPIPE: "core.MojoHandle",
52 mojom.SHAREDBUFFER: "core.RawMojoHandle", 52 mojom.SHAREDBUFFER: "core.MojoHandle",
53 mojom.NULLABLE_HANDLE: "core.RawMojoHandle", 53 mojom.NULLABLE_HANDLE: "core.MojoHandle",
54 mojom.NULLABLE_DCPIPE: "core.RawMojoHandle", 54 mojom.NULLABLE_DCPIPE: "core.MojoHandle",
55 mojom.NULLABLE_DPPIPE: "core.RawMojoHandle", 55 mojom.NULLABLE_DPPIPE: "core.MojoHandle",
56 mojom.NULLABLE_MSGPIPE: "core.RawMojoHandle", 56 mojom.NULLABLE_MSGPIPE: "core.MojoHandle",
57 mojom.NULLABLE_SHAREDBUFFER: "core.RawMojoHandle", 57 mojom.NULLABLE_SHAREDBUFFER: "core.MojoHandle",
58 mojom.INT64: "int", 58 mojom.INT64: "int",
59 mojom.UINT64: "int", 59 mojom.UINT64: "int",
60 mojom.DOUBLE: "double", 60 mojom.DOUBLE: "double",
61 mojom.STRING: "String", 61 mojom.STRING: "String",
62 mojom.NULLABLE_STRING: "String" 62 mojom.NULLABLE_STRING: "String"
63 } 63 }
64 64
65 65
66 def DartType(kind): 66 def DartType(kind):
67 if kind.imported_from: 67 if kind.imported_from:
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 interface_to_import[name] = each_import["unique_name"] + "." + name 299 interface_to_import[name] = each_import["unique_name"] + "." + name
300 return interface_to_import 300 return interface_to_import
301 301
302 def ImportedFrom(self): 302 def ImportedFrom(self):
303 interface_to_import = {} 303 interface_to_import = {}
304 for each_import in self.module.imports: 304 for each_import in self.module.imports:
305 for each_interface in each_import["module"].interfaces: 305 for each_interface in each_import["module"].interfaces:
306 name = each_interface.name 306 name = each_interface.name
307 interface_to_import[name] = each_import["unique_name"] + "." 307 interface_to_import[name] = each_import["unique_name"] + "."
308 return interface_to_import 308 return interface_to_import
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698