Lines Matching refs:mojom
12 emitted in a `.js` file with the name based on the input `.mojom` file. Suppose
14 `//services/echo/public/interfaces/echo.mojom`:
17 module test.echo.mojom;
28 import("//mojo/public/tools/bindings/mojom.gni")
30 mojom("interfaces") {
32 "echo.mojom",
50 out/gen/services/echo/public/interfaces/echo.mojom.js
53 In order to use the definitions in `echo.mojom`, you will need to include two
56 __Note: This file must be included before any `.mojom.js` files.__
57 * `echo.mojom.js`
62 <script src="URL/to/echo.mojom.js"></script>
65 var echoPtr = new test.echo.mojom.EchoPtr();
84 Let's consider the `echo.mojom` example above. The following shows how to create
90 <script src="URL/to/echo.mojom.js"></script>
98 var echoServicePtr = new test.echo.mojom.EchoPtr();
100 var echoServiceBinding = new mojo.Binding(test.echo.mojom.Echo,
111 In the example above, `test.echo.mojom.EchoPtr` is an interface pointer class.
202 By default, generated `.mojom.js` files automatically load Mojom dependencies.
203 For example, if `foo.mojom` imports `bar.mojom`, loading `foo.mojom.js` will
204 insert a `<script>` tag to load `bar.mojom.js`, if it hasn't been loaded.
206 The URL of `bar.mojom.js` is determined by:
207 * the path of `bar.mojom` relative to the position of `foo.mojom` at build time;
208 * the URL of `foo.mojom.js`.
212 a/b/c/foo.mojom
213 a/b/d/bar.mojom
216 The URL of `foo.mojom.js` is:
218 http://example.org/scripts/b/c/foo.mojom.js
221 Then the URL of `bar.mojom.js` is supposed to be:
223 http://example.org/scripts/b/d/bar.mojom.js
226 If you would like `bar.mojom.js` to live at a different location, you need to
227 set `mojo.config.autoLoadMojomDeps` to `false` before loading `foo.mojom.js`,
228 and manually load `bar.mojom.js` yourself. Similarly, you need to turn off this
229 option if you merge `bar.mojom.js` and `foo.mojom.js` into a single file.
234 <script src="http://example.org/scripts/b/c/foo.mojom.js"></script>
242 <script src="http://example.org/scripts/b/d/bar.mojom.js"></script>
243 <script src="http://example.org/scripts/b/c/foo.mojom.js"></script>
246 ### Performance Tip: Avoid Loading the Same .mojom.js File Multiple Times
248 value), you might accidentally load the same `.mojom.js` file multiple times if
256 <script src="http://example.org/scripts/b/c/foo.mojom.js"></script>
259 <script src="http://example.org/scripts/b/d/bar.mojom.js"></script>
260 <script src="http://example.org/scripts/b/c/foo.mojom.js"></script>
262 <!-- Load bar.mojom.js twice; should be avoided. -->
263 <!-- when foo.mojom.js is loaded, it sees that bar.mojom.js is not yet loaded,
264 so it inserts another <script> tag for bar.mojom.js. -->
265 <script src="http://example.org/scripts/b/c/foo.mojom.js"></script>
266 <script src="http://example.org/scripts/b/d/bar.mojom.js"></script>
269 If a `.mojom.js` file is loaded for a second time, a warnings will be showed
277 | In Mojom | In generated .mojom.js |