| 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 #include "remoting/client/chromoting_client.h" | 5 #include "remoting/client/chromoting_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "remoting/client/audio_player.h" | 8 #include "remoting/client/audio_player.h" |
| 9 #include "remoting/client/client_context.h" | 9 #include "remoting/client/client_context.h" |
| 10 #include "remoting/client/client_user_interface.h" | 10 #include "remoting/client/client_user_interface.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void ChromotingClient::OnConnectionState( | 177 void ChromotingClient::OnConnectionState( |
| 178 protocol::ConnectionToHost::State state, | 178 protocol::ConnectionToHost::State state, |
| 179 protocol::ErrorCode error) { | 179 protocol::ErrorCode error) { |
| 180 DCHECK(task_runner_->BelongsToCurrentThread()); | 180 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 181 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")"; | 181 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")"; |
| 182 if (state == protocol::ConnectionToHost::CONNECTED) | 182 if (state == protocol::ConnectionToHost::CONNECTED) |
| 183 Initialize(); | 183 Initialize(); |
| 184 user_interface_->OnConnectionState(state, error); | 184 user_interface_->OnConnectionState(state, error); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ChromotingClient::OnConnectionReady(bool ready) { |
| 188 VLOG(1) << "ChromotingClient::OnConnectionReady(" << ready << ")"; |
| 189 user_interface_->OnConnectionReady(ready); |
| 190 } |
| 191 |
| 187 void ChromotingClient::OnPacketDone(bool last_packet, | 192 void ChromotingClient::OnPacketDone(bool last_packet, |
| 188 base::Time decode_start) { | 193 base::Time decode_start) { |
| 189 if (!task_runner_->BelongsToCurrentThread()) { | 194 if (!task_runner_->BelongsToCurrentThread()) { |
| 190 task_runner_->PostTask(FROM_HERE, base::Bind( | 195 task_runner_->PostTask(FROM_HERE, base::Bind( |
| 191 &ChromotingClient::OnPacketDone, base::Unretained(this), | 196 &ChromotingClient::OnPacketDone, base::Unretained(this), |
| 192 last_packet, decode_start)); | 197 last_packet, decode_start)); |
| 193 return; | 198 return; |
| 194 } | 199 } |
| 195 | 200 |
| 196 // Record the latency between the final packet being received and | 201 // Record the latency between the final packet being received and |
| (...skipping 13 matching lines...) Expand all Loading... |
| 210 } | 215 } |
| 211 | 216 |
| 212 void ChromotingClient::Initialize() { | 217 void ChromotingClient::Initialize() { |
| 213 DCHECK(task_runner_->BelongsToCurrentThread()); | 218 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 214 | 219 |
| 215 // Initialize the decoder. | 220 // Initialize the decoder. |
| 216 rectangle_decoder_->Initialize(connection_->config()); | 221 rectangle_decoder_->Initialize(connection_->config()); |
| 217 } | 222 } |
| 218 | 223 |
| 219 } // namespace remoting | 224 } // namespace remoting |
| OLD | NEW |