| 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 <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual void OnAddBrokerClient(const ports::NodeName& from_node, | 37 virtual void OnAddBrokerClient(const ports::NodeName& from_node, |
| 38 const ports::NodeName& client_name, | 38 const ports::NodeName& client_name, |
| 39 ScopedPlatformHandle process_handle) = 0; | 39 ScopedPlatformHandle process_handle) = 0; |
| 40 virtual void OnBrokerClientAdded(const ports::NodeName& from_node, | 40 virtual void OnBrokerClientAdded(const ports::NodeName& from_node, |
| 41 const ports::NodeName& client_name, | 41 const ports::NodeName& client_name, |
| 42 ScopedPlatformHandle broker_channel) = 0; | 42 ScopedPlatformHandle broker_channel) = 0; |
| 43 virtual void OnAcceptBrokerClient(const ports::NodeName& from_node, | 43 virtual void OnAcceptBrokerClient(const ports::NodeName& from_node, |
| 44 const ports::NodeName& broker_name, | 44 const ports::NodeName& broker_name, |
| 45 ScopedPlatformHandle broker_channel) = 0; | 45 ScopedPlatformHandle broker_channel) = 0; |
| 46 virtual void OnPortsMessage(Channel::MessagePtr message) = 0; | 46 virtual void OnPortsMessage(Channel::MessagePtr message) = 0; |
| 47 virtual void OnRequestPortMerge(const ports::NodeName& from_node, | 47 virtual void OnRequestPortConnection( |
| 48 const ports::PortName& connector_port_name, | 48 const ports::NodeName& from_node, |
| 49 const std::string& token) = 0; | 49 const ports::PortName& connector_port_name, |
| 50 const std::string& token) = 0; |
| 51 virtual void OnConnectToPort( |
| 52 const ports::NodeName& from_node, |
| 53 const ports::PortName& connector_port_name, |
| 54 const ports::PortName& connectee_port_name) = 0; |
| 50 virtual void OnRequestIntroduction(const ports::NodeName& from_node, | 55 virtual void OnRequestIntroduction(const ports::NodeName& from_node, |
| 51 const ports::NodeName& name) = 0; | 56 const ports::NodeName& name) = 0; |
| 52 virtual void OnIntroduce(const ports::NodeName& from_node, | 57 virtual void OnIntroduce(const ports::NodeName& from_node, |
| 53 const ports::NodeName& name, | 58 const ports::NodeName& name, |
| 54 ScopedPlatformHandle channel_handle) = 0; | 59 ScopedPlatformHandle channel_handle) = 0; |
| 55 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
| 56 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, | 61 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, |
| 57 base::ProcessHandle from_process, | 62 base::ProcessHandle from_process, |
| 58 const ports::NodeName& destination, | 63 const ports::NodeName& destination, |
| 59 Channel::MessagePtr message) = 0; | 64 Channel::MessagePtr message) = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const ports::NodeName& token); | 96 const ports::NodeName& token); |
| 92 void AcceptParent(const ports::NodeName& token, | 97 void AcceptParent(const ports::NodeName& token, |
| 93 const ports::NodeName& child_name); | 98 const ports::NodeName& child_name); |
| 94 void AddBrokerClient(const ports::NodeName& client_name, | 99 void AddBrokerClient(const ports::NodeName& client_name, |
| 95 ScopedPlatformHandle process_handle); | 100 ScopedPlatformHandle process_handle); |
| 96 void BrokerClientAdded(const ports::NodeName& client_name, | 101 void BrokerClientAdded(const ports::NodeName& client_name, |
| 97 ScopedPlatformHandle broker_channel); | 102 ScopedPlatformHandle broker_channel); |
| 98 void AcceptBrokerClient(const ports::NodeName& broker_name, | 103 void AcceptBrokerClient(const ports::NodeName& broker_name, |
| 99 ScopedPlatformHandle broker_channel); | 104 ScopedPlatformHandle broker_channel); |
| 100 void PortsMessage(Channel::MessagePtr message); | 105 void PortsMessage(Channel::MessagePtr message); |
| 101 void RequestPortMerge(const ports::PortName& connector_port_name, | 106 void RequestPortConnection(const ports::PortName& connector_port_name, |
| 102 const std::string& token); | 107 const std::string& token); |
| 108 void ConnectToPort(const ports::PortName& connector_port_name, |
| 109 const ports::PortName& connectee_port_name); |
| 103 void RequestIntroduction(const ports::NodeName& name); | 110 void RequestIntroduction(const ports::NodeName& name); |
| 104 void Introduce(const ports::NodeName& name, | 111 void Introduce(const ports::NodeName& name, |
| 105 ScopedPlatformHandle channel_handle); | 112 ScopedPlatformHandle channel_handle); |
| 106 | 113 |
| 107 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
| 108 // Relay the message to the specified node via this channel. This is used to | 115 // Relay the message to the specified node via this channel. This is used to |
| 109 // pass windows handles between two processes that do not have permission to | 116 // pass windows handles between two processes that do not have permission to |
| 110 // duplicate handles into the other's address space. The relay process is | 117 // duplicate handles into the other's address space. The relay process is |
| 111 // assumed to have that permission. | 118 // assumed to have that permission. |
| 112 void RelayPortsMessage(const ports::NodeName& destination, | 119 void RelayPortsMessage(const ports::NodeName& destination, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 143 base::ProcessHandle remote_process_handle_ = base::kNullProcessHandle; | 150 base::ProcessHandle remote_process_handle_ = base::kNullProcessHandle; |
| 144 #endif | 151 #endif |
| 145 | 152 |
| 146 DISALLOW_COPY_AND_ASSIGN(NodeChannel); | 153 DISALLOW_COPY_AND_ASSIGN(NodeChannel); |
| 147 }; | 154 }; |
| 148 | 155 |
| 149 } // namespace edk | 156 } // namespace edk |
| 150 } // namespace mojo | 157 } // namespace mojo |
| 151 | 158 |
| 152 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ | 159 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ |
| OLD | NEW |