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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl

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/cpp_templates/interface_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
index fa5438ac5c206d03da037cd2d3346f6609fd94b1..ca551b3c393b01a61ae11d6902b3d0f59bc46c4a 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
@@ -1,6 +1,11 @@
{%- import "interface_macros.tmpl" as interface_macros %}
class {{interface.name}}Proxy;
class {{interface.name}}Stub;
+
+class {{interface.name}}RequestValidator;
+{%- if interface|has_callbacks %}
+class {{interface.name}}ResponseValidator;
+{%- endif %}
{% if interface.client %}
class {{interface.client}};
{% endif %}
@@ -9,6 +14,13 @@ class {{interface.name}} {
public:
typedef {{interface.name}}Proxy Proxy_;
typedef {{interface.name}}Stub Stub_;
+
+ typedef {{interface.name}}RequestValidator RequestValidator_;
+{%- if interface|has_callbacks %}
+ typedef {{interface.name}}ResponseValidator ResponseValidator_;
+{%- else %}
+ typedef mojo::PassThroughFilter ResponseValidator_;
+{%- endif %}
{% if interface.client %}
typedef {{interface.client}} Client;
{% else %}
@@ -28,6 +40,7 @@ class {{interface.name}} {
{#--- Methods #}
virtual ~{{interface.name}}() {}
+
{%- if interface.client %}
// Called once before any other method.
virtual void SetClient({{interface.client}}* client) = 0;

Powered by Google App Engine
This is Rietveld 408576698