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

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

Issue 273233002: Mojo cpp bindings: add support for validating incoming messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and 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 d27a13f04ab0583c313acd21365335f047b67469..52d380aa2e7964b2b853ce7675eec3d96c923e3a 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -171,6 +171,12 @@ def ExpressionToText(value, module):
return "".join(generator.ExpressionMapper(value,
lambda token: TranslateConstants(token, module)))
+def HasCallbacks(interface):
+ for method in interface.methods:
+ if method.response_parameters != None:
+ return True
+ return False
+
_HEADER_SIZE = 8
class Generator(generator.Generator):
@@ -184,6 +190,7 @@ class Generator(generator.Generator):
"cpp_wrapper_type": GetCppWrapperType,
"expression_to_text": ExpressionToText,
"get_pad": pack.GetPad,
+ "has_callbacks": HasCallbacks,
"is_enum_kind": generator.IsEnumKind,
"is_handle_kind": generator.IsHandleKind,
"is_interface_kind": generator.IsInterfaceKind,
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl ('k') | mojo/public/tools/bindings/mojom.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698