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

Unified Diff: mojo/edk/system/remote_producer_data_pipe_impl.cc

Issue 1350503004: Some easy conversions of scoped_ptr -> std::unique_ptr in the EDK. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 months 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/edk/system/remote_producer_data_pipe_impl.h ('k') | mojo/edk/system/transport_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/remote_producer_data_pipe_impl.cc
diff --git a/mojo/edk/system/remote_producer_data_pipe_impl.cc b/mojo/edk/system/remote_producer_data_pipe_impl.cc
index 7529779247c0ac074a1bbce2e47429b6e8c752e3..252e2377819d70563da016f9eb77a2e5e9118932 100644
--- a/mojo/edk/system/remote_producer_data_pipe_impl.cc
+++ b/mojo/edk/system/remote_producer_data_pipe_impl.cc
@@ -7,6 +7,7 @@
#include <string.h>
#include <algorithm>
+#include <utility>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -68,11 +69,11 @@ RemoteProducerDataPipeImpl::RemoteProducerDataPipeImpl(
RemoteProducerDataPipeImpl::RemoteProducerDataPipeImpl(
ChannelEndpoint* channel_endpoint,
- scoped_ptr<char, base::AlignedFreeDeleter> buffer,
+ std::unique_ptr<char, base::AlignedFreeDeleter> buffer,
size_t start_index,
size_t current_num_bytes)
: channel_endpoint_(channel_endpoint),
- buffer_(buffer.Pass()),
+ buffer_(std::move(buffer)),
start_index_(start_index),
current_num_bytes_(current_num_bytes) {
DCHECK(buffer_ || !current_num_bytes);
@@ -82,14 +83,14 @@ RemoteProducerDataPipeImpl::RemoteProducerDataPipeImpl(
bool RemoteProducerDataPipeImpl::ProcessMessagesFromIncomingEndpoint(
const MojoCreateDataPipeOptions& validated_options,
MessageInTransitQueue* messages,
- scoped_ptr<char, base::AlignedFreeDeleter>* buffer,
+ std::unique_ptr<char, base::AlignedFreeDeleter>* buffer,
size_t* buffer_num_bytes) {
DCHECK(!*buffer); // Not wrong, but unlikely.
const size_t element_num_bytes = validated_options.element_num_bytes;
const size_t capacity_num_bytes = validated_options.capacity_num_bytes;
- scoped_ptr<char, base::AlignedFreeDeleter> new_buffer(static_cast<char*>(
+ std::unique_ptr<char, base::AlignedFreeDeleter> new_buffer(static_cast<char*>(
base::AlignedAlloc(capacity_num_bytes,
GetConfiguration().data_pipe_buffer_alignment_bytes)));
@@ -109,7 +110,7 @@ bool RemoteProducerDataPipeImpl::ProcessMessagesFromIncomingEndpoint(
}
}
- *buffer = new_buffer.Pass();
+ *buffer = std::move(new_buffer);
*buffer_num_bytes = current_num_bytes;
return true;
}
« no previous file with comments | « mojo/edk/system/remote_producer_data_pipe_impl.h ('k') | mojo/edk/system/transport_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698