Skip to content

Commit

Permalink
Global conversion of Pass()→std::move() on OS=android
Browse files Browse the repository at this point in the history
(╯^□^)╯︵ ❄☃❄

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

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

Cr-Commit-Position: refs/heads/master@{#367133}
  • Loading branch information
zetafunction authored and Commit bot committed Dec 30, 2015
1 parent d5ccdf1 commit 4de264f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions mojo/edk/embedder/simple_platform_shared_buffer_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <stdint.h>
#include <sys/mman.h> // For |PROT_...|.
#include <sys/types.h> // For |off_t|.

#include <limits>
#include <utility>

#include "base/files/scoped_file.h"
#include "base/logging.h"
Expand Down Expand Up @@ -65,7 +65,7 @@ bool SimplePlatformSharedBuffer::InitFromPlatformHandle(
return false;
}

handle_ = platform_handle.Pass();
handle_ = std::move(platform_handle);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions net/android/keystore_openssl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ crypto::ScopedEVP_PKEY CreateRsaPkeyWrapper(
!EVP_PKEY_set1_RSA(pkey.get(), rsa.get())) {
return crypto::ScopedEVP_PKEY();
}
return pkey.Pass();
return pkey;
}

// On Android < 4.2, the libkeystore.so ENGINE uses CRYPTO_EX_DATA and is not
Expand Down Expand Up @@ -526,7 +526,7 @@ crypto::ScopedEVP_PKEY GetEcdsaPkeyWrapper(jobject private_key) {
!EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get())) {
return crypto::ScopedEVP_PKEY();
}
return pkey.Pass();
return pkey;
}

const ECDSA_METHOD android_ecdsa_method = {
Expand Down
17 changes: 7 additions & 10 deletions net/socket/ssl_client_socket_openssl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "net/socket/ssl_client_socket.h"

#include <errno.h>
#include <string.h>

#include <openssl/bio.h>
#include <openssl/bn.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
#include <string.h>
#include <utility>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
Expand Down Expand Up @@ -99,11 +99,9 @@ class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest {
const HostPortPair& host_and_port,
const SSLConfig& ssl_config) {
scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
connection->SetSocket(transport_socket.Pass());
return socket_factory_->CreateSSLClientSocket(connection.Pass(),
host_and_port,
ssl_config,
context_);
connection->SetSocket(std::move(transport_socket));
return socket_factory_->CreateSSLClientSocket(
std::move(connection), host_and_port, ssl_config, context_);
}

// Connect to a HTTPS test server.
Expand Down Expand Up @@ -153,9 +151,8 @@ class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest {
// itself was a success.
bool CreateAndConnectSSLClientSocket(const SSLConfig& ssl_config,
int* result) {
sock_ = CreateSSLClientSocket(transport_.Pass(),
test_server_->host_port_pair(),
ssl_config);
sock_ = CreateSSLClientSocket(std::move(transport_),
test_server_->host_port_pair(), ssl_config);

if (sock_->IsConnected()) {
LOG(ERROR) << "SSL Socket prematurely connected";
Expand Down
7 changes: 4 additions & 3 deletions net/ssl/ssl_platform_key_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <openssl/digest.h>
#include <openssl/evp.h>
#include <utility>

#include "base/logging.h"
#include "base/macros.h"
Expand All @@ -23,7 +24,7 @@ namespace {
class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
public:
SSLPlatformKeyAndroid(crypto::ScopedEVP_PKEY key, SSLPrivateKey::Type type)
: key_(key.Pass()), type_(type) {}
: key_(std::move(key)), type_(type) {}

~SSLPlatformKeyAndroid() override {}

Expand Down Expand Up @@ -119,7 +120,7 @@ scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey(crypto::ScopedEVP_PKEY key) {
return nullptr;
}
return make_scoped_refptr(new ThreadedSSLPrivateKey(
make_scoped_ptr(new SSLPlatformKeyAndroid(key.Pass(), type)),
make_scoped_ptr(new SSLPlatformKeyAndroid(std::move(key), type)),
GetSSLPlatformKeyTaskRunner()));
}

Expand All @@ -130,7 +131,7 @@ scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey(
crypto::ScopedEVP_PKEY key =
OpenSSLClientKeyStore::GetInstance()->FetchClientCertPrivateKey(
certificate);
return WrapOpenSSLPrivateKey(key.Pass());
return WrapOpenSSLPrivateKey(std::move(key));
}

} // namespace net
3 changes: 2 additions & 1 deletion net/test/spawned_test_server/spawner_communicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "net/test/spawned_test_server/spawner_communicator.h"

#include <limits>
#include <utility>

#include "base/json/json_reader.h"
#include "base/logging.h"
Expand Down Expand Up @@ -192,7 +193,7 @@ void SpawnerCommunicator::SendCommandAndWaitForResultOnIOThread(
scoped_ptr<UploadElementReader> reader(
UploadOwnedBytesElementReader::CreateWithString(post_data));
cur_request_->set_upload(
ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kContentType,
"application/json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <stdint.h>
#include <sys/mman.h> // For |PROT_...|.
#include <sys/types.h> // For |off_t|.

#include <limits>
#include <utility>

#include "base/files/scoped_file.h"
#include "base/logging.h"
Expand Down Expand Up @@ -64,7 +64,7 @@ bool SimplePlatformSharedBuffer::InitFromPlatformHandle(
return false;
}

handle_ = platform_handle.Pass();
handle_ = std::move(platform_handle);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion ui/events/gestures/blink/web_gesture_curve_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ scoped_ptr<GestureCurve> CreateDefaultPlatformCurve(
INT_MIN,
INT_MAX,
base::TimeTicks());
return scroller.Pass();
return std::move(scroller);
#else
return make_scoped_ptr(
new FlingCurve(initial_velocity, base::TimeTicks()));
Expand Down
4 changes: 3 additions & 1 deletion ui/snapshot/snapshot_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "ui/snapshot/snapshot.h"

#include <utility>

#include "base/bind.h"
#include "cc/output/copy_output_request.h"
#include "third_party/skia/include/core/SkBitmap.h"
Expand Down Expand Up @@ -53,7 +55,7 @@ static void MakeAsyncCopyRequest(
source_rect_in_pixel.size());

request->set_area(adjusted_source_rect);
window->GetCompositor()->RequestCopyOfOutputOnRootLayer(request.Pass());
window->GetCompositor()->RequestCopyOfOutputOnRootLayer(std::move(request));
}

void GrabWindowSnapshotAndScaleAsync(
Expand Down

0 comments on commit 4de264f

Please sign in to comment.