OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 State state() const; | 110 State state() const; |
111 | 111 |
112 private: | 112 private: |
113 // Called on the jingle thread after we've successfully to XMPP server. Starts | 113 // Called on the jingle thread after we've successfully to XMPP server. Starts |
114 // P2P connection to the host. | 114 // P2P connection to the host. |
115 void InitSession(); | 115 void InitSession(); |
116 | 116 |
117 // Callback for |session_|. | 117 // Callback for |session_|. |
118 void OnSessionStateChange(Session::State state); | 118 void OnSessionStateChange(Session::State state); |
119 | 119 |
120 // Callback for VideoReader::Init(). | 120 // Callbacks for channel initialization |
| 121 void OnControlChannelInitialized(bool successful); |
| 122 void OnEventChannelInitialized(bool successful); |
121 void OnVideoChannelInitialized(bool successful); | 123 void OnVideoChannelInitialized(bool successful); |
122 | 124 |
123 void NotifyIfChannelsReady(); | 125 void NotifyIfChannelsReady(); |
124 | 126 |
125 // Callback for |video_reader_|. | 127 // Callback for |video_reader_|. |
126 void OnVideoPacket(VideoPacket* packet); | 128 void OnVideoPacket(VideoPacket* packet); |
127 | 129 |
128 void CloseOnError(Error error); | 130 void CloseOnError(Error error); |
129 | 131 |
130 // Stops writing in the channels. | 132 // Stops writing in the channels. |
(...skipping 15 matching lines...) Expand all Loading... |
146 ClientStub* client_stub_; | 148 ClientStub* client_stub_; |
147 VideoStub* video_stub_; | 149 VideoStub* video_stub_; |
148 | 150 |
149 scoped_ptr<SignalStrategy> signal_strategy_; | 151 scoped_ptr<SignalStrategy> signal_strategy_; |
150 std::string local_jid_; | 152 std::string local_jid_; |
151 scoped_ptr<SessionManager> session_manager_; | 153 scoped_ptr<SessionManager> session_manager_; |
152 scoped_ptr<Session> session_; | 154 scoped_ptr<Session> session_; |
153 | 155 |
154 scoped_ptr<VideoReader> video_reader_; | 156 scoped_ptr<VideoReader> video_reader_; |
155 scoped_ptr<ClientControlDispatcher> control_dispatcher_; | 157 scoped_ptr<ClientControlDispatcher> control_dispatcher_; |
156 scoped_ptr<ClientEventDispatcher> input_dispatcher_; | 158 scoped_ptr<ClientEventDispatcher> event_dispatcher_; |
157 | 159 |
158 // Internal state of the connection. | 160 // Internal state of the connection. |
159 State state_; | 161 State state_; |
160 Error error_; | 162 Error error_; |
161 | 163 |
162 // State of the channels. | 164 // State of the channels. |
163 bool control_connected_; | 165 bool control_channel_connected_; |
164 bool input_connected_; | 166 bool event_channel_connected_; |
165 bool video_connected_; | 167 bool video_channel_connected_; |
166 | 168 |
167 private: | 169 private: |
168 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); | 170 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); |
169 }; | 171 }; |
170 | 172 |
171 } // namespace protocol | 173 } // namespace protocol |
172 } // namespace remoting | 174 } // namespace remoting |
173 | 175 |
174 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 176 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
OLD | NEW |