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

Unified Diff: mojo/public/bindings/generators/mojom_cpp_generator.py

Issue 221663004: mojo: add handle<shared_buffer> support to generator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/bindings/generators/mojom_js_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/generators/mojom_cpp_generator.py
diff --git a/mojo/public/bindings/generators/mojom_cpp_generator.py b/mojo/public/bindings/generators/mojom_cpp_generator.py
index 85c146ed41c226e2ba1f14dcf2b3fce577c17716..a95e711d85e7844801a3159e6f4d2d6b8504db5a 100644
--- a/mojo/public/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/bindings/generators/mojom_cpp_generator.py
@@ -12,21 +12,22 @@ from generate.template_expander import UseJinja
_kind_to_cpp_type = {
- mojom.BOOL: "bool",
- mojom.INT8: "int8_t",
- mojom.UINT8: "uint8_t",
- mojom.INT16: "int16_t",
- mojom.UINT16: "uint16_t",
- mojom.INT32: "int32_t",
- mojom.UINT32: "uint32_t",
- mojom.FLOAT: "float",
- mojom.HANDLE: "mojo::Handle",
- mojom.DCPIPE: "mojo::DataPipeConsumerHandle",
- mojom.DPPIPE: "mojo::DataPipeProducerHandle",
- mojom.MSGPIPE: "mojo::MessagePipeHandle",
- mojom.INT64: "int64_t",
- mojom.UINT64: "uint64_t",
- mojom.DOUBLE: "double",
+ mojom.BOOL: "bool",
+ mojom.INT8: "int8_t",
+ mojom.UINT8: "uint8_t",
+ mojom.INT16: "int16_t",
+ mojom.UINT16: "uint16_t",
+ mojom.INT32: "int32_t",
+ mojom.UINT32: "uint32_t",
+ mojom.FLOAT: "float",
+ mojom.HANDLE: "mojo::Handle",
+ mojom.DCPIPE: "mojo::DataPipeConsumerHandle",
+ mojom.DPPIPE: "mojo::DataPipeProducerHandle",
+ mojom.MSGPIPE: "mojo::MessagePipeHandle",
+ mojom.SHAREDBUFFER: "mojo::SharedBufferHandle",
+ mojom.INT64: "int64_t",
+ mojom.UINT64: "uint64_t",
+ mojom.DOUBLE: "double",
}
@@ -82,6 +83,8 @@ def GetCppResultWrapperType(kind):
return "mojo::ScopedDataPipeProducerHandle"
if kind.spec == 'h:m':
return "mojo::ScopedMessagePipeHandle"
+ if kind.spec == 'h:s':
+ return "mojo::ScopedSharedBufferHandle"
return _kind_to_cpp_type[kind]
def GetCppWrapperType(kind):
@@ -116,6 +119,8 @@ def GetCppConstWrapperType(kind):
return "mojo::ScopedDataPipeProducerHandle"
if kind.spec == 'h:m':
return "mojo::ScopedMessagePipeHandle"
+ if kind.spec == 'h:s':
+ return "mojo::ScopedSharedBufferHandle"
if not kind in _kind_to_cpp_type:
print "missing:", kind.spec
return _kind_to_cpp_type[kind]
« no previous file with comments | « no previous file | mojo/public/bindings/generators/mojom_js_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698