OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual ~HostEventCallback() {} | 71 virtual ~HostEventCallback() {} |
72 | 72 |
73 // Called when state of the connection changes. | 73 // Called when state of the connection changes. |
74 virtual void OnConnectionState(State state, ErrorCode error) = 0; | 74 virtual void OnConnectionState(State state, ErrorCode error) = 0; |
75 | 75 |
76 // Called when ready state of the connection changes. When |ready| | 76 // Called when ready state of the connection changes. When |ready| |
77 // is set to false some data sent by the peers may be | 77 // is set to false some data sent by the peers may be |
78 // delayed. This is used to indicate in the UI when connection is | 78 // delayed. This is used to indicate in the UI when connection is |
79 // temporarily broken. | 79 // temporarily broken. |
80 virtual void OnConnectionReady(bool ready) = 0; | 80 virtual void OnConnectionReady(bool ready) = 0; |
| 81 |
| 82 // Called when the route type (direct vs. STUN vs. proxied) changes. |
| 83 virtual void OnRouteChanged(const std::string& channel_name, |
| 84 const protocol::TransportRoute& route) = 0; |
81 }; | 85 }; |
82 | 86 |
83 ConnectionToHost(bool allow_nat_traversal); | 87 ConnectionToHost(bool allow_nat_traversal); |
84 virtual ~ConnectionToHost(); | 88 virtual ~ConnectionToHost(); |
85 | 89 |
86 // |signal_strategy| must outlive connection. |audio_stub| may be | 90 // |signal_strategy| must outlive connection. |audio_stub| may be |
87 // null, in which case audio will not be requested. | 91 // null, in which case audio will not be requested. |
88 virtual void Connect(SignalStrategy* signal_strategy, | 92 virtual void Connect(SignalStrategy* signal_strategy, |
89 const std::string& host_jid, | 93 const std::string& host_jid, |
90 const std::string& host_public_key, | 94 const std::string& host_public_key, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 std::set<std::string> not_ready_channels_; | 175 std::set<std::string> not_ready_channels_; |
172 | 176 |
173 private: | 177 private: |
174 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); | 178 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); |
175 }; | 179 }; |
176 | 180 |
177 } // namespace protocol | 181 } // namespace protocol |
178 } // namespace remoting | 182 } // namespace remoting |
179 | 183 |
180 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 184 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
OLD | NEW |