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_decode_scheduler.h" | 8 #include "remoting/client/audio_decode_scheduler.h" |
9 #include "remoting/client/audio_player.h" | 9 #include "remoting/client/audio_player.h" |
10 #include "remoting/client/client_context.h" | 10 #include "remoting/client/client_context.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, | 60 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, |
61 config_.host_public_key, transport_factory.Pass(), | 61 config_.host_public_key, transport_factory.Pass(), |
62 authenticator.Pass(), this, this, this, | 62 authenticator.Pass(), this, this, this, |
63 rectangle_decoder_, | 63 rectangle_decoder_, |
64 audio_decode_scheduler_.get()); | 64 audio_decode_scheduler_.get()); |
65 } | 65 } |
66 | 66 |
67 void ChromotingClient::Stop(const base::Closure& shutdown_task) { | 67 void ChromotingClient::Stop(const base::Closure& shutdown_task) { |
68 DCHECK(task_runner_->BelongsToCurrentThread()); | 68 DCHECK(task_runner_->BelongsToCurrentThread()); |
69 | 69 |
70 // Drop all pending packets. | |
71 rectangle_decoder_->DropAllPackets(); | |
72 | |
73 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected, | 70 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected, |
74 weak_ptr_, shutdown_task)); | 71 weak_ptr_, shutdown_task)); |
75 } | 72 } |
76 | 73 |
77 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) { | 74 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) { |
78 shutdown_task.Run(); | 75 shutdown_task.Run(); |
79 } | 76 } |
80 | 77 |
81 ChromotingStats* ChromotingClient::GetStats() { | 78 ChromotingStats* ChromotingClient::GetStats() { |
82 DCHECK(task_runner_->BelongsToCurrentThread()); | 79 DCHECK(task_runner_->BelongsToCurrentThread()); |
(...skipping 29 matching lines...) Expand all Loading... |
112 void ChromotingClient::Initialize() { | 109 void ChromotingClient::Initialize() { |
113 DCHECK(task_runner_->BelongsToCurrentThread()); | 110 DCHECK(task_runner_->BelongsToCurrentThread()); |
114 | 111 |
115 // Initialize the decoder. | 112 // Initialize the decoder. |
116 rectangle_decoder_->Initialize(connection_->config()); | 113 rectangle_decoder_->Initialize(connection_->config()); |
117 if (connection_->config().is_audio_enabled()) | 114 if (connection_->config().is_audio_enabled()) |
118 audio_decode_scheduler_->Initialize(connection_->config()); | 115 audio_decode_scheduler_->Initialize(connection_->config()); |
119 } | 116 } |
120 | 117 |
121 } // namespace remoting | 118 } // namespace remoting |
OLD | NEW |