Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: remoting/client/chromoting_client.cc

Issue 279273002: Move ConnectionToHost parameters out from Connect() call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 config_.client_pairing_id, 59 config_.client_pairing_id,
60 config_.client_paired_secret, 60 config_.client_paired_secret,
61 config_.authentication_tag, 61 config_.authentication_tag,
62 config_.fetch_secret_callback, 62 config_.fetch_secret_callback,
63 user_interface_->GetTokenFetcher(config_.host_public_key), 63 user_interface_->GetTokenFetcher(config_.host_public_key),
64 config_.authentication_methods)); 64 config_.authentication_methods));
65 65
66 // Create a WeakPtr to ourself for to use for all posted tasks. 66 // Create a WeakPtr to ourself for to use for all posted tasks.
67 weak_ptr_ = weak_factory_.GetWeakPtr(); 67 weak_ptr_ = weak_factory_.GetWeakPtr();
68 68
69 connection_->set_client_stub(this);
70 connection_->set_clipboard_stub(this);
71 connection_->set_video_stub(video_renderer_);
72 connection_->set_audio_stub(audio_decode_scheduler_.get());
73
69 connection_->Connect(signal_strategy, 74 connection_->Connect(signal_strategy,
75 transport_factory.Pass(),
76 authenticator.Pass(),
70 config_.host_jid, 77 config_.host_jid,
71 config_.host_public_key, 78 config_.host_public_key,
72 transport_factory.Pass(), 79 this);
73 authenticator.Pass(),
74 this,
75 this,
76 this,
77 video_renderer_,
78 audio_decode_scheduler_.get());
79 } 80 }
80 81
81 void ChromotingClient::SetCapabilities( 82 void ChromotingClient::SetCapabilities(
82 const protocol::Capabilities& capabilities) { 83 const protocol::Capabilities& capabilities) {
83 DCHECK(task_runner_->BelongsToCurrentThread()); 84 DCHECK(task_runner_->BelongsToCurrentThread());
84 85
85 // Only accept the first |protocol::Capabilities| message. 86 // Only accept the first |protocol::Capabilities| message.
86 if (host_capabilities_received_) { 87 if (host_capabilities_received_) {
87 LOG(WARNING) << "protocol::Capabilities has been received already."; 88 LOG(WARNING) << "protocol::Capabilities has been received already.";
88 return; 89 return;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (connection_->config().SupportsCapabilities()) { 180 if (connection_->config().SupportsCapabilities()) {
180 VLOG(1) << "Client capabilities: " << config_.capabilities; 181 VLOG(1) << "Client capabilities: " << config_.capabilities;
181 182
182 protocol::Capabilities capabilities; 183 protocol::Capabilities capabilities;
183 capabilities.set_capabilities(config_.capabilities); 184 capabilities.set_capabilities(config_.capabilities);
184 connection_->host_stub()->SetCapabilities(capabilities); 185 connection_->host_stub()->SetCapabilities(capabilities);
185 } 186 }
186 } 187 }
187 188
188 } // namespace remoting 189 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698