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

Unified Diff: third_party/mojo/src/mojo/edk/system/raw_channel.cc

Issue 1545333002: Convert Pass()→std::move() in //third_party/mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: third_party/mojo/src/mojo/edk/system/raw_channel.cc
diff --git a/third_party/mojo/src/mojo/edk/system/raw_channel.cc b/third_party/mojo/src/mojo/edk/system/raw_channel.cc
index 1c76bab64b0b45f862b68cbee5b00ae402c866bf..3068dce95e510073d88db38c16c77bac703eb587 100644
--- a/third_party/mojo/src/mojo/edk/system/raw_channel.cc
+++ b/third_party/mojo/src/mojo/edk/system/raw_channel.cc
@@ -5,8 +5,8 @@
#include "third_party/mojo/src/mojo/edk/system/raw_channel.h"
#include <string.h>
-
#include <algorithm>
+#include <utility>
#include "base/bind.h"
#include "base/location.h"
@@ -217,7 +217,7 @@ void RawChannel::Shutdown() {
write_stopped_ = true;
weak_ptr_factory_.InvalidateWeakPtrs();
- OnShutdownNoLock(read_buffer_.Pass(), write_buffer_.Pass());
+ OnShutdownNoLock(std::move(read_buffer_), std::move(write_buffer_));
}
// Reminder: This must be thread-safe.
@@ -229,11 +229,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;
@@ -332,9 +332,8 @@ void RawChannel::OnReadCompleted(IOResult io_result, size_t bytes_read) {
&platform_handle_table);
if (num_platform_handles > 0) {
- platform_handles =
- GetReadPlatformHandles(num_platform_handles,
- platform_handle_table).Pass();
+ platform_handles = GetReadPlatformHandles(num_platform_handles,
+ platform_handle_table);
if (!platform_handles) {
LOG(ERROR) << "Invalid number of platform handles received";
CallOnError(Delegate::ERROR_READ_BAD_MESSAGE);
@@ -353,7 +352,7 @@ void RawChannel::OnReadCompleted(IOResult io_result, size_t bytes_read) {
DCHECK(!set_on_shutdown_);
set_on_shutdown_ = &shutdown_called;
DCHECK(delegate_);
- delegate_->OnReadMessage(message_view, platform_handles.Pass());
+ delegate_->OnReadMessage(message_view, std::move(platform_handles));
if (shutdown_called)
return;
set_on_shutdown_ = nullptr;
@@ -432,7 +431,7 @@ void RawChannel::OnWriteCompleted(IOResult io_result,
void RawChannel::EnqueueMessageNoLock(scoped_ptr<MessageInTransit> message) {
write_lock_.AssertAcquired();
- write_buffer_->message_queue_.AddMessage(message.Pass());
+ write_buffer_->message_queue_.AddMessage(std::move(message));
}
bool RawChannel::OnReadMessageForRawChannel(

Powered by Google App Engine
This is Rietveld 408576698