diff options
author | sergeyu <sergeyu@chromium.org> | 2015-12-23 16:20:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-24 00:22:13 +0000 |
commit | 42ad7c02c6aacbd7e8427cc062de5b6c4d596e5a (patch) | |
tree | 5d69f8f65e9c3b096bb03f0256b155c745925bed /remoting/base | |
parent | 2e53cb5448df90f11940a2e55ef6c74bd74ac3e7 (diff) | |
download | chromium_src-42ad7c02c6aacbd7e8427cc062de5b6c4d596e5a.zip chromium_src-42ad7c02c6aacbd7e8427cc062de5b6c4d596e5a.tar.gz chromium_src-42ad7c02c6aacbd7e8427cc062de5b6c4d596e5a.tar.bz2 |
Use std::move() instead of .Pass() in remoting/*
Now there is a presubmit check that doesn't allow Pass() anymore.
See https://www.chromium.org/rvalue-references for information
about std::move in chromium.
Review URL: https://codereview.chromium.org/1545723002
Cr-Commit-Position: refs/heads/master@{#366778}
Diffstat (limited to 'remoting/base')
-rw-r--r-- | remoting/base/auto_thread.cc | 2 | ||||
-rw-r--r-- | remoting/base/buffered_socket_writer.cc | 5 | ||||
-rw-r--r-- | remoting/base/rsa_key_pair.cc | 7 | ||||
-rw-r--r-- | remoting/base/typed_buffer_unittest.cc | 5 | ||||
-rw-r--r-- | remoting/base/url_request_context_getter.cc | 6 |
5 files changed, 15 insertions, 10 deletions
diff --git a/remoting/base/auto_thread.cc b/remoting/base/auto_thread.cc index dd7cc17..c55a761 100644 --- a/remoting/base/auto_thread.cc +++ b/remoting/base/auto_thread.cc @@ -31,7 +31,7 @@ scoped_ptr<base::win::ScopedCOMInitializer> CreateComInitializer( } else if (type == AutoThread::COM_INIT_STA) { initializer.reset(new base::win::ScopedCOMInitializer()); } - return initializer.Pass(); + return initializer; } #endif diff --git a/remoting/base/buffered_socket_writer.cc b/remoting/base/buffered_socket_writer.cc index 827abca..405e37b 100644 --- a/remoting/base/buffered_socket_writer.cc +++ b/remoting/base/buffered_socket_writer.cc @@ -40,11 +40,10 @@ scoped_ptr<BufferedSocketWriter> BufferedSocketWriter::CreateForSocket( const WriteFailedCallback& write_failed_callback) { scoped_ptr<BufferedSocketWriter> result(new BufferedSocketWriter()); result->Init(base::Bind(&WriteNetSocket, socket), write_failed_callback); - return result.Pass(); + return result; } -BufferedSocketWriter::BufferedSocketWriter() : weak_factory_(this) { -} +BufferedSocketWriter::BufferedSocketWriter() : weak_factory_(this) {} BufferedSocketWriter::~BufferedSocketWriter() { STLDeleteElements(&queue_); diff --git a/remoting/base/rsa_key_pair.cc b/remoting/base/rsa_key_pair.cc index 66688e9..98a153b 100644 --- a/remoting/base/rsa_key_pair.cc +++ b/remoting/base/rsa_key_pair.cc @@ -8,6 +8,7 @@ #include <limits> #include <string> +#include <utility> #include <vector> #include "base/base64.h" @@ -21,7 +22,7 @@ namespace remoting { RsaKeyPair::RsaKeyPair(scoped_ptr<crypto::RSAPrivateKey> key) - : key_(key.Pass()){ + : key_(std::move(key)){ DCHECK(key_); } @@ -34,7 +35,7 @@ scoped_refptr<RsaKeyPair> RsaKeyPair::Generate() { LOG(ERROR) << "Cannot generate private key."; return NULL; } - return new RsaKeyPair(key.Pass()); + return new RsaKeyPair(std::move(key)); } // static @@ -54,7 +55,7 @@ scoped_refptr<RsaKeyPair> RsaKeyPair::FromString( return NULL; } - return new RsaKeyPair(key.Pass()); + return new RsaKeyPair(std::move(key)); } std::string RsaKeyPair::ToString() const { diff --git a/remoting/base/typed_buffer_unittest.cc b/remoting/base/typed_buffer_unittest.cc index 0c036fb..ae1561c 100644 --- a/remoting/base/typed_buffer_unittest.cc +++ b/remoting/base/typed_buffer_unittest.cc @@ -3,6 +3,9 @@ // found in the LICENSE file. #include "remoting/base/typed_buffer.h" + +#include <utility> + #include "testing/gtest/include/gtest/gtest.h" namespace remoting { @@ -57,7 +60,7 @@ TEST(TypedBufferTest, Pass) { EXPECT_EQ(right.length(), sizeof(int)); Data* raw_ptr = right.get(); - left = right.Pass(); + left = std::move(right); // Verify that passing ownership transfers both the buffer pointer and its // length. diff --git a/remoting/base/url_request_context_getter.cc b/remoting/base/url_request_context_getter.cc index 31aecbb..09780bd 100644 --- a/remoting/base/url_request_context_getter.cc +++ b/remoting/base/url_request_context_getter.cc @@ -4,6 +4,8 @@ #include "remoting/base/url_request_context_getter.h" +#include <utility> + #include "base/single_thread_task_runner.h" #include "net/proxy/proxy_config_service.h" #include "net/url_request/url_request_context.h" @@ -28,8 +30,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { net_log_.reset(new VlogNetLog()); builder.set_net_log(net_log_.get()); builder.DisableHttpCache(); - builder.set_proxy_config_service(proxy_config_service_.Pass()); - url_request_context_ = builder.Build().Pass(); + builder.set_proxy_config_service(std::move(proxy_config_service_)); + url_request_context_ = builder.Build(); } return url_request_context_.get(); } |