build.khadas.com - Index of /khadas/test/edge2/external/libchrome/mojo/public/js/

khadas/test/edge2/external/libchrome/mojo/public/js
../
lib/                                               02-Jul-2024 02:09                   -
README.md                                          02-Jul-2024 02:09               10804
base.js                                            02-Jul-2024 02:09                4326
bindings.js                                        02-Jul-2024 02:09               17387
interface_types.js                                 02-Jul-2024 02:09                2965
mojo_bindings_resources.grd                        02-Jul-2024 02:09                 841

">;http://example.org/scripts/mojo_bindings.js"></script> <script src="">;http://example.org/scripts/b/c/foo.mojom.js"></script> <!-- Manual dependency loading --> <script src="">;http://example.org/scripts/mojo_bindings.js"></script> <script> mojo.config.autoLoadMojomDeps = false; </script> <script src="">;http://example.org/scripts/b/d/bar.mojom.js"></script> <script src="">;http://example.org/scripts/b/c/foo.mojom.js"></script> ``` ### Performance Tip: Avoid Loading the Same .mojom.js File Multiple Times If `mojo.config.autoLoadMojomDeps` is set to `true` (which is the default value), you might accidentally load the same `.mojom.js` file multiple times if you are not careful. Although it doesn't cause fatal errors, it hurts performance and therefore should be avoided. ``` html <!-- Assume that mojo.config.autoLoadMojomDeps is set to true: --> <!-- No duplicate loading; recommended. --> <script src="">;http://example.org/scripts/b/c/foo.mojom.js"></script> <!-- No duplicate loading, although unnecessary. --> <script src="">;http://example.org/scripts/b/d/bar.mojom.js"></script> <script src="">;http://example.org/scripts/b/c/foo.mojom.js"></script> <!-- Load bar.mojom.js twice; should be avoided. --> <!-- when foo.mojom.js is loaded, it sees that bar.mojom.js is not yet loaded, so it inserts another <script> tag for bar.mojom.js. --> <script src="">;http://example.org/scripts/b/c/foo.mojom.js"></script> <script src="">;http://example.org/scripts/b/d/bar.mojom.js"></script> ``` If a `.mojom.js` file is loaded for a second time, a warnings will be showed using `console.warn()` to bring it to developers' attention. ## Name Formatting As a general rule, Mojom definitions follow the C++ formatting style. To make the generated JavaScript bindings conforms to our JavaScript style guide, the code generator does the following conversions: | In Mojom | In generated .mojom.js | |----------------------|------------------------| | MethodLikeThis | methodLikeThis | parameter_like_this | parameterLikeThis | field_like_this | fieldLikeThis | name_space.like_this | nameSpace.likeThis `);