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

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

Issue 265793015: Mojo: Replace RemotePtr with InterfacePtr and InterfaceImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/generators/mojom_cpp_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
index 8f48f8e06f94433128eab17d02eaac93646cfa72..3996d5e9a4c48bcaaeb4587c3ca95a1151cbf536 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -50,7 +50,7 @@ def GetCppType(kind):
if isinstance(kind, mojom.Array):
return "mojo::internal::Array_Data<%s>*" % GetCppType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "%sHandle" % kind.name
+ return "mojo::MessagePipeHandle"
if isinstance(kind, mojom.Enum):
return "int32_t"
if kind.spec == 's':
@@ -63,7 +63,7 @@ def GetCppArrayArgWrapperType(kind):
if isinstance(kind, mojom.Array):
return "mojo::Array<%s >" % GetCppArrayArgWrapperType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "%sHandle" % kind.name
+ raise Exception("Arrays of interfaces not yet supported!")
if kind.spec == 's':
return "mojo::String"
return _kind_to_cpp_type[kind]
@@ -74,7 +74,7 @@ def GetCppResultWrapperType(kind):
if isinstance(kind, mojom.Array):
return "mojo::Array<%s >" % GetCppArrayArgWrapperType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "Scoped%sHandle" % kind.name
+ return "%sPtr" % kind.name
if kind.spec == 's':
return "mojo::String"
if kind.spec == 'h':
@@ -95,7 +95,7 @@ def GetCppWrapperType(kind):
if isinstance(kind, mojom.Array):
return "mojo::Array<%s >" % GetCppArrayArgWrapperType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "mojo::Passable<%sHandle>" % kind.name
+ return "mojo::Passable<mojo::MessagePipeHandle>"
if kind.spec == 's':
return "mojo::String"
if generator.IsHandleKind(kind):
@@ -108,7 +108,7 @@ def GetCppConstWrapperType(kind):
if isinstance(kind, mojom.Array):
return "const mojo::Array<%s >&" % GetCppArrayArgWrapperType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "Scoped%sHandle" % kind.name
+ return "%sPtr" % kind.name
if isinstance(kind, mojom.Enum):
return GetNameForKind(kind)
if kind.spec == 's':
@@ -134,7 +134,7 @@ def GetCppFieldType(kind):
if isinstance(kind, mojom.Array):
return "mojo::internal::ArrayPointer<%s>" % GetCppType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "%sHandle" % kind.name
+ return "mojo::MessagePipeHandle"
if isinstance(kind, mojom.Enum):
return GetNameForKind(kind)
if kind.spec == 's':
@@ -180,6 +180,7 @@ class Generator(generator.Generator):
"get_pad": pack.GetPad,
"is_enum_kind": generator.IsEnumKind,
"is_handle_kind": generator.IsHandleKind,
+ "is_interface_kind": generator.IsInterfaceKind,
"is_object_kind": generator.IsObjectKind,
"is_string_kind": generator.IsStringKind,
"is_array_kind": lambda kind: isinstance(kind, mojom.Array),

Powered by Google App Engine
This is Rietveld 408576698