| Index: remoting/host/it2me/it2me_host.cc
|
| diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_host.cc
|
| index 1fea411dd78035f772c3589fcb67ec9a4947a8af..426c06bc11829543a7d1d9814dd8eb9a259bd449 100644
|
| --- a/remoting/host/it2me/it2me_host.cc
|
| +++ b/remoting/host/it2me/it2me_host.cc
|
| @@ -6,6 +6,8 @@
|
|
|
| #include <stddef.h>
|
|
|
| +#include <utility>
|
| +
|
| #include "base/bind.h"
|
| #include "base/callback_helpers.h"
|
| #include "base/strings/string_util.h"
|
| @@ -50,15 +52,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());
|
| @@ -145,7 +147,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)));
|
| @@ -217,8 +219,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_;
|
| @@ -241,7 +243,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 =
|
| @@ -249,13 +251,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()));
|
| @@ -459,7 +460,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(
|
| @@ -492,9 +493,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
|
|
|