Small fixes for Mojo docs
Change-Id: I5c9b07a3252a6cc3c303c8da3ccd2252be72d242 Reviewed-on: https://chromium-review.googlesource.com/1158717 Commit-Queue: Tom McKee <tommckee@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#580221}
This commit is contained in:
@ -15,7 +15,7 @@ that message on the other endpoint. Message pipes are thus bidirectional.
|
|||||||
A **mojom** file describes **interfaces** which describe strongly typed message
|
A **mojom** file describes **interfaces** which describe strongly typed message
|
||||||
structures, similar to proto files.
|
structures, similar to proto files.
|
||||||
|
|
||||||
Given a **mojom interface** and a **message pipe**, the two **message pipes**
|
Given a **mojom interface** and a **message pipe**, the two **endpoints**
|
||||||
can be given the labels **InterfacePtr** and **Binding**. This now describes a
|
can be given the labels **InterfacePtr** and **Binding**. This now describes a
|
||||||
strongly typed **message pipe** which transports messages described by the
|
strongly typed **message pipe** which transports messages described by the
|
||||||
**mojom interface**. The **InterfacePtr** is the **endpoint** which "sends"
|
**mojom interface**. The **InterfacePtr** is the **endpoint** which "sends"
|
||||||
|
@ -669,7 +669,7 @@ For example, consider the following Mojom definitions:
|
|||||||
```cpp
|
```cpp
|
||||||
union Value {
|
union Value {
|
||||||
int64 int_value;
|
int64 int_value;
|
||||||
float32 float_value;
|
float float_value;
|
||||||
string string_value;
|
string string_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -678,12 +678,17 @@ interface Dictionary {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
This generates a the following C++ interface:
|
This generates the following C++ interface:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
class Value {
|
class Value {
|
||||||
public:
|
public:
|
||||||
virtual ~Value() {}
|
~Value() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Dictionary {
|
||||||
|
public:
|
||||||
|
virtual ~Dictionary() {}
|
||||||
|
|
||||||
virtual void AddValue(const std::string& key, ValuePtr value) = 0;
|
virtual void AddValue(const std::string& key, ValuePtr value) = 0;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user