Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 FAILED, | 57 FAILED, |
| 58 CLOSED, | 58 CLOSED, |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class HostEventCallback { | 61 class HostEventCallback { |
| 62 public: | 62 public: |
| 63 virtual ~HostEventCallback() {} | 63 virtual ~HostEventCallback() {} |
| 64 | 64 |
| 65 // Called when state of the connection changes. | 65 // Called when state of the connection changes. |
| 66 virtual void OnConnectionState(State state, ErrorCode error) = 0; | 66 virtual void OnConnectionState(State state, ErrorCode error) = 0; |
| 67 | |
| 68 // Called to indicate inactive connection. | |
|
Wez
2012/07/16 18:51:23
What does it mean for a connection to be "inactive
Sergey Ulanov
2012/07/17 01:17:17
Done.
| |
| 69 virtual void OnConnectionInactive(bool inactive) = 0; | |
|
Wez
2012/07/16 18:51:23
Why not expose this as a new connection state?
Sergey Ulanov
2012/07/17 01:17:17
I considered it, but I don't think it would be use
| |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 ConnectionToHost(bool allow_nat_traversal); | 72 ConnectionToHost(bool allow_nat_traversal); |
| 70 virtual ~ConnectionToHost(); | 73 virtual ~ConnectionToHost(); |
| 71 | 74 |
| 72 virtual void Connect(scoped_refptr<XmppProxy> xmpp_proxy, | 75 virtual void Connect(scoped_refptr<XmppProxy> xmpp_proxy, |
| 73 const std::string& local_jid, | 76 const std::string& local_jid, |
| 74 const std::string& host_jid, | 77 const std::string& host_jid, |
| 75 const std::string& host_public_key, | 78 const std::string& host_public_key, |
| 76 scoped_ptr<TransportFactory> transport_factory, | 79 scoped_ptr<TransportFactory> transport_factory, |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 97 // SessionManager::Listener interface. | 100 // SessionManager::Listener interface. |
| 98 virtual void OnSessionManagerReady() OVERRIDE; | 101 virtual void OnSessionManagerReady() OVERRIDE; |
| 99 virtual void OnIncomingSession( | 102 virtual void OnIncomingSession( |
| 100 Session* session, | 103 Session* session, |
| 101 SessionManager::IncomingSessionResponse* response) OVERRIDE; | 104 SessionManager::IncomingSessionResponse* response) OVERRIDE; |
| 102 | 105 |
| 103 // Session::EventHandler interface. | 106 // Session::EventHandler interface. |
| 104 virtual void OnSessionStateChange(Session::State state) OVERRIDE; | 107 virtual void OnSessionStateChange(Session::State state) OVERRIDE; |
| 105 virtual void OnSessionRouteChange(const std::string& channel_name, | 108 virtual void OnSessionRouteChange(const std::string& channel_name, |
| 106 const TransportRoute& route) OVERRIDE; | 109 const TransportRoute& route) OVERRIDE; |
| 110 virtual void OnSessionInactive(const std::string& channel_name, | |
| 111 bool inactive) OVERRIDE; | |
| 107 | 112 |
| 108 // Return the current state of ConnectionToHost. | 113 // Return the current state of ConnectionToHost. |
| 109 State state() const; | 114 State state() const; |
| 110 | 115 |
| 111 private: | 116 private: |
| 112 // Callbacks for channel initialization | 117 // Callbacks for channel initialization |
| 113 void OnChannelInitialized(bool successful); | 118 void OnChannelInitialized(bool successful); |
| 114 | 119 |
| 115 void NotifyIfChannelsReady(); | 120 void NotifyIfChannelsReady(); |
| 116 | 121 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 ErrorCode error_; | 156 ErrorCode error_; |
| 152 | 157 |
| 153 private: | 158 private: |
| 154 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); | 159 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); |
| 155 }; | 160 }; |
| 156 | 161 |
| 157 } // namespace protocol | 162 } // namespace protocol |
| 158 } // namespace remoting | 163 } // namespace remoting |
| 159 | 164 |
| 160 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 165 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| OLD | NEW |