OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ | 5 #ifndef MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ |
6 #define MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ | 6 #define MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual void OnPortsMessage(const ports::NodeName& from_node, | 58 virtual void OnPortsMessage(const ports::NodeName& from_node, |
59 Channel::MessagePtr message) = 0; | 59 Channel::MessagePtr message) = 0; |
60 virtual void OnRequestPortMerge(const ports::NodeName& from_node, | 60 virtual void OnRequestPortMerge(const ports::NodeName& from_node, |
61 const ports::PortName& connector_port_name, | 61 const ports::PortName& connector_port_name, |
62 const std::string& token) = 0; | 62 const std::string& token) = 0; |
63 virtual void OnRequestIntroduction(const ports::NodeName& from_node, | 63 virtual void OnRequestIntroduction(const ports::NodeName& from_node, |
64 const ports::NodeName& name) = 0; | 64 const ports::NodeName& name) = 0; |
65 virtual void OnIntroduce(const ports::NodeName& from_node, | 65 virtual void OnIntroduce(const ports::NodeName& from_node, |
66 const ports::NodeName& name, | 66 const ports::NodeName& name, |
67 ScopedPlatformHandle channel_handle) = 0; | 67 ScopedPlatformHandle channel_handle) = 0; |
| 68 virtual void OnBroadcast(const ports::NodeName& from_node, |
| 69 Channel::MessagePtr message) = 0; |
68 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 70 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
69 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, | 71 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, |
70 base::ProcessHandle from_process, | 72 base::ProcessHandle from_process, |
71 const ports::NodeName& destination, | 73 const ports::NodeName& destination, |
72 Channel::MessagePtr message) = 0; | 74 Channel::MessagePtr message) = 0; |
73 virtual void OnPortsMessageFromRelay(const ports::NodeName& from_node, | 75 virtual void OnPortsMessageFromRelay(const ports::NodeName& from_node, |
74 const ports::NodeName& source_node, | 76 const ports::NodeName& source_node, |
75 Channel::MessagePtr message) = 0; | 77 Channel::MessagePtr message) = 0; |
76 #endif | 78 #endif |
77 | 79 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 void BrokerClientAdded(const ports::NodeName& client_name, | 127 void BrokerClientAdded(const ports::NodeName& client_name, |
126 ScopedPlatformHandle broker_channel); | 128 ScopedPlatformHandle broker_channel); |
127 void AcceptBrokerClient(const ports::NodeName& broker_name, | 129 void AcceptBrokerClient(const ports::NodeName& broker_name, |
128 ScopedPlatformHandle broker_channel); | 130 ScopedPlatformHandle broker_channel); |
129 void PortsMessage(Channel::MessagePtr message); | 131 void PortsMessage(Channel::MessagePtr message); |
130 void RequestPortMerge(const ports::PortName& connector_port_name, | 132 void RequestPortMerge(const ports::PortName& connector_port_name, |
131 const std::string& token); | 133 const std::string& token); |
132 void RequestIntroduction(const ports::NodeName& name); | 134 void RequestIntroduction(const ports::NodeName& name); |
133 void Introduce(const ports::NodeName& name, | 135 void Introduce(const ports::NodeName& name, |
134 ScopedPlatformHandle channel_handle); | 136 ScopedPlatformHandle channel_handle); |
| 137 void Broadcast(Channel::MessagePtr message); |
135 | 138 |
136 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 139 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
137 // Relay the message to the specified node via this channel. This is used to | 140 // Relay the message to the specified node via this channel. This is used to |
138 // pass windows handles between two processes that do not have permission to | 141 // pass windows handles between two processes that do not have permission to |
139 // duplicate handles into the other's address space. The relay process is | 142 // duplicate handles into the other's address space. The relay process is |
140 // assumed to have that permission. | 143 // assumed to have that permission. |
141 void RelayPortsMessage(const ports::NodeName& destination, | 144 void RelayPortsMessage(const ports::NodeName& destination, |
142 Channel::MessagePtr message); | 145 Channel::MessagePtr message); |
143 | 146 |
144 // Sends a message to its destination from a relay. This is interpreted by the | 147 // Sends a message to its destination from a relay. This is interpreted by the |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 PendingRelayMessageQueue pending_relay_messages_; | 198 PendingRelayMessageQueue pending_relay_messages_; |
196 #endif | 199 #endif |
197 | 200 |
198 DISALLOW_COPY_AND_ASSIGN(NodeChannel); | 201 DISALLOW_COPY_AND_ASSIGN(NodeChannel); |
199 }; | 202 }; |
200 | 203 |
201 } // namespace edk | 204 } // namespace edk |
202 } // namespace mojo | 205 } // namespace mojo |
203 | 206 |
204 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ | 207 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ |
OLD | NEW |