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

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

Issue 2876903002: NOT FOR COMMIT
Patch Set: Merge branch 'refs/heads/c76_dummy_stylize' into c76_tried_mojom_name_and_name Created 3 years, 7 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 | « no previous file | mojo/public/tools/bindings/generators/mojom_java_generator.py » ('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 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 @UseJinja("module-shared-internal.h.tmpl") 375 @UseJinja("module-shared-internal.h.tmpl")
376 def _GenerateModuleSharedInternalHeader(self): 376 def _GenerateModuleSharedInternalHeader(self):
377 return self._GetJinjaExports() 377 return self._GetJinjaExports()
378 378
379 @UseJinja("module-shared.cc.tmpl") 379 @UseJinja("module-shared.cc.tmpl")
380 def _GenerateModuleSharedSource(self): 380 def _GenerateModuleSharedSource(self):
381 return self._GetJinjaExports() 381 return self._GetJinjaExports()
382 382
383 def GenerateFiles(self, args): 383 def GenerateFiles(self, args):
384 self.module.Stylize(generator.Stylizer())
385
384 if self.generate_non_variant_code: 386 if self.generate_non_variant_code:
385 self.Write(self._GenerateModuleSharedHeader(), 387 self.Write(self._GenerateModuleSharedHeader(),
386 self.MatchMojomFilePath("%s-shared.h" % self.module.name)) 388 self.MatchMojomFilePath("%s-shared.h" % self.module.name))
387 self.Write( 389 self.Write(
388 self._GenerateModuleSharedInternalHeader(), 390 self._GenerateModuleSharedInternalHeader(),
389 self.MatchMojomFilePath("%s-shared-internal.h" % self.module.name)) 391 self.MatchMojomFilePath("%s-shared-internal.h" % self.module.name))
390 self.Write(self._GenerateModuleSharedSource(), 392 self.Write(self._GenerateModuleSharedSource(),
391 self.MatchMojomFilePath("%s-shared.cc" % self.module.name)) 393 self.MatchMojomFilePath("%s-shared.cc" % self.module.name))
392 else: 394 else:
393 suffix = "-%s" % self.variant if self.variant else "" 395 suffix = "-%s" % self.variant if self.variant else ""
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 if mojom.IsDataPipeProducerKind(kind): 797 if mojom.IsDataPipeProducerKind(kind):
796 return "mojo::ScopedDataPipeProducerHandle" 798 return "mojo::ScopedDataPipeProducerHandle"
797 if mojom.IsMessagePipeKind(kind): 799 if mojom.IsMessagePipeKind(kind):
798 return "mojo::ScopedMessagePipeHandle" 800 return "mojo::ScopedMessagePipeHandle"
799 if mojom.IsSharedBufferKind(kind): 801 if mojom.IsSharedBufferKind(kind):
800 return "mojo::ScopedSharedBufferHandle" 802 return "mojo::ScopedSharedBufferHandle"
801 return _kind_to_cpp_type[kind] 803 return _kind_to_cpp_type[kind]
802 804
803 def _GetUnmappedTypeForSerializer(self, kind): 805 def _GetUnmappedTypeForSerializer(self, kind):
804 return self._GetCppDataViewType(kind, qualified=True) 806 return self._GetCppDataViewType(kind, qualified=True)
OLDNEW
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/mojom_java_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698