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

Unified Diff: third_party/mojo/src/mojo/edk/system/data_pipe.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/data_pipe.cc
diff --git a/third_party/mojo/src/mojo/edk/system/data_pipe.cc b/third_party/mojo/src/mojo/edk/system/data_pipe.cc
index a49e677185b5194e0b905c4a93453794664b58c6..7ed7e7c92eb254299ba4cd7df97ed637206cdeb1 100644
--- a/third_party/mojo/src/mojo/edk/system/data_pipe.cc
+++ b/third_party/mojo/src/mojo/edk/system/data_pipe.cc
@@ -5,9 +5,9 @@
#include "third_party/mojo/src/mojo/edk/system/data_pipe.h"
#include <string.h>
-
#include <algorithm>
#include <limits>
+#include <utility>
#include "base/logging.h"
#include "base/memory/aligned_memory.h"
@@ -115,10 +115,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);
@@ -659,7 +659,7 @@ DataPipe::DataPipe(bool has_local_producer,
: nullptr),
producer_two_phase_max_num_bytes_written_(0),
consumer_two_phase_max_num_bytes_read_(0),
- impl_(impl.Pass()) {
+ impl_(std::move(impl)) {
impl_->set_owner(this);
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
@@ -683,10 +683,10 @@ scoped_ptr<DataPipeImpl> DataPipe::ReplaceImplNoLock(
DCHECK(new_impl);
impl_->set_owner(nullptr);
- scoped_ptr<DataPipeImpl> rv(impl_.Pass());
- impl_ = new_impl.Pass();
+ scoped_ptr<DataPipeImpl> rv(std::move(impl_));
+ impl_ = std::move(new_impl);
impl_->set_owner(this);
- return rv.Pass();
+ return rv;
}
void DataPipe::SetProducerClosedNoLock() {
« no previous file with comments | « third_party/mojo/src/mojo/edk/system/core.cc ('k') | third_party/mojo/src/mojo/edk/system/data_pipe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698