diff options
author | dcheng <dcheng@chromium.org> | 2015-12-30 20:56:39 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-31 04:57:55 +0000 |
commit | 7df85ba2d56769fc627ed8e21f916705736df8e7 (patch) | |
tree | 8a56a0c1e1b8c9f15ed3f3c1a1a0e1591bc78fbf | |
parent | 023d488b047379f778fccae7e436dd246dc42cdb (diff) | |
download | chromium_src-7df85ba2d56769fc627ed8e21f916705736df8e7.zip chromium_src-7df85ba2d56769fc627ed8e21f916705736df8e7.tar.gz chromium_src-7df85ba2d56769fc627ed8e21f916705736df8e7.tar.bz2 |
Convert Pass()→std::move() in //chromeos
(╯^□^)╯︵ ❄☃❄
BUG=557422
R=avi@chromium.org
TBR=stevenjb@chromium.org
Review URL: https://codereview.chromium.org/1556773002
Cr-Commit-Position: refs/heads/master@{#367230}
44 files changed, 182 insertions, 140 deletions
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 <utility> + #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<ServerProxy> 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 <utility> + #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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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<ServerProxy> 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(); diff --git a/chromeos/cert_loader.cc b/chromeos/cert_loader.cc index 0940f52..b5ac9e5 100644 --- a/chromeos/cert_loader.cc +++ b/chromeos/cert_loader.cc @@ -5,6 +5,7 @@ #include "chromeos/cert_loader.h" #include <algorithm> +#include <utility> #include "base/bind.h" #include "base/location.h" @@ -157,7 +158,7 @@ void CertLoader::UpdateCertificates( VLOG(1) << "UpdateCertificates: " << cert_list->size(); // Ignore any existing certificates. - cert_list_ = cert_list.Pass(); + cert_list_ = std::move(cert_list); bool initial_load = !certificates_loaded_; certificates_loaded_ = true; diff --git a/chromeos/cert_loader_unittest.cc b/chromeos/cert_loader_unittest.cc index f594f93..9057013 100644 --- a/chromeos/cert_loader_unittest.cc +++ b/chromeos/cert_loader_unittest.cc @@ -5,6 +5,7 @@ #include "chromeos/cert_loader.h" #include <stddef.h> +#include <utility> #include "base/bind.h" #include "base/files/file_util.h" @@ -39,7 +40,8 @@ class TestNSSCertDatabase : public net::NSSCertDatabaseChromeOS { public: TestNSSCertDatabase(crypto::ScopedPK11Slot public_slot, crypto::ScopedPK11Slot private_slot) - : NSSCertDatabaseChromeOS(public_slot.Pass(), private_slot.Pass()) {} + : NSSCertDatabaseChromeOS(std::move(public_slot), + std::move(private_slot)) {} ~TestNSSCertDatabase() override {} void NotifyOfCertAdded(const net::X509Certificate* cert) { diff --git a/chromeos/cryptohome/homedir_methods_unittest.cc b/chromeos/cryptohome/homedir_methods_unittest.cc index f6174add..19b039d 100644 --- a/chromeos/cryptohome/homedir_methods_unittest.cc +++ b/chromeos/cryptohome/homedir_methods_unittest.cc @@ -5,6 +5,7 @@ #include "chromeos/cryptohome/homedir_methods.h" #include <stdint.h> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -91,7 +92,7 @@ void HomedirMethodsTest::SetUp() { new chromeos::MockCryptohomeClient); cryptohome_client_ = cryptohome_client.get(); chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( - cryptohome_client.Pass()); + std::move(cryptohome_client)); HomedirMethods::Initialize(); } diff --git a/chromeos/dbus/blocking_method_caller.cc b/chromeos/dbus/blocking_method_caller.cc index 22315a5..f95254b 100644 --- a/chromeos/dbus/blocking_method_caller.cc +++ b/chromeos/dbus/blocking_method_caller.cc @@ -60,7 +60,7 @@ scoped_ptr<dbus::Response> BlockingMethodCaller::CallMethodAndBlock( // http://crbug.com/125360 base::ThreadRestrictions::ScopedAllowWait allow_wait; on_blocking_method_call_.Wait(); - return response.Pass(); + return response; } } // namespace chromeos diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc index fe59021..c7365de 100644 --- a/chromeos/dbus/dbus_thread_manager.cc +++ b/chromeos/dbus/dbus_thread_manager.cc @@ -4,6 +4,8 @@ #include "chromeos/dbus/dbus_thread_manager.h" +#include <utility> + #include "base/command_line.h" #include "base/sys_info.h" #include "base/threading/thread.h" @@ -50,7 +52,7 @@ static DBusThreadManager* g_dbus_thread_manager = NULL; static bool g_using_dbus_thread_manager_for_testing = false; DBusThreadManager::DBusThreadManager(scoped_ptr<DBusClientBundle> client_bundle) - : client_bundle_(client_bundle.Pass()) { + : client_bundle_(std::move(client_bundle)) { dbus::statistics::Initialize(); if (client_bundle_->IsUsingAnyRealClient()) { @@ -388,174 +390,185 @@ DBusThreadManagerSetter::~DBusThreadManagerSetter() { void DBusThreadManagerSetter::SetAmplifierClient( scoped_ptr<AmplifierClient> client) { - DBusThreadManager::Get()->client_bundle_->amplifier_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->amplifier_client_ = + std::move(client); } void DBusThreadManagerSetter::SetAudioDspClient( scoped_ptr<AudioDspClient> client) { - DBusThreadManager::Get()->client_bundle_->audio_dsp_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->audio_dsp_client_ = + std::move(client); } void DBusThreadManagerSetter::SetCrasAudioClient( scoped_ptr<CrasAudioClient> client) { - DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = + std::move(client); } void DBusThreadManagerSetter::SetCrosDisksClient( scoped_ptr<CrosDisksClient> client) { - DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = + std::move(client); } void DBusThreadManagerSetter::SetCryptohomeClient( scoped_ptr<CryptohomeClient> client) { - DBusThreadManager::Get()->client_bundle_->cryptohome_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->cryptohome_client_ = + std::move(client); } void DBusThreadManagerSetter::SetDebugDaemonClient( scoped_ptr<DebugDaemonClient> client) { DBusThreadManager::Get()->client_bundle_->debug_daemon_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetEasyUnlockClient( scoped_ptr<EasyUnlockClient> client) { - DBusThreadManager::Get()->client_bundle_->easy_unlock_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->easy_unlock_client_ = + std::move(client); } void DBusThreadManagerSetter::SetLorgnetteManagerClient( scoped_ptr<LorgnetteManagerClient> client) { DBusThreadManager::Get()->client_bundle_->lorgnette_manager_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetShillDeviceClient( scoped_ptr<ShillDeviceClient> client) { DBusThreadManager::Get()->client_bundle_->shill_device_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetShillIPConfigClient( scoped_ptr<ShillIPConfigClient> client) { DBusThreadManager::Get()->client_bundle_->shill_ipconfig_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetShillManagerClient( scoped_ptr<ShillManagerClient> client) { DBusThreadManager::Get()->client_bundle_->shill_manager_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetShillServiceClient( scoped_ptr<ShillServiceClient> client) { DBusThreadManager::Get()->client_bundle_->shill_service_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetShillProfileClient( scoped_ptr<ShillProfileClient> client) { DBusThreadManager::Get()->client_bundle_->shill_profile_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetShillThirdPartyVpnDriverClient( scoped_ptr<ShillThirdPartyVpnDriverClient> client) { DBusThreadManager::Get() - ->client_bundle_->shill_third_party_vpn_driver_client_ = client.Pass(); + ->client_bundle_->shill_third_party_vpn_driver_client_ = + std::move(client); } void DBusThreadManagerSetter::SetGsmSMSClient( scoped_ptr<GsmSMSClient> client) { - DBusThreadManager::Get()->client_bundle_->gsm_sms_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->gsm_sms_client_ = std::move(client); } void DBusThreadManagerSetter::SetImageBurnerClient( scoped_ptr<ImageBurnerClient> client) { DBusThreadManager::Get()->client_bundle_->image_burner_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetIntrospectableClient( scoped_ptr<IntrospectableClient> client) { DBusThreadManager::Get()->client_bundle_->introspectable_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetModemMessagingClient( scoped_ptr<ModemMessagingClient> client) { DBusThreadManager::Get()->client_bundle_->modem_messaging_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetNfcAdapterClient( scoped_ptr<NfcAdapterClient> client) { - DBusThreadManager::Get()->client_bundle_->nfc_adapter_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->nfc_adapter_client_ = + std::move(client); } void DBusThreadManagerSetter::SetNfcDeviceClient( scoped_ptr<NfcDeviceClient> client) { - DBusThreadManager::Get()->client_bundle_->nfc_device_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->nfc_device_client_ = + std::move(client); } void DBusThreadManagerSetter::SetNfcManagerClient( scoped_ptr<NfcManagerClient> client) { - DBusThreadManager::Get()->client_bundle_->nfc_manager_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->nfc_manager_client_ = + std::move(client); } void DBusThreadManagerSetter::SetNfcRecordClient( scoped_ptr<NfcRecordClient> client) { - DBusThreadManager::Get()->client_bundle_->nfc_record_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->nfc_record_client_ = + std::move(client); } void DBusThreadManagerSetter::SetNfcTagClient( scoped_ptr<NfcTagClient> client) { - DBusThreadManager::Get()->client_bundle_->nfc_tag_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->nfc_tag_client_ = std::move(client); } void DBusThreadManagerSetter::SetPeerDaemonManagerClient( scoped_ptr<PeerDaemonManagerClient> client) { DBusThreadManager::Get()->client_bundle_->peer_daemon_manager_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetPermissionBrokerClient( scoped_ptr<PermissionBrokerClient> client) { DBusThreadManager::Get()->client_bundle_->permission_broker_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetPrivetDaemonManagerClient( scoped_ptr<PrivetDaemonManagerClient> client) { DBusThreadManager::Get()->client_bundle_->privet_daemon_manager_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetPowerManagerClient( scoped_ptr<PowerManagerClient> client) { DBusThreadManager::Get()->client_bundle_->power_manager_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetSessionManagerClient( scoped_ptr<SessionManagerClient> client) { DBusThreadManager::Get()->client_bundle_->session_manager_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetSMSClient(scoped_ptr<SMSClient> client) { - DBusThreadManager::Get()->client_bundle_->sms_client_ = client.Pass(); + DBusThreadManager::Get()->client_bundle_->sms_client_ = std::move(client); } void DBusThreadManagerSetter::SetSystemClockClient( scoped_ptr<SystemClockClient> client) { DBusThreadManager::Get()->client_bundle_->system_clock_client_ = - client.Pass(); + std::move(client); } void DBusThreadManagerSetter::SetUpdateEngineClient( scoped_ptr<UpdateEngineClient> client) { DBusThreadManager::Get()->client_bundle_->update_engine_client_ = - client.Pass(); + std::move(client); } } // namespace chromeos diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc index c0f05ff..5358c94 100644 --- a/chromeos/dbus/debug_daemon_client.cc +++ b/chromeos/dbus/debug_daemon_client.cc @@ -567,7 +567,7 @@ class DebugDaemonClientImpl : public DebugDaemonClient { scoped_ptr<dbus::FileDescriptor> file_descriptor(new dbus::FileDescriptor); file_descriptor->PutValue(pipe_write_end.TakePlatformFile()); file_descriptor->CheckValidity(); - return file_descriptor.Pass(); + return file_descriptor; } // Called when a CheckValidity response is received. diff --git a/chromeos/dbus/permission_broker_client.cc b/chromeos/dbus/permission_broker_client.cc index b862f75..5ddf0d4 100644 --- a/chromeos/dbus/permission_broker_client.cc +++ b/chromeos/dbus/permission_broker_client.cc @@ -5,6 +5,7 @@ #include "chromeos/dbus/permission_broker_client.h" #include <stdint.h> +#include <utility> #include "base/bind.h" #include "base/macros.h" @@ -155,7 +156,7 @@ class PermissionBrokerClientImpl : public PermissionBrokerClient { LOG(WARNING) << "Access request method call failed."; } - callback.Run(fd.Pass()); + callback.Run(std::move(fd)); } dbus::ObjectProxy* proxy_; diff --git a/chromeos/dbus/pipe_reader.cc b/chromeos/dbus/pipe_reader.cc index 497f514..70b44b3 100644 --- a/chromeos/dbus/pipe_reader.cc +++ b/chromeos/dbus/pipe_reader.cc @@ -44,7 +44,7 @@ base::File PipeReader::StartIO() { LOG(ERROR) << "Unable to post initial read"; return base::File(); } - return pipe_write_end.Pass(); + return pipe_write_end; } void PipeReader::OnDataReady(int byte_count) { diff --git a/chromeos/dbus/services/console_service_provider.cc b/chromeos/dbus/services/console_service_provider.cc index 71a3479..6bd7f11 100644 --- a/chromeos/dbus/services/console_service_provider.cc +++ b/chromeos/dbus/services/console_service_provider.cc @@ -4,6 +4,8 @@ #include "chromeos/dbus/services/console_service_provider.h" +#include <utility> + #include "base/bind.h" #include "dbus/message.h" #include "third_party/cros_system_api/dbus/service_constants.h" @@ -17,15 +19,13 @@ void OnDisplayOwnershipChanged( bool status) { dbus::MessageWriter writer(response.get()); writer.AppendBool(status); - response_sender.Run(response.Pass()); + response_sender.Run(std::move(response)); } } // namespace ConsoleServiceProvider::ConsoleServiceProvider(scoped_ptr<Delegate> delegate) - : delegate_(delegate.Pass()), - weak_ptr_factory_(this) { -} + : delegate_(std::move(delegate)), weak_ptr_factory_(this) {} ConsoleServiceProvider::~ConsoleServiceProvider() { } diff --git a/chromeos/dbus/services/cros_dbus_service.cc b/chromeos/dbus/services/cros_dbus_service.cc index 6f482ac..672bc86 100644 --- a/chromeos/dbus/services/cros_dbus_service.cc +++ b/chromeos/dbus/services/cros_dbus_service.cc @@ -5,6 +5,7 @@ #include "chromeos/dbus/services/cros_dbus_service.h" #include <stddef.h> +#include <utility> #include "base/bind.h" #include "base/stl_util.h" @@ -31,8 +32,7 @@ class CrosDBusServiceImpl : public CrosDBusService { : service_started_(false), origin_thread_id_(base::PlatformThread::CurrentId()), bus_(bus), - service_providers_(service_providers.Pass()) { - } + service_providers_(std::move(service_providers)) {} ~CrosDBusServiceImpl() override { } @@ -111,7 +111,7 @@ void CrosDBusService::Initialize( } dbus::Bus* bus = DBusThreadManager::Get()->GetSystemBus(); if (base::SysInfo::IsRunningOnChromeOS() && bus) { - auto* service = new CrosDBusServiceImpl(bus, service_providers.Pass()); + auto* service = new CrosDBusServiceImpl(bus, std::move(service_providers)); g_cros_dbus_service = service; service->Start(); } else { @@ -128,7 +128,7 @@ void CrosDBusService::InitializeForTesting( LOG(WARNING) << "CrosDBusService was already initialized"; return; } - auto* service = new CrosDBusServiceImpl(bus, service_providers.Pass()); + auto* service = new CrosDBusServiceImpl(bus, std::move(service_providers)); service->Start(); g_cros_dbus_service = service; VLOG(1) << "CrosDBusService initialized"; diff --git a/chromeos/dbus/services/cros_dbus_service_unittest.cc b/chromeos/dbus/services/cros_dbus_service_unittest.cc index 1a0a25f..0e65ebf 100644 --- a/chromeos/dbus/services/cros_dbus_service_unittest.cc +++ b/chromeos/dbus/services/cros_dbus_service_unittest.cc @@ -4,6 +4,8 @@ #include "chromeos/dbus/services/cros_dbus_service.h" +#include <utility> + #include "base/bind.h" #include "base/logging.h" #include "base/memory/ref_counted.h" @@ -66,8 +68,8 @@ class CrosDBusServiceTest : public testing::Test { // Initialize the cros service with the mocks injected. ScopedVector<CrosDBusService::ServiceProviderInterface> service_providers; service_providers.push_back(mock_proxy_resolution_service_provider); - CrosDBusService::InitializeForTesting( - mock_bus_.get(), service_providers.Pass()); + CrosDBusService::InitializeForTesting(mock_bus_.get(), + std::move(service_providers)); } void TearDown() override { diff --git a/chromeos/dbus/services/display_power_service_provider.cc b/chromeos/dbus/services/display_power_service_provider.cc index 1dc1d68..73dbd67 100644 --- a/chromeos/dbus/services/display_power_service_provider.cc +++ b/chromeos/dbus/services/display_power_service_provider.cc @@ -4,6 +4,8 @@ #include "chromeos/dbus/services/display_power_service_provider.h" +#include <utility> + #include "base/bind.h" #include "dbus/message.h" @@ -22,9 +24,7 @@ void RunConfigurationCallback( DisplayPowerServiceProvider::DisplayPowerServiceProvider( scoped_ptr<Delegate> delegate) - : delegate_(delegate.Pass()), - weak_ptr_factory_(this) { -} + : delegate_(std::move(delegate)), weak_ptr_factory_(this) {} DisplayPowerServiceProvider::~DisplayPowerServiceProvider() {} diff --git a/chromeos/dbus/services/proxy_resolution_service_provider.cc b/chromeos/dbus/services/proxy_resolution_service_provider.cc index 8c760aa..ec1a754 100644 --- a/chromeos/dbus/services/proxy_resolution_service_provider.cc +++ b/chromeos/dbus/services/proxy_resolution_service_provider.cc @@ -4,6 +4,8 @@ #include "chromeos/dbus/services/proxy_resolution_service_provider.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" @@ -51,10 +53,9 @@ class ProxyResolverImpl : public ProxyResolverInterface { }; explicit ProxyResolverImpl(scoped_ptr<ProxyResolverDelegate> delegate) - : delegate_(delegate.Pass()), + : delegate_(std::move(delegate)), origin_thread_(base::ThreadTaskRunnerHandle::Get()), - weak_ptr_factory_(this) { - } + weak_ptr_factory_(this) {} ~ProxyResolverImpl() override { DCHECK(OnOriginThread()); @@ -267,7 +268,7 @@ void ProxyResolutionServiceProvider::CallResolveProxyHandler( ProxyResolutionServiceProvider* ProxyResolutionServiceProvider::Create( scoped_ptr<ProxyResolverDelegate> delegate) { return new ProxyResolutionServiceProvider( - new ProxyResolverImpl(delegate.Pass())); + new ProxyResolverImpl(std::move(delegate))); } ProxyResolverInterface::~ProxyResolverInterface() { diff --git a/chromeos/dbus/services/service_provider_test_helper.cc b/chromeos/dbus/services/service_provider_test_helper.cc index 6716244..7407946 100644 --- a/chromeos/dbus/services/service_provider_test_helper.cc +++ b/chromeos/dbus/services/service_provider_test_helper.cc @@ -4,6 +4,8 @@ #include "chromeos/dbus/services/service_provider_test_helper.h" +#include <utility> + #include "base/bind.h" #include "dbus/message.h" #include "dbus/mock_bus.h" @@ -155,7 +157,7 @@ void ServiceProviderTestHelper::MockSendSignal(dbus::Signal* signal) { void ServiceProviderTestHelper::OnResponse( scoped_ptr<dbus::Response> response) { - response_ = response.Pass(); + response_ = std::move(response); response_received_ = true; if (base::MessageLoop::current()->is_running()) base::MessageLoop::current()->QuitWhenIdle(); diff --git a/chromeos/geolocation/simple_geolocation_unittest.cc b/chromeos/geolocation/simple_geolocation_unittest.cc index ba4eb2e..6c8fb42 100644 --- a/chromeos/geolocation/simple_geolocation_unittest.cc +++ b/chromeos/geolocation/simple_geolocation_unittest.cc @@ -79,7 +79,7 @@ class TestGeolocationAPIURLFetcherCallback { new net::HttpResponseHeaders(std::string()); download_headers->AddHeader("Content-Type: application/json"); fetcher->set_response_headers(download_headers); - return fetcher.Pass(); + return fetcher; } void Initialize(net::FakeURLFetcherFactory* factory) { diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/chromeos/login/auth/cryptohome_authenticator.cc index 4a80b2b..df430d0 100644 --- a/chromeos/login/auth/cryptohome_authenticator.cc +++ b/chromeos/login/auth/cryptohome_authenticator.cc @@ -53,7 +53,7 @@ scoped_ptr<Key> TransformKeyIfNeeded(const Key& key, if (result->GetKeyType() == Key::KEY_TYPE_PASSWORD_PLAIN) result->Transform(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, system_salt); - return result.Pass(); + return result; } // Records status and calls resolver->Resolve(). diff --git a/chromeos/network/firewall_hole.cc b/chromeos/network/firewall_hole.cc index 3839b3a..29abf03 100644 --- a/chromeos/network/firewall_hole.cc +++ b/chromeos/network/firewall_hole.cc @@ -7,6 +7,7 @@ #include <fcntl.h> #include <stdint.h> #include <unistd.h> +#include <utility> #include "base/bind.h" #include "base/location.h" @@ -139,7 +140,7 @@ void FirewallHole::PortAccessGranted(PortType type, bool success) { if (success) { callback.Run(make_scoped_ptr( - new FirewallHole(type, port, interface, lifeline_fd.Pass()))); + new FirewallHole(type, port, interface, std::move(lifeline_fd)))); } else { callback.Run(nullptr); } @@ -152,7 +153,6 @@ FirewallHole::FirewallHole(PortType type, : type_(type), port_(port), interface_(interface), - lifeline_fd_(lifeline_fd.Pass()) { -} + lifeline_fd_(std::move(lifeline_fd)) {} } // namespace chromeos diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc index 8e1c910..cdbc963 100644 --- a/chromeos/network/managed_network_configuration_handler_impl.cc +++ b/chromeos/network/managed_network_configuration_handler_impl.cc @@ -4,6 +4,7 @@ #include "chromeos/network/managed_network_configuration_handler_impl.h" +#include <utility> #include <vector> #include "base/bind.h" @@ -339,7 +340,7 @@ void ManagedNetworkConfigurationHandlerImpl::SetProperties( } } - SetShillProperties(service_path, shill_dictionary.Pass(), callback, + SetShillProperties(service_path, std::move(shill_dictionary), callback, error_callback); } @@ -818,7 +819,7 @@ void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback( !shill_properties_copy->GetStringWithoutPathExpansion( shill::kDeviceProperty, &device_path) || device_path.empty()) { - send_callback.Run(service_path, shill_properties_copy.Pass()); + send_callback.Run(service_path, std::move(shill_properties_copy)); return; } @@ -851,7 +852,7 @@ void ManagedNetworkConfigurationHandlerImpl::GetDevicePropertiesSuccess( // Create a "Device" dictionary in |network_properties|. network_properties->SetWithoutPathExpansion( shill::kDeviceProperty, device_properties.DeepCopy()); - send_callback.Run(service_path, network_properties.Pass()); + send_callback.Run(service_path, std::move(network_properties)); } void ManagedNetworkConfigurationHandlerImpl::GetDevicePropertiesFailure( @@ -861,7 +862,7 @@ void ManagedNetworkConfigurationHandlerImpl::GetDevicePropertiesFailure( const std::string& error_name, scoped_ptr<base::DictionaryValue> error_data) { NET_LOG_ERROR("Error getting device properties", service_path); - send_callback.Run(service_path, network_properties.Pass()); + send_callback.Run(service_path, std::move(network_properties)); } diff --git a/chromeos/network/managed_network_configuration_handler_unittest.cc b/chromeos/network/managed_network_configuration_handler_unittest.cc index e22b161..30b1891 100644 --- a/chromeos/network/managed_network_configuration_handler_unittest.cc +++ b/chromeos/network/managed_network_configuration_handler_unittest.cc @@ -236,11 +236,11 @@ class ManagedNetworkConfigurationHandlerTest : public testing::Test { mock_profile_client_ = new StrictMock<MockShillProfileClient>(); mock_service_client_ = new StrictMock<MockShillServiceClient>(); dbus_setter->SetShillManagerClient( - scoped_ptr<ShillManagerClient>(mock_manager_client_).Pass()); + scoped_ptr<ShillManagerClient>(mock_manager_client_)); dbus_setter->SetShillProfileClient( - scoped_ptr<ShillProfileClient>(mock_profile_client_).Pass()); + scoped_ptr<ShillProfileClient>(mock_profile_client_)); dbus_setter->SetShillServiceClient( - scoped_ptr<ShillServiceClient>(mock_service_client_).Pass()); + scoped_ptr<ShillServiceClient>(mock_service_client_)); SetNetworkConfigurationHandlerExpectations(); diff --git a/chromeos/network/network_configuration_handler_unittest.cc b/chromeos/network/network_configuration_handler_unittest.cc index be4194a..a5be195 100644 --- a/chromeos/network/network_configuration_handler_unittest.cc +++ b/chromeos/network/network_configuration_handler_unittest.cc @@ -188,11 +188,11 @@ class NetworkConfigurationHandlerTest : public testing::Test { mock_profile_client_ = new MockShillProfileClient(); mock_service_client_ = new MockShillServiceClient(); dbus_setter->SetShillManagerClient( - scoped_ptr<ShillManagerClient>(mock_manager_client_).Pass()); + scoped_ptr<ShillManagerClient>(mock_manager_client_)); dbus_setter->SetShillProfileClient( - scoped_ptr<ShillProfileClient>(mock_profile_client_).Pass()); + scoped_ptr<ShillProfileClient>(mock_profile_client_)); dbus_setter->SetShillServiceClient( - scoped_ptr<ShillServiceClient>(mock_service_client_).Pass()); + scoped_ptr<ShillServiceClient>(mock_service_client_)); EXPECT_CALL(*mock_service_client_, GetProperties(_, _)).Times(AnyNumber()); EXPECT_CALL(*mock_manager_client_, GetProperties(_)).Times(AnyNumber()); diff --git a/chromeos/network/network_device_handler_impl.cc b/chromeos/network/network_device_handler_impl.cc index ccb560e..753bebc 100644 --- a/chromeos/network/network_device_handler_impl.cc +++ b/chromeos/network/network_device_handler_impl.cc @@ -6,6 +6,7 @@ #include <stddef.h> #include <stdint.h> +#include <utility> #include "base/bind.h" #include "base/location.h" @@ -257,7 +258,7 @@ void TDLSErrorCallback( network_handler::CreateDBusErrorData( device_path, error_name, error_detail, dbus_error_name, dbus_error_message)); - error_callback.Run(error_name, error_data.Pass()); + error_callback.Run(error_name, std::move(error_data)); } void CallPerformTDLSOperation( @@ -572,7 +573,7 @@ const DeviceState* NetworkDeviceHandlerImpl::GetWifiDeviceState( return NULL; scoped_ptr<base::DictionaryValue> error_data(new base::DictionaryValue); error_data->SetString(network_handler::kErrorName, kErrorDeviceMissing); - error_callback.Run(kErrorDeviceMissing, error_data.Pass()); + error_callback.Run(kErrorDeviceMissing, std::move(error_data)); return NULL; } diff --git a/chromeos/network/network_handler_callbacks.cc b/chromeos/network/network_handler_callbacks.cc index 5d15182..278cfcc 100644 --- a/chromeos/network/network_handler_callbacks.cc +++ b/chromeos/network/network_handler_callbacks.cc @@ -4,6 +4,8 @@ #include "chromeos/network/network_handler_callbacks.h" +#include <utility> + #include "base/logging.h" #include "base/values.h" #include "components/device_event_log/device_event_log.h" @@ -85,7 +87,7 @@ void ShillErrorCallbackFunction(const std::string& error_name, return; scoped_ptr<base::DictionaryValue> error_data(CreateDBusErrorData( path, error_name, detail, dbus_error_name, dbus_error_message)); - error_callback.Run(error_name, error_data.Pass()); + error_callback.Run(error_name, std::move(error_data)); } void GetPropertiesCallback(const DictionaryResultCallback& callback, diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc index dfcc0e6..5f4738a 100644 --- a/chromeos/network/network_state_handler.cc +++ b/chromeos/network/network_state_handler.cc @@ -999,7 +999,7 @@ ScopedVector<std::string> NetworkStateHandler::GetTechnologiesForType( technologies.push_back(new std::string(shill::kTypeVPN)); CHECK_GT(technologies.size(), 0ul); - return technologies.Pass(); + return technologies; } } // namespace chromeos diff --git a/chromeos/network/network_state_unittest.cc b/chromeos/network/network_state_unittest.cc index 0d48cdc..25684ae 100644 --- a/chromeos/network/network_state_unittest.cc +++ b/chromeos/network/network_state_unittest.cc @@ -5,6 +5,7 @@ #include "chromeos/network/network_state.h" #include <stdint.h> +#include <utility> #include "base/i18n/streaming_utf8_validator.h" #include "base/macros.h" @@ -228,7 +229,7 @@ TEST_F(NetworkStateTest, VPNThirdPartyProvider) { shill::kProviderThirdPartyVpn); provider->SetStringWithoutPathExpansion( shill::kHostProperty, "third-party-vpn-provider-extension-id"); - EXPECT_TRUE(SetProperty(shill::kProviderProperty, provider.Pass())); + EXPECT_TRUE(SetProperty(shill::kProviderProperty, std::move(provider))); SignalInitialPropertiesReceived(); EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn); EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(), diff --git a/chromeos/network/network_ui_data.cc b/chromeos/network/network_ui_data.cc index 614dc40..4406a71 100644 --- a/chromeos/network/network_ui_data.cc +++ b/chromeos/network/network_ui_data.cc @@ -4,6 +4,8 @@ #include "chromeos/network/network_ui_data.h" +#include <utility> + #include "base/logging.h" #include "base/values.h" @@ -88,7 +90,7 @@ NetworkUIData::~NetworkUIData() { } void NetworkUIData::set_user_settings(scoped_ptr<base::DictionaryValue> dict) { - user_settings_ = dict.Pass(); + user_settings_ = std::move(dict); } std::string NetworkUIData::GetONCSourceAsString() const { @@ -114,7 +116,7 @@ scoped_ptr<NetworkUIData> NetworkUIData::CreateFromONC( ui_data->onc_source_ = onc_source; - return ui_data.Pass(); + return ui_data; } } // namespace chromeos diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc index a0f8181..ebaef51 100644 --- a/chromeos/network/network_util.cc +++ b/chromeos/network/network_util.cc @@ -183,7 +183,7 @@ scoped_ptr<base::DictionaryValue> TranslateNetworkStateToONC( scoped_ptr<base::DictionaryValue> onc_dictionary = TranslateShillServiceToONCPart(*shill_dictionary, onc_source, &onc::kNetworkWithStateSignature, network); - return onc_dictionary.Pass(); + return onc_dictionary; } scoped_ptr<base::ListValue> TranslateNetworkListToONC( @@ -201,7 +201,7 @@ scoped_ptr<base::ListValue> TranslateNetworkListToONC( TranslateNetworkStateToONC(state); network_properties_list->Append(onc_dictionary.release()); } - return network_properties_list.Pass(); + return network_properties_list; } std::string TranslateONCTypeToShill(const std::string& onc_type) { diff --git a/chromeos/network/onc/onc_mapper.cc b/chromeos/network/onc/onc_mapper.cc index 83c0e25..c580f75 100644 --- a/chromeos/network/onc/onc_mapper.cc +++ b/chromeos/network/onc/onc_mapper.cc @@ -40,7 +40,7 @@ scoped_ptr<base::Value> Mapper::MapValue(const OncValueSignature& signature, } } - return result_value.Pass(); + return result_value; } scoped_ptr<base::DictionaryValue> Mapper::MapObject( @@ -53,7 +53,7 @@ scoped_ptr<base::DictionaryValue> Mapper::MapObject( MapFields(signature, onc_object, &found_unknown_field, error, result.get()); if (found_unknown_field) *error = true; - return result.Pass(); + return result; } scoped_ptr<base::Value> Mapper::MapPrimitive(const OncValueSignature& signature, @@ -129,7 +129,7 @@ scoped_ptr<base::ListValue> Mapper::MapArray( else DCHECK(*nested_error); } - return result_array.Pass(); + return result_array; } scoped_ptr<base::Value> Mapper::MapEntry(int index, diff --git a/chromeos/network/onc/onc_merger.cc b/chromeos/network/onc/onc_merger.cc index 1662920..dab1d2d 100644 --- a/chromeos/network/onc/onc_merger.cc +++ b/chromeos/network/onc/onc_merger.cc @@ -6,6 +6,7 @@ #include <set> #include <string> +#include <utility> #include <vector> #include "base/logging.h" @@ -77,7 +78,7 @@ DictionaryPtr GetEditableFlags(const base::DictionaryValue& policy) { result_editable->SetWithoutPathExpansion( it.key(), GetEditableFlags(*child_policy).release()); } - return result_editable.Pass(); + return result_editable; } // This is the base class for merging a list of DictionaryValues in @@ -123,7 +124,7 @@ class MergeListOfDictionaries { } DictionaryPtr merged_dict(MergeNestedDictionaries(key, nested_dicts)); if (!merged_dict->empty()) - merged_value = merged_dict.Pass(); + merged_value = std::move(merged_dict); } else { std::vector<const base::Value*> values; for (DictPtrs::const_iterator it_inner = dicts.begin(); @@ -140,7 +141,7 @@ class MergeListOfDictionaries { result->SetWithoutPathExpansion(key, merged_value.release()); } } - return result.Pass(); + return result; } protected: @@ -397,7 +398,7 @@ class MergeToAugmented : public MergeToEffective { << "Values do not match: " << key << " Effective: " << *effective_value; // Return the un-augmented field. - return effective_value.Pass(); + return effective_value; } if (values.active_setting) { // Unmanaged networks have assigned (active) values. @@ -454,7 +455,7 @@ class MergeToAugmented : public MergeToEffective { } if (augmented_value->empty()) augmented_value.reset(); - return augmented_value.Pass(); + return std::move(augmented_value); } // MergeListOfDictionaries override. @@ -475,7 +476,7 @@ class MergeToAugmented : public MergeToEffective { } else { result = MergeToEffective::MergeNestedDictionaries(key, dicts); } - return result.Pass(); + return result; } private: diff --git a/chromeos/network/onc/onc_normalizer.cc b/chromeos/network/onc/onc_normalizer.cc index c38c390..327d597 100644 --- a/chromeos/network/onc/onc_normalizer.cc +++ b/chromeos/network/onc/onc_normalizer.cc @@ -30,7 +30,7 @@ scoped_ptr<base::DictionaryValue> Normalizer::NormalizeObject( scoped_ptr<base::DictionaryValue> result = MapObject(*object_signature, onc_object, &error); DCHECK(!error); - return result.Pass(); + return result; } scoped_ptr<base::DictionaryValue> Normalizer::MapObject( @@ -65,7 +65,7 @@ scoped_ptr<base::DictionaryValue> Normalizer::MapObject( else if (&signature == &kWiFiSignature) NormalizeWiFi(normalized.get()); - return normalized.Pass(); + return normalized; } namespace { diff --git a/chromeos/network/onc/onc_test_utils.cc b/chromeos/network/onc/onc_test_utils.cc index 7afc0d89..6a5c84e 100644 --- a/chromeos/network/onc/onc_test_utils.cc +++ b/chromeos/network/onc/onc_test_utils.cc @@ -4,6 +4,8 @@ #include "chromeos/network/onc/onc_test_utils.h" +#include <utility> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/json/json_file_value_serializer.h" @@ -57,7 +59,7 @@ scoped_ptr<base::DictionaryValue> ReadTestDictionary( CHECK(content != NULL) << "Couldn't json-deserialize file '" << filename << "': " << error_message; - dict = base::DictionaryValue::From(content.Pass()); + dict = base::DictionaryValue::From(std::move(content)); CHECK(dict) << "File '" << filename << "' does not contain a dictionary as expected, but type " << content->GetType(); diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc index 6ce1eab..682688a 100644 --- a/chromeos/network/onc/onc_translator_onc_to_shill.cc +++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc @@ -8,9 +8,8 @@ // - The local translation of an object depending on the associated signature // see LocalTranslator::TranslateFields -#include "chromeos/network/onc/onc_translator.h" - #include <string> +#include <utility> #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -20,6 +19,7 @@ #include "base/values.h" #include "chromeos/network/onc/onc_signature.h" #include "chromeos/network/onc/onc_translation_tables.h" +#include "chromeos/network/onc/onc_translator.h" #include "chromeos/network/onc/onc_utils.h" #include "chromeos/network/shill_property_util.h" #include "components/onc/onc_constants.h" @@ -175,7 +175,7 @@ void LocalTranslator::TranslateOpenVPN() { // Shill wants all Provider/VPN fields to be strings. translated = ConvertValueToString(it.value()); } - AddValueAccordingToSignature(it.key(), translated.Pass()); + AddValueAccordingToSignature(it.key(), std::move(translated)); } } @@ -421,7 +421,7 @@ scoped_ptr<base::DictionaryValue> TranslateONCObjectToShill( CHECK(onc_signature != NULL); scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); - return shill_dictionary.Pass(); + return shill_dictionary; } } // namespace onc diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc index 62aa868..a5a5b9b 100644 --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc @@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/network/onc/onc_translator.h" - #include <string> +#include <utility> #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -17,6 +16,7 @@ #include "chromeos/network/network_util.h" #include "chromeos/network/onc/onc_signature.h" #include "chromeos/network/onc/onc_translation_tables.h" +#include "chromeos/network/onc/onc_translator.h" #include "chromeos/network/onc/onc_utils.h" #include "chromeos/network/shill_property_util.h" #include "components/onc/onc_constants.h" @@ -183,7 +183,7 @@ ShillToONCTranslator::CreateTranslatedONCObject() { } else { CopyPropertiesAccordingToSignature(); } - return onc_object_.Pass(); + return std::move(onc_object_); } void ShillToONCTranslator::TranslateEthernet() { diff --git a/chromeos/network/onc/onc_utils.cc b/chromeos/network/onc/onc_utils.cc index 55f5091..cb2ea8b 100644 --- a/chromeos/network/onc/onc_utils.cc +++ b/chromeos/network/onc/onc_utils.cc @@ -163,7 +163,7 @@ scoped_ptr<base::DictionaryValue> Decrypt(const std::string& passphrase, return nullptr; } - return new_root.Pass(); + return new_root; } std::string GetSourceAsString(ONCSource source) { @@ -912,7 +912,7 @@ scoped_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig( } else { NOTREACHED(); } - return proxy_dict.Pass(); + return proxy_dict; } scoped_ptr<base::DictionaryValue> ConvertProxyConfigToOncProxySettings( @@ -985,7 +985,7 @@ scoped_ptr<base::DictionaryValue> ConvertProxyConfigToOncProxySettings( return nullptr; } } - return proxy_settings.Pass(); + return proxy_settings; } } // namespace onc diff --git a/chromeos/network/onc/onc_validator.cc b/chromeos/network/onc/onc_validator.cc index 12c602f..a7d3342 100644 --- a/chromeos/network/onc/onc_validator.cc +++ b/chromeos/network/onc/onc_validator.cc @@ -96,7 +96,7 @@ scoped_ptr<base::Value> Validator::MapValue(const OncValueSignature& signature, Mapper::MapValue(signature, onc_value, error); if (repaired) CHECK_EQ(repaired->GetType(), signature.onc_type); - return repaired.Pass(); + return repaired; } scoped_ptr<base::DictionaryValue> Validator::MapObject( @@ -145,7 +145,7 @@ scoped_ptr<base::DictionaryValue> Validator::MapObject( } if (valid) { - return repaired.Pass(); + return repaired; } else { DCHECK(error_or_warning_found_); error_or_warning_found_ = *error = true; @@ -177,7 +177,7 @@ scoped_ptr<base::Value> Validator::MapField( LOG(WARNING) << message; } - return result.Pass(); + return result; } scoped_ptr<base::ListValue> Validator::MapArray( @@ -195,7 +195,7 @@ scoped_ptr<base::ListValue> Validator::MapArray( &array_signature != &kCertificateListSignature) { *nested_error = nested_error_in_current_array; } - return result.Pass(); + return result; } scoped_ptr<base::Value> Validator::MapEntry(int index, @@ -208,7 +208,7 @@ scoped_ptr<base::Value> Validator::MapEntry(int index, Mapper::MapEntry(index, signature, onc_value, error); DCHECK_EQ(str, path_.back()); path_.pop_back(); - return result.Pass(); + return result; } bool Validator::ValidateObjectDefault(const OncValueSignature& signature, diff --git a/chromeos/network/onc/onc_validator_unittest.cc b/chromeos/network/onc/onc_validator_unittest.cc index 7fc6a26..a9725b9 100644 --- a/chromeos/network/onc/onc_validator_unittest.cc +++ b/chromeos/network/onc/onc_validator_unittest.cc @@ -40,7 +40,7 @@ class ONCValidatorTest : public ::testing::Test { validator.reset(new Validator(false, false, false, managed_onc)); } validator->SetOncSource(onc_source); - original_object_ = onc_object.Pass(); + original_object_ = std::move(onc_object); repaired_object_ = validator->ValidateAndRepairObject(signature, *original_object_, &validation_result_); diff --git a/chromeos/network/policy_util.cc b/chromeos/network/policy_util.cc index 7c2d0de..2467419 100644 --- a/chromeos/network/policy_util.cc +++ b/chromeos/network/policy_util.cc @@ -4,6 +4,8 @@ #include "chromeos/network/policy_util.h" +#include <utility> + #include "base/logging.h" #include "base/values.h" #include "chromeos/network/network_profile.h" @@ -264,7 +266,7 @@ scoped_ptr<base::DictionaryValue> CreateManagedONC( } } - return augmented_onc_network.Pass(); + return augmented_onc_network; } void SetShillPropertiesForGlobalPolicy( @@ -387,14 +389,14 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration( onc::MaskCredentialsInOncObject(onc::kNetworkConfigurationSignature, *user_settings, kFakeCredential)); - ui_data->set_user_settings(sanitized_user_settings.Pass()); + ui_data->set_user_settings(std::move(sanitized_user_settings)); } shill_property_util::SetUIData(*ui_data, shill_dictionary.get()); VLOG(2) << "Created Shill properties: " << *shill_dictionary; - return shill_dictionary.Pass(); + return shill_dictionary; } const base::DictionaryValue* FindMatchingPolicy( diff --git a/chromeos/network/prohibited_technologies_handler_unittest.cc b/chromeos/network/prohibited_technologies_handler_unittest.cc index 931e727..78983d1 100644 --- a/chromeos/network/prohibited_technologies_handler_unittest.cc +++ b/chromeos/network/prohibited_technologies_handler_unittest.cc @@ -5,6 +5,7 @@ #include "chromeos/network/prohibited_technologies_handler.h" #include <string> +#include <utility> #include "base/bind.h" #include "base/callback.h" @@ -77,11 +78,12 @@ class ProhibitedTechnologiesHandlerTest : public testing::Test { void PreparePolicies() { scoped_ptr<base::ListValue> val(new base::ListValue()); val->AppendString("WiFi"); - global_config_disable_wifi.Set("DisableNetworkTypes", val.Pass()); + global_config_disable_wifi.Set("DisableNetworkTypes", std::move(val)); val.reset(new base::ListValue()); val->AppendString("WiFi"); val->AppendString("Cellular"); - global_config_disable_wifi_and_cell.Set("DisableNetworkTypes", val.Pass()); + global_config_disable_wifi_and_cell.Set("DisableNetworkTypes", + std::move(val)); } void TearDown() override { diff --git a/chromeos/network/shill_property_util.cc b/chromeos/network/shill_property_util.cc index e47c7ad..5020ae9 100644 --- a/chromeos/network/shill_property_util.cc +++ b/chromeos/network/shill_property_util.cc @@ -215,7 +215,7 @@ scoped_ptr<NetworkUIData> GetUIDataFromProperties( scoped_ptr<NetworkUIData> ui_data = GetUIDataFromValue(*ui_data_value); if (!ui_data) LOG(ERROR) << "UIData is not a valid JSON dictionary."; - return ui_data.Pass(); + return ui_data; } void SetUIData(const NetworkUIData& ui_data, diff --git a/chromeos/timezone/timezone_provider.cc b/chromeos/timezone/timezone_provider.cc index 08e10e5..591e9f0 100644 --- a/chromeos/timezone/timezone_provider.cc +++ b/chromeos/timezone/timezone_provider.cc @@ -6,6 +6,7 @@ #include <algorithm> #include <iterator> +#include <utility> #include "base/bind.h" #include "base/logging.h" @@ -55,7 +56,7 @@ void TimeZoneProvider::OnTimezoneResponse( requests_.resize(requests_.size() - 1); } - callback.Run(timezone.Pass(), server_error); + callback.Run(std::move(timezone), server_error); } } // namespace chromeos diff --git a/chromeos/timezone/timezone_request.cc b/chromeos/timezone/timezone_request.cc index 4d787bd..46c0a9b 100644 --- a/chromeos/timezone/timezone_request.cc +++ b/chromeos/timezone/timezone_request.cc @@ -5,8 +5,8 @@ #include "chromeos/timezone/timezone_request.h" #include <stddef.h> - #include <string> +#include <utility> #include "base/json/json_reader.h" #include "base/metrics/histogram.h" @@ -275,21 +275,21 @@ scoped_ptr<TimeZoneResponseData> GetTimeZoneFromResponse( if (!http_success) { PrintTimeZoneError(server_url, "No response received", timezone.get()); RecordUmaEvent(TIMEZONE_REQUEST_EVENT_RESPONSE_EMPTY); - return timezone.Pass(); + return timezone; } if (status_code != net::HTTP_OK) { std::string message = "Returned error code "; message += base::IntToString(status_code); PrintTimeZoneError(server_url, message, timezone.get()); RecordUmaEvent(TIMEZONE_REQUEST_EVENT_RESPONSE_NOT_OK); - return timezone.Pass(); + return timezone; } if (!ParseServerResponse(server_url, response_body, timezone.get())) - return timezone.Pass(); + return timezone; RecordUmaEvent(TIMEZONE_REQUEST_EVENT_RESPONSE_SUCCESS); - return timezone.Pass(); + return timezone; } } // namespace @@ -400,7 +400,7 @@ void TimeZoneRequest::OnURLFetchComplete(const net::URLFetcher* source) { // callback.Run() usually destroys TimeZoneRequest, because this is the way // callback is implemented in TimeZoneProvider. - callback.Run(timezone.Pass(), server_error); + callback.Run(std::move(timezone), server_error); // "this" is already destroyed here. } diff --git a/chromeos/timezone/timezone_unittest.cc b/chromeos/timezone/timezone_unittest.cc index 37c608c..b26ae54 100644 --- a/chromeos/timezone/timezone_unittest.cc +++ b/chromeos/timezone/timezone_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include <stddef.h> +#include <utility> #include "base/macros.h" #include "base/message_loop/message_loop.h" @@ -118,7 +119,7 @@ class TestTimeZoneAPIURLFetcherCallback { new net::HttpResponseHeaders(std::string()); download_headers->AddHeader("Content-Type: application/json"); fetcher->set_response_headers(download_headers); - return fetcher.Pass(); + return fetcher; } void Initialize(net::FakeURLFetcherFactory* factory) { @@ -177,7 +178,7 @@ class TimeZoneReceiver { void OnRequestDone(scoped_ptr<TimeZoneResponseData> timezone, bool server_error) { - timezone_ = timezone.Pass(); + timezone_ = std::move(timezone); server_error_ = server_error; message_loop_runner_->Quit(); diff --git a/chromeos/tools/onc_validator/onc_validator.cc b/chromeos/tools/onc_validator/onc_validator.cc index e80d612..c825103 100644 --- a/chromeos/tools/onc_validator/onc_validator.cc +++ b/chromeos/tools/onc_validator/onc_validator.cc @@ -3,9 +3,9 @@ // found in the LICENSE file. #include <stddef.h> - #include <cstdio> #include <iostream> +#include <utility> #include "base/command_line.h" #include "base/files/file_path.h" @@ -100,7 +100,7 @@ scoped_ptr<base::DictionaryValue> ReadDictionary(const std::string& filename) { } scoped_ptr<base::DictionaryValue> dict = - base::DictionaryValue::From(value.Pass()); + base::DictionaryValue::From(std::move(value)); if (!dict) { LOG(ERROR) << "File '" << filename << "' does not contain a dictionary as expected, but type " |