Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc

Issue 1912433002: Convert //components/proximity_auth from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc b/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
index 90fbf5f894fec1484967189f004e03f05ad53c65..803ed5911cc5d26232562203b9a8be89db329138 100644
--- a/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
+++ b/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
@@ -4,6 +4,7 @@
#include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h"
+#include <memory>
#include <string>
#include <utility>
@@ -11,7 +12,7 @@
#include "base/bind_helpers.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
#include "components/proximity_auth/ble/bluetooth_low_energy_connection.h"
@@ -209,7 +210,7 @@ void BluetoothLowEnergyConnectionFinder::OnAdapterInitialized(
}
void BluetoothLowEnergyConnectionFinder::OnDiscoverySessionStarted(
- scoped_ptr<device::BluetoothDiscoverySession> discovery_session) {
+ std::unique_ptr<device::BluetoothDiscoverySession> discovery_session) {
PA_LOG(INFO) << "Discovery session started";
discovery_session_ = std::move(discovery_session);
}
@@ -226,7 +227,7 @@ void BluetoothLowEnergyConnectionFinder::StartDiscoverySession() {
}
// Discover only low energy (LE) devices with strong enough signal.
- scoped_ptr<BluetoothDiscoveryFilter> filter(new BluetoothDiscoveryFilter(
+ std::unique_ptr<BluetoothDiscoveryFilter> filter(new BluetoothDiscoveryFilter(
BluetoothDiscoveryFilter::Transport::TRANSPORT_LE));
filter->SetRSSI(kMinDiscoveryRSSI);
@@ -245,12 +246,13 @@ void BluetoothLowEnergyConnectionFinder::StopDiscoverySession() {
discovery_session_.reset();
}
-scoped_ptr<Connection> BluetoothLowEnergyConnectionFinder::CreateConnection(
+std::unique_ptr<Connection>
+BluetoothLowEnergyConnectionFinder::CreateConnection(
const std::string& device_address) {
DCHECK(remote_device_.bluetooth_address.empty() ||
remote_device_.bluetooth_address == device_address);
remote_device_.bluetooth_address = device_address;
- return make_scoped_ptr(new BluetoothLowEnergyConnection(
+ return base::WrapUnique(new BluetoothLowEnergyConnection(
remote_device_, adapter_, remote_service_uuid_, bluetooth_throttler_,
max_number_of_tries_));
}

Powered by Google App Engine
This is Rietveld 408576698