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

Side by Side Diff: mojo/public/tools/bindings/generators/js_templates/module.js.tmpl

Issue 637373002: Mojo JS bindings: simplify mojo.connectToService() usage - Part 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed the mojo_internals module, made Connection localFactory optional Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 define("{{module.path}}", [ 5 define("{{module.path}}", [
6 "mojo/public/js/bindings/codec", 6 "mojo/public/js/bindings/codec",
7 "mojo/public/js/bindings/validator", 7 "mojo/public/js/bindings/validator",
8 {%- for import in imports %} 8 {%- for import in imports %}
9 "{{import.module.path}}", 9 "{{import.module.path}}",
10 {%- endfor %} 10 {%- endfor %}
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 exports.{{enum.name}} = {{enum.name}}; 43 exports.{{enum.name}} = {{enum.name}};
44 {%- endfor %} 44 {%- endfor %}
45 {%- for struct in structs if struct.exported %} 45 {%- for struct in structs if struct.exported %}
46 exports.{{struct.name}} = {{struct.name}}; 46 exports.{{struct.name}} = {{struct.name}};
47 {%- endfor %} 47 {%- endfor %}
48 {%- for interface in interfaces %} 48 {%- for interface in interfaces %}
49 exports.{{interface.name}} = {{interface.name}}; 49 exports.{{interface.name}} = {{interface.name}};
50 {#--- Interface Client #} 50 {#--- Interface Client #}
51 {%- if interface.client in interfaces|map(attribute='name') %} 51 {%- if interface.client in interfaces|map(attribute='name') %}
52 exports.{{interface.name}}.client = {{interface.client}}; 52 exports.{{interface.name}}.client = {{interface.client}};
53 {%- elif interface.client in imported_interfaces %}
54 exports.{{interface.name}}.client = {{imported_interfaces[interface.client]}};
53 {%- endif %} 55 {%- endif %}
54 {%- endfor %} 56 {%- endfor %}
55 57
56 return exports; 58 return exports;
57 }); 59 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698