OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module mandoline; | 5 module mandoline; |
6 | 6 |
7 import "network/public/interfaces/url_loader.mojom"; | 7 import "network/public/interfaces/url_loader.mojom"; |
8 | 8 |
9 // This files defines the interfaces and structures used for frames. | 9 // This files defines the interfaces and structures used for frames. |
10 // | 10 // |
(...skipping 30 matching lines...) Expand all Loading... |
41 // 0 if the frame has no parent (its the root). | 41 // 0 if the frame has no parent (its the root). |
42 uint32 parent_id; | 42 uint32 parent_id; |
43 uint32 frame_id; | 43 uint32 frame_id; |
44 | 44 |
45 // A map of the properties supplied by the client. The server does not | 45 // A map of the properties supplied by the client. The server does not |
46 // intepret these values in anyway, the meaning and usage is left up to | 46 // intepret these values in anyway, the meaning and usage is left up to |
47 // clients. | 47 // clients. |
48 map<string, array<uint8>>? client_properties; | 48 map<string, array<uint8>>? client_properties; |
49 }; | 49 }; |
50 | 50 |
51 struct MessageEvent { | 51 // TODO(sky): decide which bits of this make sense for all frames, and move the |
52 // TODO(sky): add details. | 52 // html specific parts into properties. |
| 53 struct HTMLMessageEvent { |
| 54 // The serialized script value. |
| 55 array<uint8>? data; |
| 56 |
| 57 // The origin of the source frame. |
| 58 string source_origin; |
| 59 |
| 60 // The origin for the message's target. |
| 61 string? target_origin; |
| 62 |
| 63 // TODO(sky): these two are not implemented. Figure out what they should be. |
| 64 // Information about the MessagePorts this message contains. |
| 65 // IPC_STRUCT_MEMBER(std::vector<content::TransferredMessagePort>, message_por
ts) |
| 66 // IPC_STRUCT_MEMBER(std::vector<int>, new_routing_ids) |
53 }; | 67 }; |
54 | 68 |
55 interface FrameTreeServer { | 69 interface FrameTreeServer { |
56 // TODO(sky): make these real. | 70 PostMessageEventToFrame(uint32 source_frame_id, |
57 PostMessageEventToFrame(uint32 frame_id, MessageEvent event); | 71 uint32 target_frame_id, |
| 72 HTMLMessageEvent event); |
58 | 73 |
59 // Notifies the server that a load has started or stopped in this frame. | 74 // Notifies the server that a load has started or stopped in this frame. |
60 // When loading is started, progress is reset to 0, but when loading is | 75 // When loading is started, progress is reset to 0, but when loading is |
61 // stopped progress may not have reached 1.0. | 76 // stopped progress may not have reached 1.0. |
62 LoadingStarted(uint32 frame_id); | 77 LoadingStarted(uint32 frame_id); |
63 LoadingStopped(uint32 frame_id); | 78 LoadingStopped(uint32 frame_id); |
64 | 79 |
65 // Called when the progress for this frame changes. Will only be called while | 80 // Called when the progress for this frame changes. Will only be called while |
66 // a load is in progress. | 81 // a load is in progress. |
67 ProgressChanged(uint32 frame_id, double progress); | 82 ProgressChanged(uint32 frame_id, double progress); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Called when a new frame is added to the tree. | 116 // Called when a new frame is added to the tree. |
102 OnFrameAdded(uint32 change_id, FrameData frame_data); | 117 OnFrameAdded(uint32 change_id, FrameData frame_data); |
103 | 118 |
104 // Called when a frame is removed from the tree. | 119 // Called when a frame is removed from the tree. |
105 OnFrameRemoved(uint32 change_id, uint32 frame_id); | 120 OnFrameRemoved(uint32 change_id, uint32 frame_id); |
106 | 121 |
107 // Called when a client property changes. | 122 // Called when a client property changes. |
108 OnFrameClientPropertyChanged(uint32 frame_id, | 123 OnFrameClientPropertyChanged(uint32 frame_id, |
109 string name, | 124 string name, |
110 array<uint8>? new_value); | 125 array<uint8>? new_value); |
| 126 |
| 127 PostMessage(uint32 source_frame_id, |
| 128 uint32 target_frame_id, |
| 129 HTMLMessageEvent event); |
111 }; | 130 }; |
OLD | NEW |