Index: mojo/application/public/cpp/lib/application_impl.cc |
diff --git a/mojo/application/public/cpp/lib/application_impl.cc b/mojo/application/public/cpp/lib/application_impl.cc |
index 82fa7d88effffd3afa0ff96d7fa764771c3ed6af..b1f62249e16d1dbe035f8a7f22ca5becf2fb4a25 100644 |
--- a/mojo/application/public/cpp/lib/application_impl.cc |
+++ b/mojo/application/public/cpp/lib/application_impl.cc |
@@ -2,13 +2,13 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "mojo/application/public/cpp/application_impl.h" |
- |
#include <algorithm> |
+#include <utility> |
#include "base/bind.h" |
#include "base/message_loop/message_loop.h" |
#include "mojo/application/public/cpp/application_delegate.h" |
+#include "mojo/application/public/cpp/application_impl.h" |
#include "mojo/application/public/cpp/lib/service_registry.h" |
#include "mojo/converters/network/network_type_converters.h" |
#include "mojo/public/cpp/bindings/interface_ptr.h" |
@@ -29,22 +29,22 @@ void DefaultTerminationClosure() { |
ApplicationImpl::ConnectParams::ConnectParams(const std::string& url) |
: ConnectParams(URLRequest::From(url)) {} |
ApplicationImpl::ConnectParams::ConnectParams(URLRequestPtr request) |
- : request_(request.Pass()), filter_(CapabilityFilter::New()) { |
+ : request_(std::move(request)), filter_(CapabilityFilter::New()) { |
filter_->filter.mark_non_null(); |
} |
ApplicationImpl::ConnectParams::~ConnectParams() {} |
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, |
InterfaceRequest<Application> request) |
- : ApplicationImpl(delegate, request.Pass(), |
- base::Bind(&DefaultTerminationClosure)) { |
-} |
+ : ApplicationImpl(delegate, |
+ std::move(request), |
+ base::Bind(&DefaultTerminationClosure)) {} |
ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, |
InterfaceRequest<Application> request, |
const Closure& termination_closure) |
: delegate_(delegate), |
- binding_(this, request.Pass()), |
+ binding_(this, std::move(request)), |
termination_closure_(termination_closure), |
app_lifetime_helper_(this), |
quit_requested_(false), |
@@ -80,15 +80,15 @@ scoped_ptr<ApplicationConnection> |
InterfaceRequest<ServiceProvider> remote_services_proxy = |
GetProxy(&remote_services); |
scoped_ptr<internal::ServiceRegistry> registry(new internal::ServiceRegistry( |
- application_url, application_url, remote_services.Pass(), |
- local_request.Pass(), allowed)); |
- shell_->ConnectToApplication(request.Pass(), remote_services_proxy.Pass(), |
- local_services.Pass(), |
- params->TakeFilter().Pass(), |
+ application_url, application_url, std::move(remote_services), |
+ std::move(local_request), allowed)); |
+ shell_->ConnectToApplication(std::move(request), |
+ std::move(remote_services_proxy), |
+ std::move(local_services), params->TakeFilter(), |
registry->GetConnectToApplicationCallback()); |
if (!delegate_->ConfigureOutgoingConnection(registry.get())) |
return nullptr; |
- return registry.Pass(); |
+ return std::move(registry); |
} |
void ApplicationImpl::WaitForInitialize() { |
@@ -108,7 +108,7 @@ void ApplicationImpl::Quit() { |
} |
void ApplicationImpl::Initialize(ShellPtr shell, const mojo::String& url) { |
- shell_ = shell.Pass(); |
+ shell_ = std::move(shell); |
shell_.set_connection_error_handler([this]() { OnConnectionError(); }); |
url_ = url; |
delegate_->Initialize(this); |
@@ -121,7 +121,7 @@ void ApplicationImpl::AcceptConnection( |
Array<String> allowed_interfaces, |
const String& url) { |
scoped_ptr<ApplicationConnection> registry(new internal::ServiceRegistry( |
- url, requestor_url, exposed_services.Pass(), services.Pass(), |
+ url, requestor_url, std::move(exposed_services), std::move(services), |
allowed_interfaces.To<std::set<std::string>>())); |
if (!delegate_->ConfigureIncomingConnection(registry.get())) |
return; |
@@ -131,7 +131,7 @@ void ApplicationImpl::AcceptConnection( |
if (quit_requested_) |
quit_requested_ = false; |
- incoming_connections_.push_back(registry.Pass()); |
+ incoming_connections_.push_back(std::move(registry)); |
} |
void ApplicationImpl::OnQuitRequested(const Callback<void(bool)>& callback) { |
@@ -174,8 +174,8 @@ CapabilityFilterPtr CreatePermissiveCapabilityFilter() { |
CapabilityFilterPtr filter(CapabilityFilter::New()); |
Array<String> all_interfaces; |
all_interfaces.push_back("*"); |
- filter->filter.insert("*", all_interfaces.Pass()); |
- return filter.Pass(); |
+ filter->filter.insert("*", std::move(all_interfaces)); |
+ return filter; |
} |
} // namespace mojo |