| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| 'use strict'; |
| |
| (function() { |
| var mojomId = '{{module.path}}'; |
| if (mojo.internal.isMojomLoaded(mojomId)) { |
| console.warn('The following mojom is loaded multiple times: ' + mojomId); |
| return; |
| } |
| mojo.internal.markMojomLoaded(mojomId); |
| |
| // TODO(yzshen): Define these aliases to minimize the differences between the |
| // old/new modes. Remove them when the old mode goes away. |
| var bindings = mojo; |
| var associatedBindings = mojo; |
| var codec = mojo.internal; |
| var validator = mojo.internal; |
| |
| var exports = mojo.internal.exposeNamespace('{{module.namespace}}'); |
| |
| {%- for import in imports %} |
| var {{import.unique_name}} = |
| mojo.internal.exposeNamespace('{{import.namespace}}'); |
| if (mojo.config.autoLoadMojomDeps) { |
| mojo.internal.loadMojomIfNecessary( |
| '{{import.path}}', '{{import|get_relative_url(module)}}.js'); |
| } |
| {%- endfor %} |
| |
| {% include "module_definition.tmpl" %} |
| })(); |