|
1 include protocol PTestHandle; |
|
2 |
|
3 using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; |
|
4 using struct mozilla::null_t from "ipc/IPCMessageUtils.h"; |
|
5 |
|
6 namespace mozilla { |
|
7 namespace _ipdltest { |
|
8 |
|
9 union Key { |
|
10 // int; |
|
11 // double; |
|
12 nsString; |
|
13 }; |
|
14 |
|
15 struct KeyValue { |
|
16 Key key; |
|
17 JSONVariant value; |
|
18 }; |
|
19 |
|
20 union JSONVariant { |
|
21 void_t; |
|
22 null_t; |
|
23 bool; |
|
24 int; |
|
25 double; |
|
26 nsString; |
|
27 PTestHandle; |
|
28 KeyValue[]; |
|
29 JSONVariant[]; |
|
30 }; |
|
31 |
|
32 sync protocol PTestJSON { |
|
33 manages PTestHandle; |
|
34 |
|
35 child: |
|
36 async Start(); |
|
37 |
|
38 parent: |
|
39 async PTestHandle(); |
|
40 sync Test(JSONVariant i) |
|
41 returns (JSONVariant o); |
|
42 async __delete__(); |
|
43 |
|
44 state START: |
|
45 send Start goto TEST; |
|
46 |
|
47 state TEST: |
|
48 recv PTestHandle goto TEST; |
|
49 recv Test goto TEST; |
|
50 recv __delete__; |
|
51 }; |
|
52 |
|
53 } // namespace mozilla |
|
54 } // namespace _ipdltest |