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 #include "remoting/host/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "remoting/base/constants.h" | 8 #include "remoting/base/constants.h" |
9 #include "remoting/base/encoder.h" | 9 #include "remoting/base/encoder.h" |
10 #include "remoting/base/encoder_row_based.h" | 10 #include "remoting/base/encoder_row_based.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 void ChromotingHost::OnConnectionFailed(ConnectionToClient* connection) { | 236 void ChromotingHost::OnConnectionFailed(ConnectionToClient* connection) { |
237 DCHECK_EQ(context_->network_message_loop(), MessageLoop::current()); | 237 DCHECK_EQ(context_->network_message_loop(), MessageLoop::current()); |
238 | 238 |
239 LOG(ERROR) << "Connection failed unexpectedly."; | 239 LOG(ERROR) << "Connection failed unexpectedly."; |
240 context_->main_message_loop()->PostTask( | 240 context_->main_message_loop()->PostTask( |
241 FROM_HERE, | 241 FROM_HERE, |
242 NewRunnableMethod(this, &ChromotingHost::OnClientDisconnected, | 242 NewRunnableMethod(this, &ChromotingHost::OnClientDisconnected, |
243 make_scoped_refptr(connection))); | 243 make_scoped_refptr(connection))); |
244 } | 244 } |
245 | 245 |
| 246 void ChromotingHost::OnSequenceNumberUpdated(ConnectionToClient* connection, |
| 247 int64 sequence_number) { |
| 248 // Update the sequence number in ScreenRecorder. |
| 249 if (MessageLoop::current() != context_->main_message_loop()) { |
| 250 context_->main_message_loop()->PostTask( |
| 251 FROM_HERE, |
| 252 NewRunnableMethod(this, &ChromotingHost::OnSequenceNumberUpdated, |
| 253 make_scoped_refptr(connection), sequence_number)); |
| 254 return; |
| 255 } |
| 256 |
| 257 if (recorder_.get()) |
| 258 recorder_->UpdateSequenceNumber(sequence_number); |
| 259 } |
| 260 |
246 //////////////////////////////////////////////////////////////////////////// | 261 //////////////////////////////////////////////////////////////////////////// |
247 // JingleClient::Callback implementations | 262 // JingleClient::Callback implementations |
248 void ChromotingHost::OnStateChange(JingleClient* jingle_client, | 263 void ChromotingHost::OnStateChange(JingleClient* jingle_client, |
249 JingleClient::State state) { | 264 JingleClient::State state) { |
250 if (state == JingleClient::CONNECTED) { | 265 if (state == JingleClient::CONNECTED) { |
251 DCHECK_EQ(jingle_client_.get(), jingle_client); | 266 DCHECK_EQ(jingle_client_.get(), jingle_client); |
252 VLOG(1) << "Host connected as " << jingle_client->GetFullJid(); | 267 VLOG(1) << "Host connected as " << jingle_client->GetFullJid(); |
253 | 268 |
254 // Create and start session manager. | 269 // Create and start session manager. |
255 protocol::JingleSessionManager* server = | 270 protocol::JingleSessionManager* server = |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 return; | 471 return; |
457 } | 472 } |
458 | 473 |
459 protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); | 474 protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); |
460 status->set_success(false); | 475 status->set_success(false); |
461 connection->client_stub()->BeginSessionResponse( | 476 connection->client_stub()->BeginSessionResponse( |
462 status, new DeleteTask<protocol::LocalLoginStatus>(status)); | 477 status, new DeleteTask<protocol::LocalLoginStatus>(status)); |
463 } | 478 } |
464 | 479 |
465 } // namespace remoting | 480 } // namespace remoting |
OLD | NEW |