Index: device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc |
diff --git a/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc b/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc |
index 72f036204eef6eb268965d619432009d78fb2108..ae6754e02621c75c30bff536c5caed25e4d28630 100644 |
--- a/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc |
+++ b/device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc |
@@ -13,7 +13,7 @@ |
#include "base/bind.h" |
#include "base/macros.h" |
-#include "base/stl_util.h" |
+#include "base/memory/ptr_util.h" |
#include "device/bluetooth/dbus/bluetooth_media_client.h" |
#include "device/bluetooth/dbus/bluez_dbus_manager.h" |
#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h" |
@@ -92,18 +92,14 @@ void FakeBluetoothMediaTransportClient::Properties::Set( |
FakeBluetoothMediaTransportClient::Transport::Transport( |
const ObjectPath& transport_path, |
- Properties* transport_properties) |
- : path(transport_path) { |
- properties.reset(transport_properties); |
-} |
+ std::unique_ptr<Properties> transport_properties) |
+ : path(transport_path), properties(std::move(transport_properties)) {} |
FakeBluetoothMediaTransportClient::Transport::~Transport() {} |
FakeBluetoothMediaTransportClient::FakeBluetoothMediaTransportClient() {} |
-FakeBluetoothMediaTransportClient::~FakeBluetoothMediaTransportClient() { |
- base::STLDeleteValues(&endpoint_to_transport_map_); |
-} |
+FakeBluetoothMediaTransportClient::~FakeBluetoothMediaTransportClient() {} |
// DBusClient override. |
void FakeBluetoothMediaTransportClient::Init(dbus::Bus* bus) {} |
@@ -182,7 +178,7 @@ void FakeBluetoothMediaTransportClient::SetValid( |
properties->volume.ReplaceValue(kTransportVolume); |
endpoint_to_transport_map_[endpoint_path] = |
- new Transport(transport_path, properties.release()); |
+ base::MakeUnique<Transport>(transport_path, std::move(properties)); |
transport_to_endpoint_map_[transport_path] = endpoint_path; |
return; |
} |
@@ -197,7 +193,6 @@ void FakeBluetoothMediaTransportClient::SetValid( |
observer.MediaTransportRemoved(transport_path); |
endpoint->ClearConfiguration(transport_path); |
- delete transport; |
endpoint_to_transport_map_.erase(endpoint_path); |
transport_to_endpoint_map_.erase(transport_path); |
} |
@@ -282,7 +277,7 @@ FakeBluetoothMediaTransportClient::Transport* |
FakeBluetoothMediaTransportClient::GetTransport( |
const ObjectPath& endpoint_path) { |
const auto& it = endpoint_to_transport_map_.find(endpoint_path); |
- return (it != endpoint_to_transport_map_.end()) ? it->second : nullptr; |
+ return (it != endpoint_to_transport_map_.end()) ? it->second.get() : nullptr; |
} |
FakeBluetoothMediaTransportClient::Transport* |