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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 Channel::MessagePtr message) = 0; | 69 Channel::MessagePtr message) = 0; |
70 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 70 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
71 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, | 71 virtual void OnRelayPortsMessage(const ports::NodeName& from_node, |
72 base::ProcessHandle from_process, | 72 base::ProcessHandle from_process, |
73 const ports::NodeName& destination, | 73 const ports::NodeName& destination, |
74 Channel::MessagePtr message) = 0; | 74 Channel::MessagePtr message) = 0; |
75 virtual void OnPortsMessageFromRelay(const ports::NodeName& from_node, | 75 virtual void OnPortsMessageFromRelay(const ports::NodeName& from_node, |
76 const ports::NodeName& source_node, | 76 const ports::NodeName& source_node, |
77 Channel::MessagePtr message) = 0; | 77 Channel::MessagePtr message) = 0; |
78 #endif | 78 #endif |
79 | 79 virtual void OnAcceptPeer(const ports::NodeName& from_node, |
| 80 const ports::NodeName& token, |
| 81 const ports::NodeName& peer_name, |
| 82 const ports::PortName& port_name) = 0; |
80 virtual void OnChannelError(const ports::NodeName& node, | 83 virtual void OnChannelError(const ports::NodeName& node, |
81 NodeChannel* channel) = 0; | 84 NodeChannel* channel) = 0; |
82 | 85 |
83 #if defined(OS_MACOSX) && !defined(OS_IOS) | 86 #if defined(OS_MACOSX) && !defined(OS_IOS) |
84 virtual MachPortRelay* GetMachPortRelay() = 0; | 87 virtual MachPortRelay* GetMachPortRelay() = 0; |
85 #endif | 88 #endif |
86 }; | 89 }; |
87 | 90 |
88 static scoped_refptr<NodeChannel> Create( | 91 static scoped_refptr<NodeChannel> Create( |
89 Delegate* delegate, | 92 Delegate* delegate, |
(...skipping 27 matching lines...) Expand all Loading... |
117 // freed if necessary. | 120 // freed if necessary. |
118 base::ProcessHandle CopyRemoteProcessHandle(); | 121 base::ProcessHandle CopyRemoteProcessHandle(); |
119 | 122 |
120 // Used for context in Delegate calls (via |from_node| arguments.) | 123 // Used for context in Delegate calls (via |from_node| arguments.) |
121 void SetRemoteNodeName(const ports::NodeName& name); | 124 void SetRemoteNodeName(const ports::NodeName& name); |
122 | 125 |
123 void AcceptChild(const ports::NodeName& parent_name, | 126 void AcceptChild(const ports::NodeName& parent_name, |
124 const ports::NodeName& token); | 127 const ports::NodeName& token); |
125 void AcceptParent(const ports::NodeName& token, | 128 void AcceptParent(const ports::NodeName& token, |
126 const ports::NodeName& child_name); | 129 const ports::NodeName& child_name); |
| 130 void AcceptPeer(const ports::NodeName& sender_name, |
| 131 const ports::NodeName& token, |
| 132 const ports::PortName& port_name); |
127 void AddBrokerClient(const ports::NodeName& client_name, | 133 void AddBrokerClient(const ports::NodeName& client_name, |
128 base::ProcessHandle process_handle); | 134 base::ProcessHandle process_handle); |
129 void BrokerClientAdded(const ports::NodeName& client_name, | 135 void BrokerClientAdded(const ports::NodeName& client_name, |
130 ScopedPlatformHandle broker_channel); | 136 ScopedPlatformHandle broker_channel); |
131 void AcceptBrokerClient(const ports::NodeName& broker_name, | 137 void AcceptBrokerClient(const ports::NodeName& broker_name, |
132 ScopedPlatformHandle broker_channel); | 138 ScopedPlatformHandle broker_channel); |
133 void PortsMessage(Channel::MessagePtr message); | 139 void PortsMessage(Channel::MessagePtr message); |
134 void RequestPortMerge(const ports::PortName& connector_port_name, | 140 void RequestPortMerge(const ports::PortName& connector_port_name, |
135 const std::string& token); | 141 const std::string& token); |
136 void RequestIntroduction(const ports::NodeName& name); | 142 void RequestIntroduction(const ports::NodeName& name); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 PendingRelayMessageQueue pending_relay_messages_; | 209 PendingRelayMessageQueue pending_relay_messages_; |
204 #endif | 210 #endif |
205 | 211 |
206 DISALLOW_COPY_AND_ASSIGN(NodeChannel); | 212 DISALLOW_COPY_AND_ASSIGN(NodeChannel); |
207 }; | 213 }; |
208 | 214 |
209 } // namespace edk | 215 } // namespace edk |
210 } // namespace mojo | 216 } // namespace mojo |
211 | 217 |
212 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ | 218 #endif // MOJO_EDK_SYSTEM_NODE_CHANNEL_H_ |
OLD | NEW |