| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual void OnStateChange(JingleClient* client, JingleClient::State state); | 78 virtual void OnStateChange(JingleClient* client, JingleClient::State state); |
| 79 | 79 |
| 80 // Callback for chromotocol SessionManager. | 80 // Callback for chromotocol SessionManager. |
| 81 void OnNewSession( | 81 void OnNewSession( |
| 82 Session* connection, | 82 Session* connection, |
| 83 SessionManager::IncomingSessionResponse* response); | 83 SessionManager::IncomingSessionResponse* response); |
| 84 | 84 |
| 85 // Callback for chromotocol Session. | 85 // Callback for chromotocol Session. |
| 86 void OnSessionStateChange(Session::State state); | 86 void OnSessionStateChange(Session::State state); |
| 87 | 87 |
| 88 // Called when the host accepts the client authentication. |
| 89 void OnClientAuthenticated(); |
| 90 |
| 88 private: | 91 private: |
| 89 // The message loop for the jingle thread this object works on. | 92 // The message loop for the jingle thread this object works on. |
| 90 MessageLoop* message_loop(); | 93 MessageLoop* message_loop(); |
| 91 | 94 |
| 92 // Called on the jingle thread after we've successfully to XMPP server. Starts | 95 // Called on the jingle thread after we've successfully to XMPP server. Starts |
| 93 // P2P connection to the host. | 96 // P2P connection to the host. |
| 94 void InitSession(); | 97 void InitSession(); |
| 95 | 98 |
| 96 // Callback for |video_reader_|. | 99 // Callback for |video_reader_|. |
| 97 void OnVideoPacket(VideoPacket* packet); | 100 void OnVideoPacket(VideoPacket* packet); |
| 98 | 101 |
| 99 // Used by Disconnect() to disconnect chromoting connection, stop chromoting | 102 // Used by Disconnect() to disconnect chromoting connection, stop chromoting |
| 100 // server, and then disconnect XMPP connection. | 103 // server, and then disconnect XMPP connection. |
| 101 void OnDisconnected(); | 104 void OnDisconnected(); |
| 102 void OnServerClosed(); | 105 void OnServerClosed(); |
| 103 | 106 |
| 107 // Initially false, this is set to true once the client has authenticated |
| 108 // properly. When this is false, many messages to the host (like input events) |
| 109 // will be suppressed. |
| 110 bool client_authenticated_; |
| 111 |
| 104 JingleThread* thread_; | 112 JingleThread* thread_; |
| 105 | 113 |
| 106 scoped_ptr<talk_base::NetworkManager> network_manager_; | 114 scoped_ptr<talk_base::NetworkManager> network_manager_; |
| 107 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; | 115 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; |
| 108 | 116 |
| 109 scoped_ptr<SignalStrategy> signal_strategy_; | 117 scoped_ptr<SignalStrategy> signal_strategy_; |
| 110 scoped_refptr<JingleClient> jingle_client_; | 118 scoped_refptr<JingleClient> jingle_client_; |
| 111 scoped_refptr<SessionManager> session_manager_; | 119 scoped_refptr<SessionManager> session_manager_; |
| 112 scoped_refptr<Session> session_; | 120 scoped_refptr<Session> session_; |
| 113 | 121 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 143 private: | 151 private: |
| 144 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); | 152 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); |
| 145 }; | 153 }; |
| 146 | 154 |
| 147 } // namespace protocol | 155 } // namespace protocol |
| 148 } // namespace remoting | 156 } // namespace remoting |
| 149 | 157 |
| 150 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::protocol::ConnectionToHost); | 158 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::protocol::ConnectionToHost); |
| 151 | 159 |
| 152 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 160 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| OLD | NEW |