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

Unified Diff: mojo/edk/system/raw_channel.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.h ('k') | mojo/edk/system/raw_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel.cc
diff --git a/mojo/edk/system/raw_channel.cc b/mojo/edk/system/raw_channel.cc
index 0f89bc3e054067e1d84a427ff361b66fd1bfe420..f5b9bd685b9d90556747e26bbb35824526ef47bf 100644
--- a/mojo/edk/system/raw_channel.cc
+++ b/mojo/edk/system/raw_channel.cc
@@ -222,7 +222,7 @@ void RawChannel::Shutdown() {
}
// Reminder: This must be thread-safe.
-bool RawChannel::WriteMessage(scoped_ptr<MessageInTransit> message) {
+bool RawChannel::WriteMessage(std::unique_ptr<MessageInTransit> message) {
DCHECK(message);
MutexLocker locker(&write_mutex_);
@@ -230,11 +230,11 @@ bool RawChannel::WriteMessage(scoped_ptr<MessageInTransit> message) {
return false;
if (!write_buffer_->message_queue_.IsEmpty()) {
- EnqueueMessageNoLock(message.Pass());
+ EnqueueMessageNoLock(std::move(message));
return true;
}
- EnqueueMessageNoLock(message.Pass());
+ EnqueueMessageNoLock(std::move(message));
DCHECK_EQ(write_buffer_->data_offset_, 0u);
size_t platform_handles_written = 0;
@@ -431,9 +431,10 @@ void RawChannel::OnWriteCompleted(IOResult io_result,
}
}
-void RawChannel::EnqueueMessageNoLock(scoped_ptr<MessageInTransit> message) {
+void RawChannel::EnqueueMessageNoLock(
+ std::unique_ptr<MessageInTransit> message) {
write_mutex_.AssertHeld();
- write_buffer_->message_queue_.AddMessage(message.Pass());
+ write_buffer_->message_queue_.AddMessage(std::move(message));
}
bool RawChannel::OnReadMessageForRawChannel(
« no previous file with comments | « mojo/edk/system/raw_channel.h ('k') | mojo/edk/system/raw_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698