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

Unified Diff: mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl

Issue 488173006: Integrate Mojo JS validation bindings with the Router (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more indentation fix (sorry about the noise) Created 6 years, 4 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/js_templates/interface_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
index 62f03ae7e9f7e449f75fab8f3664eb32fc2e5200..ca2a0eab3b4190c53387af651b0152b794c29b72 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -157,6 +157,16 @@ params.{{parameter.name}}{% if not loop.last %}, {% endif -%}
{%- endif %}
}
+ {{interface.name}}Stub.prototype.validators = [
+ validate{{interface.name}}Request
+ ];
+
+ {{interface.name}}Proxy.prototype.validators = [
+{%- if interface|has_callbacks %}
+ validate{{interface.name}}Response
+{%- endif %}
+ ];
+
{#--- Enums #}
{% from "enum_definition.tmpl" import enum_def -%}
{% for enum in interface.enums %}
@@ -168,4 +178,4 @@ params.{{parameter.name}}{% if not loop.last %}, {% endif -%}
{% for constant in interface.constants %}
{{interface.name}}Proxy.{{constant.name}} = {{constant.value|expression_to_text}};
{{interface.name}}Stub.{{constant.name}} = {{interface.name}}Proxy.{{constant.name}};
-{% endfor %}
+{%- endfor %}

Powered by Google App Engine
This is Rietveld 408576698