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

Unified Diff: mojo/edk/system/data_pipe.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/data_pipe.h ('k') | mojo/edk/system/local_data_pipe_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/data_pipe.cc
diff --git a/mojo/edk/system/data_pipe.cc b/mojo/edk/system/data_pipe.cc
index 9782b7163492c3c52dac5f0bc12f735d67b25e2c..ef87058c45c6f06a3fc2b397685b81310c046a54 100644
--- a/mojo/edk/system/data_pipe.cc
+++ b/mojo/edk/system/data_pipe.cc
@@ -8,6 +8,8 @@
#include <algorithm>
#include <limits>
+#include <memory>
+#include <utility>
#include "base/logging.h"
#include "base/memory/aligned_memory.h"
@@ -102,7 +104,7 @@ DataPipe* DataPipe::CreateRemoteProducerFromExisting(
const MojoCreateDataPipeOptions& validated_options,
MessageInTransitQueue* message_queue,
ChannelEndpoint* channel_endpoint) {
- scoped_ptr<char, base::AlignedFreeDeleter> buffer;
+ std::unique_ptr<char, base::AlignedFreeDeleter> buffer;
size_t buffer_num_bytes = 0;
if (!RemoteProducerDataPipeImpl::ProcessMessagesFromIncomingEndpoint(
validated_options, message_queue, &buffer, &buffer_num_bytes))
@@ -115,10 +117,10 @@ DataPipe* DataPipe::CreateRemoteProducerFromExisting(
// ongoing call to |IncomingEndpoint::OnReadMessage()| return false. This will
// make |ChannelEndpoint::OnReadMessage()| retry, until its |ReplaceClient()|
// is called.
- DataPipe* data_pipe =
- new DataPipe(false, true, validated_options,
- make_scoped_ptr(new RemoteProducerDataPipeImpl(
- channel_endpoint, buffer.Pass(), 0, buffer_num_bytes)));
+ DataPipe* data_pipe = new DataPipe(
+ false, true, validated_options,
+ make_scoped_ptr(new RemoteProducerDataPipeImpl(
+ channel_endpoint, std::move(buffer), 0, buffer_num_bytes)));
if (channel_endpoint) {
if (!channel_endpoint->ReplaceClient(data_pipe, 0))
data_pipe->OnDetachFromChannel(0);
« no previous file with comments | « mojo/edk/system/data_pipe.h ('k') | mojo/edk/system/local_data_pipe_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698