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

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

Issue 2660733002: Mojo C++ bindings: introduce an optional array to store transferred interface IDs in messages. (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/union_serialization_declaration.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 C++ source files from a mojom.Module.""" 5 """Generates C++ 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if mojom.IsMapKind(kind): 335 if mojom.IsMapKind(kind):
336 return ("mojo::internal::Pointer<mojo::internal::Map_Data<%s, %s>>" % 336 return ("mojo::internal::Pointer<mojo::internal::Map_Data<%s, %s>>" %
337 (GetCppFieldType(kind.key_kind), GetCppFieldType(kind.value_kind))) 337 (GetCppFieldType(kind.key_kind), GetCppFieldType(kind.value_kind)))
338 if mojom.IsInterfaceKind(kind): 338 if mojom.IsInterfaceKind(kind):
339 return "mojo::internal::Interface_Data" 339 return "mojo::internal::Interface_Data"
340 if mojom.IsInterfaceRequestKind(kind): 340 if mojom.IsInterfaceRequestKind(kind):
341 return "mojo::internal::Handle_Data" 341 return "mojo::internal::Handle_Data"
342 if mojom.IsAssociatedInterfaceKind(kind): 342 if mojom.IsAssociatedInterfaceKind(kind):
343 return "mojo::internal::AssociatedInterface_Data" 343 return "mojo::internal::AssociatedInterface_Data"
344 if mojom.IsAssociatedInterfaceRequestKind(kind): 344 if mojom.IsAssociatedInterfaceRequestKind(kind):
345 return "mojo::internal::AssociatedInterfaceRequest_Data" 345 return "mojo::internal::AssociatedEndpointHandle_Data"
346 if mojom.IsEnumKind(kind): 346 if mojom.IsEnumKind(kind):
347 return "int32_t" 347 return "int32_t"
348 if mojom.IsStringKind(kind): 348 if mojom.IsStringKind(kind):
349 return "mojo::internal::Pointer<mojo::internal::String_Data>" 349 return "mojo::internal::Pointer<mojo::internal::String_Data>"
350 if mojom.IsAnyHandleKind(kind): 350 if mojom.IsAnyHandleKind(kind):
351 return "mojo::internal::Handle_Data" 351 return "mojo::internal::Handle_Data"
352 return _kind_to_cpp_type[kind] 352 return _kind_to_cpp_type[kind]
353 353
354 def GetCppUnionFieldType(kind): 354 def GetCppUnionFieldType(kind):
355 if mojom.IsUnionKind(kind): 355 if mojom.IsUnionKind(kind):
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 global _use_once_callback 667 global _use_once_callback
668 _use_once_callback = self.use_once_callback 668 _use_once_callback = self.use_once_callback
669 global _variant 669 global _variant
670 _variant = self.variant 670 _variant = self.variant
671 suffix = "-%s" % self.variant if self.variant else "" 671 suffix = "-%s" % self.variant if self.variant else ""
672 self.Write(self.GenerateModuleHeader(), 672 self.Write(self.GenerateModuleHeader(),
673 self.MatchMojomFilePath("%s%s.h" % (self.module.name, suffix))) 673 self.MatchMojomFilePath("%s%s.h" % (self.module.name, suffix)))
674 self.Write( 674 self.Write(
675 self.GenerateModuleSource(), 675 self.GenerateModuleSource(),
676 self.MatchMojomFilePath("%s%s.cc" % (self.module.name, suffix))) 676 self.MatchMojomFilePath("%s%s.cc" % (self.module.name, suffix)))
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/union_serialization_declaration.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698