Index: mojo/services/network/net_adapters.cc |
diff --git a/mojo/services/network/net_adapters.cc b/mojo/services/network/net_adapters.cc |
index 551481d38810370c9968a546fdf5492b2896ab27..8c2a877a997e9f750a84b4419cd6fdb6fc7c8d5d 100644 |
--- a/mojo/services/network/net_adapters.cc |
+++ b/mojo/services/network/net_adapters.cc |
@@ -4,6 +4,8 @@ |
#include "mojo/services/network/net_adapters.h" |
+#include <utility> |
+ |
#include "net/base/net_errors.h" |
namespace mojo { |
@@ -17,9 +19,7 @@ const uint32_t kMaxBufSize = 64 * 1024; |
NetToMojoPendingBuffer::NetToMojoPendingBuffer( |
ScopedDataPipeProducerHandle handle, |
void* buffer) |
- : handle_(handle.Pass()), |
- buffer_(buffer) { |
-} |
+ : handle_(std::move(handle)), buffer_(buffer) {} |
NetToMojoPendingBuffer::~NetToMojoPendingBuffer() { |
if (handle_.is_valid()) |
@@ -39,7 +39,7 @@ MojoResult NetToMojoPendingBuffer::BeginWrite( |
if (result == MOJO_RESULT_OK) { |
if (*num_bytes > kMaxBufSize) |
*num_bytes = kMaxBufSize; |
- *pending = new NetToMojoPendingBuffer(handle->Pass(), buf); |
+ *pending = new NetToMojoPendingBuffer(std::move(*handle), buf); |
} |
return result; |
} |
@@ -48,7 +48,7 @@ ScopedDataPipeProducerHandle NetToMojoPendingBuffer::Complete( |
uint32_t num_bytes) { |
EndWriteDataRaw(handle_.get(), num_bytes); |
buffer_ = NULL; |
- return handle_.Pass(); |
+ return std::move(handle_); |
} |
// ----------------------------------------------------------------------------- |
@@ -67,9 +67,7 @@ NetToMojoIOBuffer::~NetToMojoIOBuffer() { |
MojoToNetPendingBuffer::MojoToNetPendingBuffer( |
ScopedDataPipeConsumerHandle handle, |
const void* buffer) |
- : handle_(handle.Pass()), |
- buffer_(buffer) { |
-} |
+ : handle_(std::move(handle)), buffer_(buffer) {} |
MojoToNetPendingBuffer::~MojoToNetPendingBuffer() { |
} |
@@ -84,7 +82,7 @@ MojoResult MojoToNetPendingBuffer::BeginRead( |
MojoResult result = BeginReadDataRaw(handle->get(), &buffer, num_bytes, |
MOJO_READ_DATA_FLAG_NONE); |
if (result == MOJO_RESULT_OK) |
- *pending = new MojoToNetPendingBuffer(handle->Pass(), buffer); |
+ *pending = new MojoToNetPendingBuffer(std::move(*handle), buffer); |
return result; |
} |
@@ -92,7 +90,7 @@ ScopedDataPipeConsumerHandle MojoToNetPendingBuffer::Complete( |
uint32_t num_bytes) { |
EndReadDataRaw(handle_.get(), num_bytes); |
buffer_ = NULL; |
- return handle_.Pass(); |
+ return std::move(handle_); |
} |
// ----------------------------------------------------------------------------- |
@@ -112,7 +110,7 @@ NetworkErrorPtr MakeNetworkError(int error_code) { |
error->code = error_code; |
if (error_code <= 0) |
error->description = net::ErrorToString(error_code); |
- return error.Pass(); |
+ return error; |
} |
} // namespace mojo |