Change TaskRunner to be unique_ptr

PiperOrigin-RevId: 513858401
This commit is contained in:
Qin Wang
2023-03-03 10:15:30 -08:00
committed by Copybara-Service
parent 4b1423d94e
commit 2eff1c383c
4 changed files with 4 additions and 4 deletions
@@ -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.
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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_;