From 7df85ba2d56769fc627ed8e21f916705736df8e7 Mon Sep 17 00:00:00 2001 From: dcheng Date: Wed, 30 Dec 2015 20:56:39 -0800 Subject: =?UTF-8?q?Convert=20Pass()=E2=86=92std::move()=20in=20//chromeos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (╯^□^)╯︵ ❄☃❄ BUG=557422 R=avi@chromium.org TBR=stevenjb@chromium.org Review URL: https://codereview.chromium.org/1556773002 Cr-Commit-Position: refs/heads/master@{#367230} --- chromeos/attestation/attestation_flow.cc | 7 ++++--- chromeos/attestation/attestation_flow_unittest.cc | 24 ++++++++++++----------- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'chromeos/attestation') diff --git a/chromeos/attestation/attestation_flow.cc b/chromeos/attestation/attestation_flow.cc index 7cfdc87..ec2b12e 100644 --- a/chromeos/attestation/attestation_flow.cc +++ b/chromeos/attestation/attestation_flow.cc @@ -4,6 +4,8 @@ #include "chromeos/attestation/attestation_flow.h" +#include + #include "base/bind.h" #include "chromeos/cryptohome/async_method_caller.h" #include "chromeos/dbus/cryptohome_client.h" @@ -87,9 +89,8 @@ AttestationFlow::AttestationFlow(cryptohome::AsyncMethodCaller* async_caller, scoped_ptr server_proxy) : async_caller_(async_caller), cryptohome_client_(cryptohome_client), - server_proxy_(server_proxy.Pass()), - weak_factory_(this) { -} + server_proxy_(std::move(server_proxy)), + weak_factory_(this) {} AttestationFlow::~AttestationFlow() { } diff --git a/chromeos/attestation/attestation_flow_unittest.cc b/chromeos/attestation/attestation_flow_unittest.cc index 578393b..99b98bd 100644 --- a/chromeos/attestation/attestation_flow_unittest.cc +++ b/chromeos/attestation/attestation_flow_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + #include "base/bind.h" #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" @@ -139,7 +141,7 @@ TEST_F(AttestationFlowTest, GetCertificate) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "fake@test.com", "fake_origin", true, mock_callback); Run(); @@ -167,7 +169,7 @@ TEST_F(AttestationFlowTest, GetCertificate_NoEK) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", true, mock_callback); Run(); @@ -198,7 +200,7 @@ TEST_F(AttestationFlowTest, GetCertificate_EKRejected) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", true, mock_callback); Run(); @@ -234,7 +236,7 @@ TEST_F(AttestationFlowTest, GetCertificate_FailEnroll) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", true, mock_callback); Run(); @@ -278,7 +280,7 @@ TEST_F(AttestationFlowTest, GetMachineCertificateAlreadyEnrolled) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_MACHINE_CERTIFICATE, "", "", true, mock_callback); Run(); @@ -307,7 +309,7 @@ TEST_F(AttestationFlowTest, GetCertificate_FailCreateCertRequest) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", true, mock_callback); Run(); @@ -339,7 +341,7 @@ TEST_F(AttestationFlowTest, GetCertificate_CertRequestRejected) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", true, mock_callback); Run(); @@ -364,7 +366,7 @@ TEST_F(AttestationFlowTest, GetCertificate_FailIsEnrolled) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", true, mock_callback); Run(); @@ -411,7 +413,7 @@ TEST_F(AttestationFlowTest, GetCertificate_CheckExisting) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", false, mock_callback); Run(); @@ -442,7 +444,7 @@ TEST_F(AttestationFlowTest, GetCertificate_AlreadyExists) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", false, mock_callback); Run(); @@ -477,7 +479,7 @@ TEST_F(AttestationFlowTest, AlternatePCA) { base::Unretained(&observer)); scoped_ptr proxy_interface(proxy.release()); - AttestationFlow flow(&async_caller, &client, proxy_interface.Pass()); + AttestationFlow flow(&async_caller, &client, std::move(proxy_interface)); flow.GetCertificate(PROFILE_ENTERPRISE_USER_CERTIFICATE, "", "", true, mock_callback); Run(); -- cgit v1.1