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

Side by Side Diff: mojo/public/bindings/generators/js_templates/interface_definition.tmpl

Issue 99623010: Add support for enums within structs and interfaces to mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 {%- for method in interface.methods %} 1 {%- for method in interface.methods %}
2 var k{{interface.name}}_{{method.name}}_Name = {{method.ordinal}}; 2 var k{{interface.name}}_{{method.name}}_Name = {{method.ordinal}};
3 {%- endfor %} 3 {%- endfor %}
4 4
5 function {{interface.name}}Proxy(receiver) { 5 function {{interface.name}}Proxy(receiver) {
6 this.receiver_ = receiver; 6 this.receiver_ = receiver;
7 } 7 }
8 8
9 {%- for method in interface.methods %} 9 {%- for method in interface.methods %}
10 {{interface.name}}Proxy.prototype.{{method.name|stylize_method}} = function( 10 {{interface.name}}Proxy.prototype.{{method.name|stylize_method}} = function(
(...skipping 26 matching lines...) Expand all
37 this.{{method.name|stylize_method}}( 37 this.{{method.name|stylize_method}}(
38 {%- for parameter in method.parameters -%} 38 {%- for parameter in method.parameters -%}
39 params.{{parameter.name}}{% if not loop.last %}, {% endif %} 39 params.{{parameter.name}}{% if not loop.last %}, {% endif %}
40 {%- endfor %}); 40 {%- endfor %});
41 return true; 41 return true;
42 {%- endfor %} 42 {%- endfor %}
43 default: 43 default:
44 return false; 44 return false;
45 } 45 }
46 }; 46 };
47
48 {#--- Enums #}
49 {%- from "enum_definition.tmpl" import enum_def -%}
50 {% for enum in interface.enums %}
51 {{ enum_def("%sProxy.%s"|format(interface.name, enum.name), enum)}}
52 {{interface.name}}Stub.{{enum.name}} = {{interface.name}}Proxy.{{enum.name}};
abarth-chromium 2013/12/20 04:40:24 Do we want these to be the same object or two diff
Matt Perry 2014/01/06 19:55:11 Is there a difference?
53 {%- endfor %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698