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

Unified Diff: remoting/host/it2me/it2me_host.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/it2me/it2me_host.cc
diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_host.cc
index 70dcfb28e6534f37c6e7620c1d7fb881de2cf947..17877370f0a50b8f3cc8c35c83a8c930e11eace4 100644
--- a/remoting/host/it2me/it2me_host.cc
+++ b/remoting/host/it2me/it2me_host.cc
@@ -48,15 +48,15 @@ It2MeHost::It2MeHost(
base::WeakPtr<It2MeHost::Observer> observer,
const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
const std::string& directory_bot_jid)
- : host_context_(host_context.Pass()),
+ : host_context_(std::move(host_context)),
task_runner_(host_context_->ui_task_runner()),
observer_(observer),
xmpp_server_config_(xmpp_server_config),
directory_bot_jid_(directory_bot_jid),
state_(kDisconnected),
failed_login_attempts_(0),
- policy_watcher_(policy_watcher.Pass()),
- confirmation_dialog_factory_(confirmation_dialog_factory.Pass()),
+ policy_watcher_(std::move(policy_watcher)),
+ confirmation_dialog_factory_(std::move(confirmation_dialog_factory)),
nat_traversal_enabled_(false),
policy_received_(false) {
DCHECK(task_runner_->BelongsToCurrentThread());
@@ -143,7 +143,7 @@ void It2MeHost::ShowConfirmationPrompt() {
confirmation_dialog_proxy_.reset(
new It2MeConfirmationDialogProxy(host_context_->ui_task_runner(),
- confirmation_dialog.Pass()));
+ std::move(confirmation_dialog)));
confirmation_dialog_proxy_->Show(
base::Bind(&It2MeHost::OnConfirmationResult, base::Unretained(this)));
@@ -215,8 +215,8 @@ void It2MeHost::FinishConnect() {
base::Unretained(this))));
// Beyond this point nothing can fail, so save the config and request.
- signal_strategy_ = signal_strategy.Pass();
- register_request_ = register_request.Pass();
+ signal_strategy_ = std::move(signal_strategy);
+ register_request_ = std::move(register_request);
// If NAT traversal is off then limit port range to allow firewall pin-holing.
HOST_LOG << "NAT state: " << nat_traversal_enabled_;
@@ -239,7 +239,7 @@ void It2MeHost::FinishConnect() {
network_settings, protocol::TransportRole::SERVER)));
scoped_ptr<protocol::SessionManager> session_manager(
- new protocol::JingleSessionManager(transport_factory.Pass(),
+ new protocol::JingleSessionManager(std::move(transport_factory),
signal_strategy.get()));
scoped_ptr<protocol::CandidateSessionConfig> protocol_config =
@@ -247,13 +247,12 @@ void It2MeHost::FinishConnect() {
// Disable audio by default.
// TODO(sergeyu): Add UI to enable it.
protocol_config->DisableAudioChannel();
- session_manager->set_protocol_config(protocol_config.Pass());
+ session_manager->set_protocol_config(std::move(protocol_config));
// Create the host.
host_.reset(new ChromotingHost(
- desktop_environment_factory_.get(),
- session_manager.Pass(), host_context_->audio_task_runner(),
- host_context_->input_task_runner(),
+ desktop_environment_factory_.get(), std::move(session_manager),
+ host_context_->audio_task_runner(), host_context_->input_task_runner(),
host_context_->video_capture_task_runner(),
host_context_->video_encode_task_runner(),
host_context_->network_task_runner(), host_context_->ui_task_runner()));
@@ -457,7 +456,7 @@ void It2MeHost::OnReceivedSupportID(
scoped_ptr<protocol::AuthenticatorFactory> factory(
new protocol::It2MeHostAuthenticatorFactory(
local_certificate, host_key_pair_, access_code));
- host_->SetAuthenticatorFactory(factory.Pass());
+ host_->SetAuthenticatorFactory(std::move(factory));
// Pass the Access Code to the script object before changing state.
task_runner_->PostTask(
@@ -490,9 +489,9 @@ scoped_refptr<It2MeHost> It2MeHostFactory::CreateIt2MeHost(
new It2MeConfirmationDialogFactory());
scoped_ptr<PolicyWatcher> policy_watcher =
PolicyWatcher::Create(policy_service_, context->file_task_runner());
- return new It2MeHost(context.Pass(), policy_watcher.Pass(),
- confirmation_dialog_factory.Pass(),
- observer, xmpp_server_config, directory_bot_jid);
+ return new It2MeHost(std::move(context), std::move(policy_watcher),
+ std::move(confirmation_dialog_factory), observer,
+ xmpp_server_config, directory_bot_jid);
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698