关于mojo binding的官方文档为mojo docs。 由于比较复杂,这里只做简单源码分析。
我们知道要实现rpc,必须实现客户端和服务端。 mojo 实现了一套领域语言,通过领域语言描述接口和数据, 再通过特有编译器编译成c++代码。 这个过程会生成Mojo对象, 我们以content/common/child_process.mojom 为例子来分析。
interface ChildProcess {
......
// Requests that the process bind a receiving pipe t