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

Unified Diff: mojo/edk/system/raw_channel_posix.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/raw_channel.cc ('k') | mojo/edk/system/raw_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel_posix.cc
diff --git a/mojo/edk/system/raw_channel_posix.cc b/mojo/edk/system/raw_channel_posix.cc
index 4285c13fde8b365400aa94b2e34fee9d77f811a0..a7fa16e7db68492031a800aed15da3f0c240a41a 100644
--- a/mojo/edk/system/raw_channel_posix.cc
+++ b/mojo/edk/system/raw_channel_posix.cc
@@ -11,6 +11,7 @@
#include <algorithm>
#include <deque>
#include <memory>
+#include <utility>
#include "base/bind.h"
#include "base/location.h"
@@ -42,7 +43,7 @@ class RawChannelPosix final : public RawChannel,
// |RawChannel| protected methods:
// Actually override this so that we can send multiple messages with (only)
// FDs if necessary.
- void EnqueueMessageNoLock(scoped_ptr<MessageInTransit> message) override
+ void EnqueueMessageNoLock(std::unique_ptr<MessageInTransit> message) override
MOJO_EXCLUSIVE_LOCKS_REQUIRED(write_mutex());
// Override this to handle those extra FD-only messages.
bool OnReadMessageForRawChannel(
@@ -119,7 +120,7 @@ size_t RawChannelPosix::GetSerializedPlatformHandleSize() const {
}
void RawChannelPosix::EnqueueMessageNoLock(
- scoped_ptr<MessageInTransit> message) {
+ std::unique_ptr<MessageInTransit> message) {
if (message->transport_data()) {
embedder::PlatformHandleVector* const platform_handles =
message->transport_data()->platform_handles();
@@ -132,7 +133,7 @@ void RawChannelPosix::EnqueueMessageNoLock(
for (; platform_handles->size() - i >
embedder::kPlatformChannelMaxNumHandles;
i += embedder::kPlatformChannelMaxNumHandles) {
- scoped_ptr<MessageInTransit> fd_message(new MessageInTransit(
+ std::unique_ptr<MessageInTransit> fd_message(new MessageInTransit(
MessageInTransit::Type::RAW_CHANNEL,
MessageInTransit::Subtype::RAW_CHANNEL_POSIX_EXTRA_PLATFORM_HANDLES,
0, nullptr));
@@ -143,7 +144,7 @@ void RawChannelPosix::EnqueueMessageNoLock(
embedder::kPlatformChannelMaxNumHandles));
fd_message->SetTransportData(util::MakeUnique<TransportData>(
fds.Pass(), GetSerializedPlatformHandleSize()));
- RawChannel::EnqueueMessageNoLock(fd_message.Pass());
+ RawChannel::EnqueueMessageNoLock(std::move(fd_message));
}
// Remove the handles that we "moved" into the other messages.
@@ -152,7 +153,7 @@ void RawChannelPosix::EnqueueMessageNoLock(
}
}
- RawChannel::EnqueueMessageNoLock(message.Pass());
+ RawChannel::EnqueueMessageNoLock(std::move(message));
}
bool RawChannelPosix::OnReadMessageForRawChannel(
« no previous file with comments | « mojo/edk/system/raw_channel.cc ('k') | mojo/edk/system/raw_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698