Commit 29de4727 authored by Hidehiko Abe's avatar Hidehiko Abe Committed by Commit Bot

s/base::MakeUnique/std::make_unique/ in components/arc.

BUG=None
TEST=Ran bots.

Change-Id: Ica33fca6c8e2d4e52f9f6ece39b5082cdba61dbf
Reviewed-on: https://chromium-review.googlesource.com/675024
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: default avatarMattias Nissler <mnissler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505311}
parent 18a1bc36
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "components/arc/arc_service_manager.h" #include "components/arc/arc_service_manager.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "components/arc/arc_bridge_service.h" #include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_session.h" #include "components/arc/arc_session.h"
#include "components/arc/arc_session_runner.h" #include "components/arc/arc_session_runner.h"
...@@ -19,7 +18,7 @@ ArcServiceManager* g_arc_service_manager = nullptr; ...@@ -19,7 +18,7 @@ ArcServiceManager* g_arc_service_manager = nullptr;
} // namespace } // namespace
ArcServiceManager::ArcServiceManager() ArcServiceManager::ArcServiceManager()
: arc_bridge_service_(base::MakeUnique<ArcBridgeService>()) { : arc_bridge_service_(std::make_unique<ArcBridgeService>()) {
DCHECK(!g_arc_service_manager); DCHECK(!g_arc_service_manager);
g_arc_service_manager = this; g_arc_service_manager = this;
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/location.h" #include "base/location.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
#include "base/sys_info.h" #include "base/sys_info.h"
#include "base/task_scheduler/post_task.h" #include "base/task_scheduler/post_task.h"
...@@ -511,7 +510,7 @@ void ArcSessionImpl::OnMojoConnected( ...@@ -511,7 +510,7 @@ void ArcSessionImpl::OnMojoConnected(
mojom::ArcBridgeInstancePtr instance; mojom::ArcBridgeInstancePtr instance;
instance.Bind(mojo::InterfacePtrInfo<mojom::ArcBridgeInstance>( instance.Bind(mojo::InterfacePtrInfo<mojom::ArcBridgeInstance>(
std::move(server_pipe), 0u)); std::move(server_pipe), 0u));
arc_bridge_host_ = base::MakeUnique<ArcBridgeHostImpl>(arc_bridge_service_, arc_bridge_host_ = std::make_unique<ArcBridgeHostImpl>(arc_bridge_service_,
std::move(instance)); std::move(instance));
VLOG(0) << "ARC ready."; VLOG(0) << "ARC ready.";
...@@ -699,7 +698,7 @@ void ArcSession::RemoveObserver(Observer* observer) { ...@@ -699,7 +698,7 @@ void ArcSession::RemoveObserver(Observer* observer) {
// static // static
std::unique_ptr<ArcSession> ArcSession::Create( std::unique_ptr<ArcSession> ArcSession::Create(
ArcBridgeService* arc_bridge_service) { ArcBridgeService* arc_bridge_service) {
return base::MakeUnique<ArcSessionImpl>(arc_bridge_service); return std::make_unique<ArcSessionImpl>(arc_bridge_service);
} }
} // namespace arc } // namespace arc
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
...@@ -45,7 +44,7 @@ class ArcSessionRunnerTest : public testing::Test, ...@@ -45,7 +44,7 @@ class ArcSessionRunnerTest : public testing::Test,
void SetUp() override { void SetUp() override {
chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient(
base::MakeUnique<chromeos::FakeSessionManagerClient>()); std::make_unique<chromeos::FakeSessionManagerClient>());
chromeos::DBusThreadManager::Initialize(); chromeos::DBusThreadManager::Initialize();
stop_reason_ = ArcStopReason::SHUTDOWN; stop_reason_ = ArcStopReason::SHUTDOWN;
...@@ -55,7 +54,7 @@ class ArcSessionRunnerTest : public testing::Test, ...@@ -55,7 +54,7 @@ class ArcSessionRunnerTest : public testing::Test,
// We inject FakeArcSession here so we do not need task_runner. // We inject FakeArcSession here so we do not need task_runner.
arc_session_runner_ = arc_session_runner_ =
base::MakeUnique<ArcSessionRunner>(base::Bind(FakeArcSession::Create)); std::make_unique<ArcSessionRunner>(base::Bind(FakeArcSession::Create));
arc_session_runner_->AddObserver(this); arc_session_runner_->AddObserver(this);
} }
...@@ -89,19 +88,19 @@ class ArcSessionRunnerTest : public testing::Test, ...@@ -89,19 +88,19 @@ class ArcSessionRunnerTest : public testing::Test,
void ResetArcSessionFactory( void ResetArcSessionFactory(
const ArcSessionRunner::ArcSessionFactory& factory) { const ArcSessionRunner::ArcSessionFactory& factory) {
arc_session_runner_->RemoveObserver(this); arc_session_runner_->RemoveObserver(this);
arc_session_runner_ = base::MakeUnique<ArcSessionRunner>(factory); arc_session_runner_ = std::make_unique<ArcSessionRunner>(factory);
arc_session_runner_->AddObserver(this); arc_session_runner_->AddObserver(this);
} }
static std::unique_ptr<ArcSession> CreateSuspendedArcSession() { static std::unique_ptr<ArcSession> CreateSuspendedArcSession() {
auto arc_session = base::MakeUnique<FakeArcSession>(); auto arc_session = std::make_unique<FakeArcSession>();
arc_session->SuspendBoot(); arc_session->SuspendBoot();
return std::move(arc_session); return std::move(arc_session);
} }
static std::unique_ptr<ArcSession> CreateBootFailureArcSession( static std::unique_ptr<ArcSession> CreateBootFailureArcSession(
ArcStopReason reason) { ArcStopReason reason) {
auto arc_session = base::MakeUnique<FakeArcSession>(); auto arc_session = std::make_unique<FakeArcSession>();
arc_session->EnableBootFailureEmulation(reason); arc_session->EnableBootFailureEmulation(reason);
return std::move(arc_session); return std::move(arc_session);
} }
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
#include "components/arc/bluetooth/bluetooth_struct_traits.h" #include "components/arc/bluetooth/bluetooth_struct_traits.h"
#include <initializer_list>
#include <map> #include <map>
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/memory/ptr_util.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
...@@ -43,7 +43,7 @@ struct ServiceUUIDEntry : public AdvertisementEntry { ...@@ -43,7 +43,7 @@ struct ServiceUUIDEntry : public AdvertisementEntry {
~ServiceUUIDEntry() override {} ~ServiceUUIDEntry() override {}
void AddTo(device::BluetoothAdvertisement::Data* data) override { void AddTo(device::BluetoothAdvertisement::Data* data) override {
auto string_uuids = base::MakeUnique<std::vector<std::string>>(); auto string_uuids = std::make_unique<std::vector<std::string>>();
for (const auto& uuid : service_uuids) { for (const auto& uuid : service_uuids) {
string_uuids->emplace_back(uuid.value()); string_uuids->emplace_back(uuid.value());
} }
...@@ -59,9 +59,10 @@ struct ServiceDataEntry : public AdvertisementEntry { ...@@ -59,9 +59,10 @@ struct ServiceDataEntry : public AdvertisementEntry {
void AddTo(device::BluetoothAdvertisement::Data* data) override { void AddTo(device::BluetoothAdvertisement::Data* data) override {
std::string string_uuid = base::StringPrintf("%04x", service_uuid); std::string string_uuid = base::StringPrintf("%04x", service_uuid);
using MapType = std::map<std::string, std::vector<uint8_t>>;
data->set_service_data( data->set_service_data(
base::WrapUnique(new std::map<std::string, std::vector<uint8_t>>{ std::make_unique<MapType, std::initializer_list<MapType::value_type>>(
{string_uuid, service_data}})); {{string_uuid, service_data}}));
} }
}; };
...@@ -72,8 +73,10 @@ struct ManufacturerDataEntry : public AdvertisementEntry { ...@@ -72,8 +73,10 @@ struct ManufacturerDataEntry : public AdvertisementEntry {
~ManufacturerDataEntry() override {} ~ManufacturerDataEntry() override {}
void AddTo(device::BluetoothAdvertisement::Data* data) override { void AddTo(device::BluetoothAdvertisement::Data* data) override {
data->set_manufacturer_data(base::WrapUnique( using MapType = std::map<uint16_t, std::vector<uint8_t>>;
new std::map<uint16_t, std::vector<uint8_t>>{{company_id_code, blob}})); data->set_manufacturer_data(
std::make_unique<MapType, std::initializer_list<MapType::value_type>>(
{{company_id_code, blob}}));
} }
}; };
...@@ -166,7 +169,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView, ...@@ -166,7 +169,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView,
switch (data.tag()) { switch (data.tag()) {
case arc::mojom::BluetoothAdvertisingDataDataView::Tag::SERVICE_UUIDS: { case arc::mojom::BluetoothAdvertisingDataDataView::Tag::SERVICE_UUIDS: {
std::unique_ptr<ServiceUUIDEntry> service_uuids = std::unique_ptr<ServiceUUIDEntry> service_uuids =
base::MakeUnique<ServiceUUIDEntry>(); std::make_unique<ServiceUUIDEntry>();
if (!data.ReadServiceUuids(&service_uuids->service_uuids)) if (!data.ReadServiceUuids(&service_uuids->service_uuids))
return false; return false;
*output = std::move(service_uuids); *output = std::move(service_uuids);
...@@ -174,7 +177,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView, ...@@ -174,7 +177,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView,
} }
case arc::mojom::BluetoothAdvertisingDataDataView::Tag::SERVICE_DATA: { case arc::mojom::BluetoothAdvertisingDataDataView::Tag::SERVICE_DATA: {
std::unique_ptr<ServiceDataEntry> service_data = std::unique_ptr<ServiceDataEntry> service_data =
base::MakeUnique<ServiceDataEntry>(); std::make_unique<ServiceDataEntry>();
if (!data.ReadServiceData(service_data.get())) if (!data.ReadServiceData(service_data.get()))
return false; return false;
*output = std::move(service_data); *output = std::move(service_data);
...@@ -183,7 +186,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView, ...@@ -183,7 +186,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView,
case arc::mojom::BluetoothAdvertisingDataDataView::Tag:: case arc::mojom::BluetoothAdvertisingDataDataView::Tag::
MANUFACTURER_DATA: { MANUFACTURER_DATA: {
std::unique_ptr<ManufacturerDataEntry> manufacturer_data = std::unique_ptr<ManufacturerDataEntry> manufacturer_data =
base::MakeUnique<ManufacturerDataEntry>(); std::make_unique<ManufacturerDataEntry>();
// We get manufacturer data as a big blob. The first two bytes // We get manufacturer data as a big blob. The first two bytes
// should be a company identifier code and the rest is manufacturer- // should be a company identifier code and the rest is manufacturer-
// specific. // specific.
...@@ -207,7 +210,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView, ...@@ -207,7 +210,7 @@ struct UnionTraits<arc::mojom::BluetoothAdvertisingDataDataView,
// device::BluetoothAdvertisement::AdvertisementData, so data we // device::BluetoothAdvertisement::AdvertisementData, so data we
// don't know how to handle yet will be dropped but won't cause a // don't know how to handle yet will be dropped but won't cause a
// failure to deserialize. // failure to deserialize.
*output = base::MakeUnique<AdvertisementEntry>(); *output = std::make_unique<AdvertisementEntry>();
break; break;
} }
} }
...@@ -223,7 +226,7 @@ bool StructTraits<arc::mojom::BluetoothAdvertisementDataView, ...@@ -223,7 +226,7 @@ bool StructTraits<arc::mojom::BluetoothAdvertisementDataView,
device::BluetoothAdvertisement::AdvertisementType adv_type; device::BluetoothAdvertisement::AdvertisementType adv_type;
if (!advertisement.ReadType(&adv_type)) if (!advertisement.ReadType(&adv_type))
return false; return false;
auto data = base::MakeUnique<device::BluetoothAdvertisement::Data>(adv_type); auto data = std::make_unique<device::BluetoothAdvertisement::Data>(adv_type);
std::vector<std::unique_ptr<AdvertisementEntry>> adv_entries; std::vector<std::unique_ptr<AdvertisementEntry>> adv_entries;
if (!advertisement.ReadData(&adv_entries)) if (!advertisement.ReadData(&adv_entries))
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/memory/ptr_util.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
...@@ -125,7 +124,7 @@ TypeConverter<arc::mojom::BluetoothSdpAttributePtr, ...@@ -125,7 +124,7 @@ TypeConverter<arc::mojom::BluetoothSdpAttributePtr,
switch (result->type) { switch (result->type) {
case bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE: case bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE:
result->value.Append(base::MakeUnique<base::Value>()); result->value.Append(std::make_unique<base::Value>());
break; break;
case bluez::BluetoothServiceAttributeValueBlueZ::UINT: case bluez::BluetoothServiceAttributeValueBlueZ::UINT:
case bluez::BluetoothServiceAttributeValueBlueZ::INT: case bluez::BluetoothServiceAttributeValueBlueZ::INT:
...@@ -140,7 +139,7 @@ TypeConverter<arc::mojom::BluetoothSdpAttributePtr, ...@@ -140,7 +139,7 @@ TypeConverter<arc::mojom::BluetoothSdpAttributePtr,
if (depth + 1 >= arc::kBluetoothSDPMaxDepth) { if (depth + 1 >= arc::kBluetoothSDPMaxDepth) {
result->type = bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE; result->type = bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE;
result->type_size = 0; result->type_size = 0;
result->value.Append(base::MakeUnique<base::Value>()); result->value.Append(std::make_unique<base::Value>());
return result; return result;
} }
for (const auto& child : attr_bluez.sequence()) { for (const auto& child : attr_bluez.sequence()) {
...@@ -175,7 +174,7 @@ TypeConverter<bluez::BluetoothServiceAttributeValueBlueZ, ...@@ -175,7 +174,7 @@ TypeConverter<bluez::BluetoothServiceAttributeValueBlueZ,
if (attr->value.GetSize() != 1) { if (attr->value.GetSize() != 1) {
return bluez::BluetoothServiceAttributeValueBlueZ( return bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE, 0, bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE, 0,
base::MakeUnique<base::Value>()); std::make_unique<base::Value>());
} }
std::unique_ptr<base::Value> value; std::unique_ptr<base::Value> value;
...@@ -188,10 +187,10 @@ TypeConverter<bluez::BluetoothServiceAttributeValueBlueZ, ...@@ -188,10 +187,10 @@ TypeConverter<bluez::BluetoothServiceAttributeValueBlueZ,
if (depth + 1 >= arc::kBluetoothSDPMaxDepth || attr->sequence.empty()) { if (depth + 1 >= arc::kBluetoothSDPMaxDepth || attr->sequence.empty()) {
return bluez::BluetoothServiceAttributeValueBlueZ( return bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE, 0, bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE, 0,
base::MakeUnique<base::Value>()); std::make_unique<base::Value>());
} }
auto bluez_sequence = base::MakeUnique< auto bluez_sequence = std::make_unique<
bluez::BluetoothServiceAttributeValueBlueZ::Sequence>(); bluez::BluetoothServiceAttributeValueBlueZ::Sequence>();
for (const auto& child : attr->sequence) { for (const auto& child : attr->sequence) {
bluez_sequence->push_back(Convert(child, depth + 1)); bluez_sequence->push_back(Convert(child, depth + 1));
...@@ -205,7 +204,7 @@ TypeConverter<bluez::BluetoothServiceAttributeValueBlueZ, ...@@ -205,7 +204,7 @@ TypeConverter<bluez::BluetoothServiceAttributeValueBlueZ,
} }
return bluez::BluetoothServiceAttributeValueBlueZ( return bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE, 0, bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE, 0,
base::MakeUnique<base::Value>()); std::make_unique<base::Value>());
} }
// static // static
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/memory/ptr_util.h"
#include "base/values.h" #include "base/values.h"
#include "device/bluetooth/bluetooth_gatt_service.h" #include "device/bluetooth/bluetooth_gatt_service.h"
#include "device/bluetooth/bluetooth_uuid.h" #include "device/bluetooth/bluetooth_uuid.h"
...@@ -114,7 +113,7 @@ TEST(BluetoothTypeConvertorTest, ConvertMojoValueAttributeToBlueZAttribute) { ...@@ -114,7 +113,7 @@ TEST(BluetoothTypeConvertorTest, ConvertMojoValueAttributeToBlueZAttribute) {
nulltypeAttributeMojo->type = nulltypeAttributeMojo->type =
bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE; bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE;
nulltypeAttributeMojo->type_size = 0; nulltypeAttributeMojo->type_size = 0;
nulltypeAttributeMojo->value.Append(base::MakeUnique<base::Value>()); nulltypeAttributeMojo->value.Append(std::make_unique<base::Value>());
auto nulltypeAttributeBlueZ = auto nulltypeAttributeBlueZ =
nulltypeAttributeMojo.To<bluez::BluetoothServiceAttributeValueBlueZ>(); nulltypeAttributeMojo.To<bluez::BluetoothServiceAttributeValueBlueZ>();
...@@ -287,7 +286,7 @@ TEST(BluetoothTypeConvertorTest, ...@@ -287,7 +286,7 @@ TEST(BluetoothTypeConvertorTest,
auto sequenceNoData = arc::mojom::BluetoothSdpAttribute::New(); auto sequenceNoData = arc::mojom::BluetoothSdpAttribute::New();
sequenceNoData->type = bluez::BluetoothServiceAttributeValueBlueZ::SEQUENCE; sequenceNoData->type = bluez::BluetoothServiceAttributeValueBlueZ::SEQUENCE;
sequenceNoData->type_size = 0; sequenceNoData->type_size = 0;
sequenceNoData->value.Append(base::MakeUnique<base::Value>()); sequenceNoData->value.Append(std::make_unique<base::Value>());
auto sequenceNoDataBlueZ = auto sequenceNoDataBlueZ =
sequenceNoData.To<bluez::BluetoothServiceAttributeValueBlueZ>(); sequenceNoData.To<bluez::BluetoothServiceAttributeValueBlueZ>();
...@@ -329,7 +328,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) { ...@@ -329,7 +328,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) {
int valueUint16AsInt; int valueUint16AsInt;
auto uintAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ( auto uintAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::UINT, sizeof(valueUint16), bluez::BluetoothServiceAttributeValueBlueZ::UINT, sizeof(valueUint16),
base::MakeUnique<base::Value>(static_cast<int>(valueUint16))); std::make_unique<base::Value>(static_cast<int>(valueUint16)));
auto uintAttributeMojo = auto uintAttributeMojo =
ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(uintAttributeBlueZ); ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(uintAttributeBlueZ);
...@@ -345,7 +344,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) { ...@@ -345,7 +344,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) {
bool actualBool = true; bool actualBool = true;
auto boolAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ( auto boolAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::BOOL, sizeof(bool), bluez::BluetoothServiceAttributeValueBlueZ::BOOL, sizeof(bool),
base::MakeUnique<base::Value>(valueBool)); std::make_unique<base::Value>(valueBool));
auto boolAttributeMojo = auto boolAttributeMojo =
ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(boolAttributeBlueZ); ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(boolAttributeBlueZ);
...@@ -362,7 +361,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) { ...@@ -362,7 +361,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) {
std::string actualUUID; std::string actualUUID;
auto uuidAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ( auto uuidAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::UUID, sizeof(uint16_t), bluez::BluetoothServiceAttributeValueBlueZ::UUID, sizeof(uint16_t),
base::MakeUnique<base::Value>(valueUUID)); std::make_unique<base::Value>(valueUUID));
auto uuidAttributeMojo = auto uuidAttributeMojo =
ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(uuidAttributeBlueZ); ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(uuidAttributeBlueZ);
...@@ -379,7 +378,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) { ...@@ -379,7 +378,7 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZValueAttributeToMojoAttribute) {
std::string actualString; std::string actualString;
auto stringAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ( auto stringAttributeBlueZ = bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::STRING, valueString.length(), bluez::BluetoothServiceAttributeValueBlueZ::STRING, valueString.length(),
base::MakeUnique<base::Value>(valueString)); std::make_unique<base::Value>(valueString));
auto stringAttributeMojo = auto stringAttributeMojo =
ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(stringAttributeBlueZ); ConvertTo<arc::mojom::BluetoothSdpAttributePtr>(stringAttributeBlueZ);
...@@ -400,10 +399,10 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZSequenceAttributeToMojoAttribute) { ...@@ -400,10 +399,10 @@ TEST(BluetoothTypeConvertorTest, ConvertBlueZSequenceAttributeToMojoAttribute) {
sequence(new bluez::BluetoothServiceAttributeValueBlueZ::Sequence()); sequence(new bluez::BluetoothServiceAttributeValueBlueZ::Sequence());
sequence->push_back(bluez::BluetoothServiceAttributeValueBlueZ( sequence->push_back(bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::UUID, sizeof(uint16_t), bluez::BluetoothServiceAttributeValueBlueZ::UUID, sizeof(uint16_t),
base::MakeUnique<base::Value>(l2capUUID))); std::make_unique<base::Value>(l2capUUID)));
sequence->push_back(bluez::BluetoothServiceAttributeValueBlueZ( sequence->push_back(bluez::BluetoothServiceAttributeValueBlueZ(
bluez::BluetoothServiceAttributeValueBlueZ::UINT, sizeof(uint16_t), bluez::BluetoothServiceAttributeValueBlueZ::UINT, sizeof(uint16_t),
base::MakeUnique<base::Value>(l2capChannel))); std::make_unique<base::Value>(l2capChannel)));
auto sequenceBlueZ = auto sequenceBlueZ =
bluez::BluetoothServiceAttributeValueBlueZ(std::move(sequence)); bluez::BluetoothServiceAttributeValueBlueZ(std::move(sequence));
......
...@@ -145,13 +145,13 @@ class ArcImeServiceTest : public testing::Test { ...@@ -145,13 +145,13 @@ class ArcImeServiceTest : public testing::Test {
private: private:
void SetUp() override { void SetUp() override {
arc_bridge_service_ = base::MakeUnique<ArcBridgeService>(); arc_bridge_service_ = std::make_unique<ArcBridgeService>();
instance_ = instance_ =
base::MakeUnique<ArcImeService>(nullptr, arc_bridge_service_.get()); std::make_unique<ArcImeService>(nullptr, arc_bridge_service_.get());
fake_arc_ime_bridge_ = new FakeArcImeBridge(); fake_arc_ime_bridge_ = new FakeArcImeBridge();
instance_->SetImeBridgeForTesting(base::WrapUnique(fake_arc_ime_bridge_)); instance_->SetImeBridgeForTesting(base::WrapUnique(fake_arc_ime_bridge_));
fake_input_method_ = base::MakeUnique<FakeInputMethod>(); fake_input_method_ = std::make_unique<FakeInputMethod>();
instance_->SetInputMethodForTesting(fake_input_method_.get()); instance_->SetInputMethodForTesting(fake_input_method_.get());
fake_window_delegate_ = new FakeArcWindowDelegate(); fake_window_delegate_ = new FakeArcWindowDelegate();
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/base64.h" #include "base/base64.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/task_scheduler/post_task.h" #include "base/task_scheduler/post_task.h"
#include "components/arc/arc_bridge_service.h" #include "components/arc/arc_bridge_service.h"
...@@ -81,7 +80,7 @@ mojom::IntentHelperInstance* GetInstanceForRequestActivityIcons( ...@@ -81,7 +80,7 @@ mojom::IntentHelperInstance* GetInstanceForRequestActivityIcons(
std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> ResizeAndEncodeIcons( std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> ResizeAndEncodeIcons(
std::vector<mojom::ActivityIconPtr> icons) { std::vector<mojom::ActivityIconPtr> icons) {
auto result = base::MakeUnique<ActivityIconLoader::ActivityToIconsMap>(); auto result = std::make_unique<ActivityIconLoader::ActivityToIconsMap>();
for (size_t i = 0; i < icons.size(); ++i) { for (size_t i = 0; i < icons.size(); ++i) {
static const size_t kBytesPerPixel = 4; static const size_t kBytesPerPixel = 4;
const mojom::ActivityIconPtr& icon = icons.at(i); const mojom::ActivityIconPtr& icon = icons.at(i);
...@@ -214,7 +213,7 @@ ActivityIconLoader::GetResult ActivityIconLoader::GetActivityIcons( ...@@ -214,7 +213,7 @@ ActivityIconLoader::GetResult ActivityIconLoader::GetActivityIcons(
void ActivityIconLoader::OnIconsResizedForTesting( void ActivityIconLoader::OnIconsResizedForTesting(
const OnIconsReadyCallback& cb, const OnIconsReadyCallback& cb,
std::unique_ptr<ActivityToIconsMap> result) { std::unique_ptr<ActivityToIconsMap> result) {
OnIconsResized(base::MakeUnique<ActivityToIconsMap>(), cb, std::move(result)); OnIconsResized(std::make_unique<ActivityToIconsMap>(), cb, std::move(result));
} }
void ActivityIconLoader::AddCacheEntryForTesting(const ActivityName& activity) { void ActivityIconLoader::AddCacheEntryForTesting(const ActivityName& activity) {
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
#include "components/arc/intent_helper/arc_intent_helper_bridge.h" #include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include <memory>
#include <utility> #include <utility>
#include "base/memory/ptr_util.h"
#include "components/arc/arc_bridge_service.h" #include "components/arc/arc_bridge_service.h"
#include "components/arc/common/intent_helper.mojom.h" #include "components/arc/common/intent_helper.mojom.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -32,8 +32,8 @@ class ArcIntentHelperTest : public testing::Test { ...@@ -32,8 +32,8 @@ class ArcIntentHelperTest : public testing::Test {
private: private:
void SetUp() override { void SetUp() override {
arc_bridge_service_ = base::MakeUnique<ArcBridgeService>(); arc_bridge_service_ = std::make_unique<ArcBridgeService>();
instance_ = base::MakeUnique<ArcIntentHelperBridge>( instance_ = std::make_unique<ArcIntentHelperBridge>(
nullptr /* context */, arc_bridge_service_.get()); nullptr /* context */, arc_bridge_service_.get());
} }
...@@ -151,7 +151,7 @@ TEST_F(ArcIntentHelperTest, TestObserver) { ...@@ -151,7 +151,7 @@ TEST_F(ArcIntentHelperTest, TestObserver) {
}; };
// Observer should be called when intent filter is updated. // Observer should be called when intent filter is updated.
auto observer = base::MakeUnique<FakeObserver>(); auto observer = std::make_unique<FakeObserver>();
instance_->AddObserver(observer.get()); instance_->AddObserver(observer.get());
EXPECT_FALSE(observer->IsUpdated()); EXPECT_FALSE(observer->IsUpdated());
instance_->OnIntentFiltersUpdated(std::vector<IntentFilter>()); instance_->OnIntentFiltersUpdated(std::vector<IntentFilter>());
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
...@@ -63,14 +62,14 @@ void FakeAppInstance::LaunchAppDeprecated( ...@@ -63,14 +62,14 @@ void FakeAppInstance::LaunchAppDeprecated(
void FakeAppInstance::LaunchApp(const std::string& package_name, void FakeAppInstance::LaunchApp(const std::string& package_name,
const std::string& activity, const std::string& activity,
int64_t display_id) { int64_t display_id) {
launch_requests_.push_back(base::MakeUnique<Request>(package_name, activity)); launch_requests_.push_back(std::make_unique<Request>(package_name, activity));
} }
void FakeAppInstance::RequestAppIcon(const std::string& package_name, void FakeAppInstance::RequestAppIcon(const std::string& package_name,
const std::string& activity, const std::string& activity,
mojom::ScaleFactor scale_factor) { mojom::ScaleFactor scale_factor) {
icon_requests_.push_back( icon_requests_.push_back(
base::MakeUnique<IconRequest>(package_name, activity, scale_factor)); std::make_unique<IconRequest>(package_name, activity, scale_factor));
} }
void FakeAppInstance::SendRefreshAppList( void FakeAppInstance::SendRefreshAppList(
...@@ -352,7 +351,7 @@ void FakeAppInstance::RequestIcon(const std::string& icon_resource_id, ...@@ -352,7 +351,7 @@ void FakeAppInstance::RequestIcon(const std::string& icon_resource_id,
arc::mojom::ScaleFactor scale_factor, arc::mojom::ScaleFactor scale_factor,
RequestIconCallback callback) { RequestIconCallback callback) {
shortcut_icon_requests_.push_back( shortcut_icon_requests_.push_back(
base::MakeUnique<ShortcutIconRequest>(icon_resource_id, scale_factor)); std::make_unique<ShortcutIconRequest>(icon_resource_id, scale_factor));
std::string png_data_as_string; std::string png_data_as_string;
if (GetFakeIcon(scale_factor, &png_data_as_string)) { if (GetFakeIcon(scale_factor, &png_data_as_string)) {
......
...@@ -78,7 +78,7 @@ void FakeArcSession::SuspendBoot() { ...@@ -78,7 +78,7 @@ void FakeArcSession::SuspendBoot() {
// static // static
std::unique_ptr<ArcSession> FakeArcSession::Create() { std::unique_ptr<ArcSession> FakeArcSession::Create() {
return base::MakeUnique<FakeArcSession>(); return std::make_unique<FakeArcSession>();
} }
} // namespace arc } // namespace arc
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <utility> #include <utility>
#include "base/memory/ptr_util.h"
#include "components/arc/test/fake_bluetooth_instance.h" #include "components/arc/test/fake_bluetooth_instance.h"
namespace arc { namespace arc {
...@@ -60,7 +59,7 @@ void FakeBluetoothInstance::OnLEDeviceFound( ...@@ -60,7 +59,7 @@ void FakeBluetoothInstance::OnLEDeviceFound(
mojom::BluetoothAddressPtr addr, mojom::BluetoothAddressPtr addr,
int32_t rssi, int32_t rssi,
std::vector<mojom::BluetoothAdvertisingDataPtr> adv_data) { std::vector<mojom::BluetoothAdvertisingDataPtr> adv_data) {
le_device_found_data_.push_back(base::MakeUnique<LEDeviceFoundData>( le_device_found_data_.push_back(std::make_unique<LEDeviceFoundData>(
std::move(addr), rssi, std::move(adv_data))); std::move(addr), rssi, std::move(adv_data)));
} }
...@@ -80,7 +79,7 @@ void FakeBluetoothInstance::OnGetGattDB( ...@@ -80,7 +79,7 @@ void FakeBluetoothInstance::OnGetGattDB(
mojom::BluetoothAddressPtr remote_addr, mojom::BluetoothAddressPtr remote_addr,
std::vector<mojom::BluetoothGattDBElementPtr> db) { std::vector<mojom::BluetoothGattDBElementPtr> db) {
gatt_db_result_.push_back( gatt_db_result_.push_back(
base::MakeUnique<GattDBResult>(std::move(remote_addr), std::move(db))); std::make_unique<GattDBResult>(std::move(remote_addr), std::move(db)));
} }
void FakeBluetoothInstance::OnServicesRemoved( void FakeBluetoothInstance::OnServicesRemoved(
......
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