| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 ScopedPlatformHandle broker_channel) = 0; | 55 ScopedPlatformHandle broker_channel) = 0; |
| 56 virtual void OnPortsMessage(Channel::MessagePtr message) = 0; | 56 virtual void OnPortsMessage(Channel::MessagePtr message) = 0; |
| 57 virtual void OnRequestPortMerge(const ports::NodeName& from_node, | 57 virtual void OnRequestPortMerge(const ports::NodeName& from_node, |
| 58 const ports::PortName& connector_port_name, | 58 const ports::PortName& connector_port_name, |
| 59 const std::string& token) = 0; | 59 const std::string& token) = 0; |
| 60 virtual void OnRequestIntroduction(const ports::NodeName& from_node, | 60 virtual void OnRequestIntroduction(const ports::NodeName& from_node, |
| 61 const ports::NodeName& name) = 0; | 61 const ports::NodeName& name) = 0; |
| 62 virtual void OnIntroduce(const ports::NodeName& from_node, | 62 virtual void OnIntroduce(const ports::NodeName& from_node, |
| 63 const ports::NodeName& name, | 63 const ports::NodeName& name, |
| 64 ScopedPlatformHandle channel_handle) = 0; | 64 ScopedPlatformHandle channel_handle) = 0; |
| 65 virtual void OnBroadcast(Channel::MessagePtr message) = 0; |
| 65 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 66 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 66 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, | 67 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, |
| 67 base::ProcessHandle from_process, | 68 base::ProcessHandle from_process, |
| 68 const ports::NodeName& destination, | 69 const ports::NodeName& destination, |
| 69 Channel::MessagePtr message) = 0; | 70 Channel::MessagePtr message) = 0; |
| 70 #endif | 71 #endif |
| 71 | 72 |
| 72 virtual void OnChannelError(const ports::NodeName& node) = 0; | 73 virtual void OnChannelError(const ports::NodeName& node) = 0; |
| 73 | 74 |
| 74 #if defined(OS_MACOSX) && !defined(OS_IOS) | 75 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void BrokerClientAdded(const ports::NodeName& client_name, | 113 void BrokerClientAdded(const ports::NodeName& client_name, |
| 113 ScopedPlatformHandle broker_channel); | 114 ScopedPlatformHandle broker_channel); |
| 114 void AcceptBrokerClient(const ports::NodeName& broker_name, | 115 void AcceptBrokerClient(const ports::NodeName& broker_name, |
| 115 ScopedPlatformHandle broker_channel); | 116 ScopedPlatformHandle broker_channel); |
| 116 void PortsMessage(Channel::MessagePtr message); | 117 void PortsMessage(Channel::MessagePtr message); |
| 117 void RequestPortMerge(const ports::PortName& connector_port_name, | 118 void RequestPortMerge(const ports::PortName& connector_port_name, |
| 118 const std::string& token); | 119 const std::string& token); |
| 119 void RequestIntroduction(const ports::NodeName& name); | 120 void RequestIntroduction(const ports::NodeName& name); |
| 120 void Introduce(const ports::NodeName& name, | 121 void Introduce(const ports::NodeName& name, |
| 121 ScopedPlatformHandle channel_handle); | 122 ScopedPlatformHandle channel_handle); |
| 123 void Broadcast(Channel::MessagePtr message); |
| 122 | 124 |
| 123 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 125 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 124 // Relay the message to the specified node via this channel. This is used to | 126 // Relay the message to the specified node via this channel. This is used to |
| 125 // pass windows handles between two processes that do not have permission to | 127 // pass windows handles between two processes that do not have permission to |
| 126 // duplicate handles into the other's address space. The relay process is | 128 // duplicate handles into the other's address space. The relay process is |
| 127 // assumed to have that permission. | 129 // assumed to have that permission. |
| 128 void RelayPortsMessage(const ports::NodeName& destination, | 130 void RelayPortsMessage(const ports::NodeName& destination, |
| 129 Channel::MessagePtr message); | 131 Channel::MessagePtr message); |
| 130 #endif | 132 #endif |
| 131 | 133 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 PendingRelayMessageQueue pending_relay_messages_; | 176 PendingRelayMessageQueue pending_relay_messages_; |
| 175 #endif | 177 #endif |
| 176 | 178 |
| 177 DISALLOW_COPY_AND_ASSIGN(NodeChannel); | 179 DISALLOW_COPY_AND_ASSIGN(NodeChannel); |
| 178 }; | 180 }; |
| 179 | 181 |
| 180 } // namespace edk | 182 } // namespace edk |
| 181 } // namespace mojo | 183 } // namespace mojo |
| 182 | 184 |
| 183 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ | 185 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ |
| OLD | NEW |