Commit 4de264fe authored by dcheng's avatar dcheng Committed by Commit bot

Global conversion of Pass()→std::move() on OS=android

(╯^□^)╯︵ 

BUG=557422
R=avi@chromium.org
TBR=jam@chromium.org

Review URL: https://codereview.chromium.org/1557553002

Cr-Commit-Position: refs/heads/master@{#367133}
parent d5ccdf12
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include <stdint.h> #include <stdint.h>
#include <sys/mman.h> // For |PROT_...|. #include <sys/mman.h> // For |PROT_...|.
#include <sys/types.h> // For |off_t|. #include <sys/types.h> // For |off_t|.
#include <limits> #include <limits>
#include <utility>
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/logging.h" #include "base/logging.h"
...@@ -65,7 +65,7 @@ bool SimplePlatformSharedBuffer::InitFromPlatformHandle( ...@@ -65,7 +65,7 @@ bool SimplePlatformSharedBuffer::InitFromPlatformHandle(
return false; return false;
} }
handle_ = platform_handle.Pass(); handle_ = std::move(platform_handle);
return true; return true;
} }
......
...@@ -351,7 +351,7 @@ crypto::ScopedEVP_PKEY CreateRsaPkeyWrapper( ...@@ -351,7 +351,7 @@ crypto::ScopedEVP_PKEY CreateRsaPkeyWrapper(
!EVP_PKEY_set1_RSA(pkey.get(), rsa.get())) { !EVP_PKEY_set1_RSA(pkey.get(), rsa.get())) {
return crypto::ScopedEVP_PKEY(); return crypto::ScopedEVP_PKEY();
} }
return pkey.Pass(); return pkey;
} }
// On Android < 4.2, the libkeystore.so ENGINE uses CRYPTO_EX_DATA and is not // On Android < 4.2, the libkeystore.so ENGINE uses CRYPTO_EX_DATA and is not
...@@ -526,7 +526,7 @@ crypto::ScopedEVP_PKEY GetEcdsaPkeyWrapper(jobject private_key) { ...@@ -526,7 +526,7 @@ crypto::ScopedEVP_PKEY GetEcdsaPkeyWrapper(jobject private_key) {
!EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get())) { !EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get())) {
return crypto::ScopedEVP_PKEY(); return crypto::ScopedEVP_PKEY();
} }
return pkey.Pass(); return pkey;
} }
const ECDSA_METHOD android_ecdsa_method = { const ECDSA_METHOD android_ecdsa_method = {
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
#include "net/socket/ssl_client_socket.h" #include "net/socket/ssl_client_socket.h"
#include <errno.h> #include <errno.h>
#include <string.h>
#include <openssl/bio.h> #include <openssl/bio.h>
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/rsa.h> #include <openssl/rsa.h>
#include <string.h>
#include <utility>
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
...@@ -99,11 +99,9 @@ class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest { ...@@ -99,11 +99,9 @@ class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest {
const HostPortPair& host_and_port, const HostPortPair& host_and_port,
const SSLConfig& ssl_config) { const SSLConfig& ssl_config) {
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
connection->SetSocket(transport_socket.Pass()); connection->SetSocket(std::move(transport_socket));
return socket_factory_->CreateSSLClientSocket(connection.Pass(), return socket_factory_->CreateSSLClientSocket(
host_and_port, std::move(connection), host_and_port, ssl_config, context_);
ssl_config,
context_);
} }
// Connect to a HTTPS test server. // Connect to a HTTPS test server.
...@@ -153,9 +151,8 @@ class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest { ...@@ -153,9 +151,8 @@ class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest {
// itself was a success. // itself was a success.
bool CreateAndConnectSSLClientSocket(const SSLConfig& ssl_config, bool CreateAndConnectSSLClientSocket(const SSLConfig& ssl_config,
int* result) { int* result) {
sock_ = CreateSSLClientSocket(transport_.Pass(), sock_ = CreateSSLClientSocket(std::move(transport_),
test_server_->host_port_pair(), test_server_->host_port_pair(), ssl_config);
ssl_config);
if (sock_->IsConnected()) { if (sock_->IsConnected()) {
LOG(ERROR) << "SSL Socket prematurely connected"; LOG(ERROR) << "SSL Socket prematurely connected";
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <openssl/digest.h> #include <openssl/digest.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -23,7 +24,7 @@ namespace { ...@@ -23,7 +24,7 @@ namespace {
class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate { class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
public: public:
SSLPlatformKeyAndroid(crypto::ScopedEVP_PKEY key, SSLPrivateKey::Type type) SSLPlatformKeyAndroid(crypto::ScopedEVP_PKEY key, SSLPrivateKey::Type type)
: key_(key.Pass()), type_(type) {} : key_(std::move(key)), type_(type) {}
~SSLPlatformKeyAndroid() override {} ~SSLPlatformKeyAndroid() override {}
...@@ -119,7 +120,7 @@ scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey(crypto::ScopedEVP_PKEY key) { ...@@ -119,7 +120,7 @@ scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey(crypto::ScopedEVP_PKEY key) {
return nullptr; return nullptr;
} }
return make_scoped_refptr(new ThreadedSSLPrivateKey( return make_scoped_refptr(new ThreadedSSLPrivateKey(
make_scoped_ptr(new SSLPlatformKeyAndroid(key.Pass(), type)), make_scoped_ptr(new SSLPlatformKeyAndroid(std::move(key), type)),
GetSSLPlatformKeyTaskRunner())); GetSSLPlatformKeyTaskRunner()));
} }
...@@ -130,7 +131,7 @@ scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey( ...@@ -130,7 +131,7 @@ scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey(
crypto::ScopedEVP_PKEY key = crypto::ScopedEVP_PKEY key =
OpenSSLClientKeyStore::GetInstance()->FetchClientCertPrivateKey( OpenSSLClientKeyStore::GetInstance()->FetchClientCertPrivateKey(
certificate); certificate);
return WrapOpenSSLPrivateKey(key.Pass()); return WrapOpenSSLPrivateKey(std::move(key));
} }
} // namespace net } // namespace net
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "net/test/spawned_test_server/spawner_communicator.h" #include "net/test/spawned_test_server/spawner_communicator.h"
#include <limits> #include <limits>
#include <utility>
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/logging.h" #include "base/logging.h"
...@@ -192,7 +193,7 @@ void SpawnerCommunicator::SendCommandAndWaitForResultOnIOThread( ...@@ -192,7 +193,7 @@ void SpawnerCommunicator::SendCommandAndWaitForResultOnIOThread(
scoped_ptr<UploadElementReader> reader( scoped_ptr<UploadElementReader> reader(
UploadOwnedBytesElementReader::CreateWithString(post_data)); UploadOwnedBytesElementReader::CreateWithString(post_data));
cur_request_->set_upload( cur_request_->set_upload(
ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0)); ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
HttpRequestHeaders headers; HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kContentType, headers.SetHeader(HttpRequestHeaders::kContentType,
"application/json"); "application/json");
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include <stdint.h> #include <stdint.h>
#include <sys/mman.h> // For |PROT_...|. #include <sys/mman.h> // For |PROT_...|.
#include <sys/types.h> // For |off_t|. #include <sys/types.h> // For |off_t|.
#include <limits> #include <limits>
#include <utility>
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/logging.h" #include "base/logging.h"
...@@ -64,7 +64,7 @@ bool SimplePlatformSharedBuffer::InitFromPlatformHandle( ...@@ -64,7 +64,7 @@ bool SimplePlatformSharedBuffer::InitFromPlatformHandle(
return false; return false;
} }
handle_ = platform_handle.Pass(); handle_ = std::move(platform_handle);
return true; return true;
} }
......
...@@ -40,7 +40,7 @@ scoped_ptr<GestureCurve> CreateDefaultPlatformCurve( ...@@ -40,7 +40,7 @@ scoped_ptr<GestureCurve> CreateDefaultPlatformCurve(
INT_MIN, INT_MIN,
INT_MAX, INT_MAX,
base::TimeTicks()); base::TimeTicks());
return scroller.Pass(); return std::move(scroller);
#else #else
return make_scoped_ptr( return make_scoped_ptr(
new FlingCurve(initial_velocity, base::TimeTicks())); new FlingCurve(initial_velocity, base::TimeTicks()));
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ui/snapshot/snapshot.h" #include "ui/snapshot/snapshot.h"
#include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "cc/output/copy_output_request.h" #include "cc/output/copy_output_request.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
...@@ -53,7 +55,7 @@ static void MakeAsyncCopyRequest( ...@@ -53,7 +55,7 @@ static void MakeAsyncCopyRequest(
source_rect_in_pixel.size()); source_rect_in_pixel.size());
request->set_area(adjusted_source_rect); request->set_area(adjusted_source_rect);
window->GetCompositor()->RequestCopyOfOutputOnRootLayer(request.Pass()); window->GetCompositor()->RequestCopyOfOutputOnRootLayer(std::move(request));
} }
void GrabWindowSnapshotAndScaleAsync( void GrabWindowSnapshotAndScaleAsync(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment