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/base/capabilities.h" | 8 #include "remoting/base/capabilities.h" |
9 #include "remoting/client/audio_decode_scheduler.h" | 9 #include "remoting/client/audio_decode_scheduler.h" |
10 #include "remoting/client/audio_player.h" | 10 #include "remoting/client/audio_player.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 scoped_ptr<protocol::Authenticator> authenticator( | 61 scoped_ptr<protocol::Authenticator> authenticator( |
62 new protocol::NegotiatingClientAuthenticator( | 62 new protocol::NegotiatingClientAuthenticator( |
63 client_id, shared_secret, | 63 client_id, shared_secret, |
64 config_.authentication_tag, config_.fetch_secret_callback, | 64 config_.authentication_tag, config_.fetch_secret_callback, |
65 user_interface_->GetTokenFetcher(config_.host_public_key), | 65 user_interface_->GetTokenFetcher(config_.host_public_key), |
66 config_.authentication_methods)); | 66 config_.authentication_methods)); |
67 | 67 |
68 // Create a WeakPtr to ourself for to use for all posted tasks. | 68 // Create a WeakPtr to ourself for to use for all posted tasks. |
69 weak_ptr_ = weak_factory_.GetWeakPtr(); | 69 weak_ptr_ = weak_factory_.GetWeakPtr(); |
70 | 70 |
71 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, | 71 connection_->Connect(xmpp_proxy, |
72 config_.host_public_key, transport_factory.Pass(), | 72 config_.local_jid, |
73 authenticator.Pass(), this, this, this, | 73 config_.host_jid, |
74 rectangle_decoder_, | 74 config_.host_public_key, |
| 75 transport_factory.Pass(), |
| 76 authenticator.Pass(), |
| 77 this, |
| 78 this, |
| 79 this, |
| 80 rectangle_decoder_.get(), |
75 audio_decode_scheduler_.get()); | 81 audio_decode_scheduler_.get()); |
76 } | 82 } |
77 | 83 |
78 void ChromotingClient::Stop(const base::Closure& shutdown_task) { | 84 void ChromotingClient::Stop(const base::Closure& shutdown_task) { |
79 DCHECK(task_runner_->BelongsToCurrentThread()); | 85 DCHECK(task_runner_->BelongsToCurrentThread()); |
80 | 86 |
81 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected, | 87 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected, |
82 weak_ptr_, shutdown_task)); | 88 weak_ptr_, shutdown_task)); |
83 } | 89 } |
84 | 90 |
85 FrameProducer* ChromotingClient::GetFrameProducer() { | 91 FrameProducer* ChromotingClient::GetFrameProducer() { |
86 return rectangle_decoder_; | 92 return rectangle_decoder_.get(); |
87 } | 93 } |
88 | 94 |
89 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) { | 95 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) { |
90 shutdown_task.Run(); | 96 shutdown_task.Run(); |
91 } | 97 } |
92 | 98 |
93 ChromotingStats* ChromotingClient::GetStats() { | 99 ChromotingStats* ChromotingClient::GetStats() { |
94 DCHECK(task_runner_->BelongsToCurrentThread()); | 100 DCHECK(task_runner_->BelongsToCurrentThread()); |
95 return rectangle_decoder_->GetStats(); | 101 return rectangle_decoder_->GetStats(); |
96 } | 102 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 if (connection_->config().SupportsCapabilities()) { | 181 if (connection_->config().SupportsCapabilities()) { |
176 VLOG(1) << "Client capabilities: " << config_.capabilities; | 182 VLOG(1) << "Client capabilities: " << config_.capabilities; |
177 | 183 |
178 protocol::Capabilities capabilities; | 184 protocol::Capabilities capabilities; |
179 capabilities.set_capabilities(config_.capabilities); | 185 capabilities.set_capabilities(config_.capabilities); |
180 connection_->host_stub()->SetCapabilities(capabilities); | 186 connection_->host_stub()->SetCapabilities(capabilities); |
181 } | 187 } |
182 } | 188 } |
183 | 189 |
184 } // namespace remoting | 190 } // namespace remoting |
OLD | NEW |