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

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

Issue 1353683005: EDK: Convert remaining scoped_ptr -> std::unique_ptr in //mojo/edk/system. (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_consumer_data_pipe_impl.cc ('k') | mojo/edk/system/slave_connection_manager.cc » ('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 252e2377819d70563da016f9eb77a2e5e9118932..847949f386c0109ccf90048bf3dbb204cc278ee1 100644
--- a/mojo/edk/system/remote_producer_data_pipe_impl.cc
+++ b/mojo/edk/system/remote_producer_data_pipe_impl.cc
@@ -7,10 +7,10 @@
#include <string.h>
#include <algorithm>
+#include <memory>
#include <utility>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "mojo/edk/system/channel.h"
#include "mojo/edk/system/channel_endpoint.h"
#include "mojo/edk/system/configuration.h"
@@ -97,7 +97,7 @@ bool RemoteProducerDataPipeImpl::ProcessMessagesFromIncomingEndpoint(
size_t current_num_bytes = 0;
if (messages) {
while (!messages->IsEmpty()) {
- scoped_ptr<MessageInTransit> message(messages->GetMessage());
+ std::unique_ptr<MessageInTransit> message(messages->GetMessage());
if (!ValidateIncomingMessage(element_num_bytes, capacity_num_bytes,
current_num_bytes, message.get())) {
messages->Clear();
@@ -361,7 +361,7 @@ bool RemoteProducerDataPipeImpl::OnReadMessage(unsigned /*port*/,
// Otherwise, we take ownership of the message. (This means that we should
// always return true below.)
- scoped_ptr<MessageInTransit> msg(message);
+ std::unique_ptr<MessageInTransit> msg(message);
if (!ValidateIncomingMessage(element_num_bytes(), capacity_num_bytes(),
current_num_bytes_, msg.get())) {
@@ -450,11 +450,11 @@ void RemoteProducerDataPipeImpl::MarkDataAsConsumed(size_t num_bytes) {
RemoteDataPipeAck ack_data = {};
ack_data.num_bytes_consumed = static_cast<uint32_t>(num_bytes);
- scoped_ptr<MessageInTransit> message(new MessageInTransit(
+ std::unique_ptr<MessageInTransit> message(new MessageInTransit(
MessageInTransit::Type::ENDPOINT_CLIENT,
MessageInTransit::Subtype::ENDPOINT_CLIENT_DATA_PIPE_ACK,
static_cast<uint32_t>(sizeof(ack_data)), &ack_data));
- if (!channel_endpoint_->EnqueueMessage(message.Pass()))
+ if (!channel_endpoint_->EnqueueMessage(std::move(message)))
Disconnect();
}
« no previous file with comments | « mojo/edk/system/remote_consumer_data_pipe_impl.cc ('k') | mojo/edk/system/slave_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698