mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Change TaskRunner to be unique_ptr
PiperOrigin-RevId: 513858401
This commit is contained in:
committed by
Copybara-Service
parent
4b1423d94e
commit
2eff1c383c
@@ -54,7 +54,7 @@ FastPairScannerImpl::Factory::~Factory() = default;
|
||||
|
||||
// FastPairScannerImpl
|
||||
FastPairScannerImpl::FastPairScannerImpl() {
|
||||
task_runner_ = std::make_shared<TaskRunnerImpl>(1);
|
||||
task_runner_ = std::make_unique<TaskRunnerImpl>(1);
|
||||
}
|
||||
|
||||
void FastPairScannerImpl::AddObserver(FastPairScanner::Observer* observer) {
|
||||
|
||||
@@ -71,7 +71,7 @@ class FastPairScannerImpl : public FastPairScanner {
|
||||
Ble& GetBle() { return ble_; }
|
||||
|
||||
private:
|
||||
std::shared_ptr<TaskRunner> task_runner_;
|
||||
std::unique_ptr<TaskRunner> task_runner_;
|
||||
|
||||
// Map of a Bluetooth device address to a set of advertisement data we have
|
||||
// seen.
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace nearby {
|
||||
namespace fastpair {
|
||||
ScannerBrokerImpl::ScannerBrokerImpl() {
|
||||
adapter_ = std::make_shared<BluetoothAdapter>();
|
||||
task_runner_ = std::make_shared<TaskRunnerImpl>(1);
|
||||
task_runner_ = std::make_unique<TaskRunnerImpl>(1);
|
||||
}
|
||||
|
||||
void ScannerBrokerImpl::AddObserver(Observer* observer) {
|
||||
|
||||
@@ -48,7 +48,7 @@ class ScannerBrokerImpl : public ScannerBroker {
|
||||
void NotifyDeviceFound(const FastPairDevice& device);
|
||||
void NotifyDeviceLost(const FastPairDevice& device);
|
||||
|
||||
std::shared_ptr<TaskRunner> task_runner_;
|
||||
std::unique_ptr<TaskRunner> task_runner_;
|
||||
std::shared_ptr<FastPairScanner> scanner_;
|
||||
std::shared_ptr<FastPairScannerImpl> scanner_impl_;
|
||||
std::shared_ptr<BluetoothAdapter> adapter_;
|
||||
|
||||
Reference in New Issue
Block a user