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

Unified Diff: mojo/services/network/http_server_impl.cc

Issue 1539863002: Convert Pass()→std::move() in mojo/services/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing forward declare that was masked by pre-existing incorrect #include ordering. 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
« no previous file with comments | « mojo/services/network/http_server_apptest.cc ('k') | mojo/services/network/net_adapters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/http_server_impl.cc
diff --git a/mojo/services/network/http_server_impl.cc b/mojo/services/network/http_server_impl.cc
index ada77f396cd987dd1bcdb6a404ab9c270fc7c854..cc1422164e3f94ba51b760f5cfbd5ab09356fcf5 100644
--- a/mojo/services/network/http_server_impl.cc
+++ b/mojo/services/network/http_server_impl.cc
@@ -4,6 +4,8 @@
#include "mojo/services/network/http_server_impl.h"
+#include <utility>
+
#include "base/logging.h"
#include "mojo/services/network/http_connection_impl.h"
#include "mojo/services/network/net_adapters.h"
@@ -27,10 +29,10 @@ void HttpServerImpl::Create(
HttpServerDelegatePtr delegate,
scoped_ptr<mojo::AppRefCount> app_refcount,
const Callback<void(NetworkErrorPtr, NetAddressPtr)>& callback) {
- HttpServerImpl* http_server = new HttpServerImpl(
- delegate.Pass(), app_refcount.Pass());
+ HttpServerImpl* http_server =
+ new HttpServerImpl(std::move(delegate), std::move(app_refcount));
- int net_error = http_server->Start(local_address.Pass());
+ int net_error = http_server->Start(std::move(local_address));
if (net_error != net::OK) {
callback.Run(MakeNetworkError(net_error), nullptr);
delete http_server;
@@ -39,10 +41,9 @@ void HttpServerImpl::Create(
callback.Run(MakeNetworkError(net::OK), http_server->GetLocalAddress());
}
-HttpServerImpl::HttpServerImpl(
- HttpServerDelegatePtr delegate,
- scoped_ptr<mojo::AppRefCount> app_refcount)
- : delegate_(delegate.Pass()), app_refcount_(app_refcount.Pass()) {
+HttpServerImpl::HttpServerImpl(HttpServerDelegatePtr delegate,
+ scoped_ptr<mojo::AppRefCount> app_refcount)
+ : delegate_(std::move(delegate)), app_refcount_(std::move(app_refcount)) {
DCHECK(delegate_);
delegate_.set_connection_error_handler([this]() { delete this; });
}
@@ -59,7 +60,7 @@ int HttpServerImpl::Start(NetAddressPtr local_address) {
if (net_result != net::OK)
return net_result;
- server_.reset(new net::HttpServer(socket.Pass(), this));
+ server_.reset(new net::HttpServer(std::move(socket), this));
return net::OK;
}
@@ -83,13 +84,12 @@ void HttpServerImpl::OnConnect(int connection_id) {
HttpConnectionDelegatePtr connection_delegate;
InterfaceRequest<HttpConnectionDelegate> delegate_request =
GetProxy(&connection_delegate);
- linked_ptr<HttpConnectionImpl> connection_impl(
- new HttpConnectionImpl(connection_id, this, connection_delegate.Pass(),
- &connection));
+ linked_ptr<HttpConnectionImpl> connection_impl(new HttpConnectionImpl(
+ connection_id, this, std::move(connection_delegate), &connection));
connections_[connection_id] = connection_impl;
- delegate_->OnConnected(connection.Pass(), delegate_request.Pass());
+ delegate_->OnConnected(std::move(connection), std::move(delegate_request));
}
void HttpServerImpl::OnHttpRequest(int connection_id,
« no previous file with comments | « mojo/services/network/http_server_apptest.cc ('k') | mojo/services/network/net_adapters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698