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

Unified Diff: chromeos/components/tether/ble_connection_manager.cc

Issue 2915833003: Tether: Break helper TimerFactory out of BleConnectionManager and HostScanCache. (Closed)
Patch Set: khorimoto@ comments. Created 3 years, 7 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: chromeos/components/tether/ble_connection_manager.cc
diff --git a/chromeos/components/tether/ble_connection_manager.cc b/chromeos/components/tether/ble_connection_manager.cc
index 78401ed06deddd724787b7c9cbab5f7576256b08..18cb02a2109b1abbe868a7f2959ffe221a69dd96 100644
--- a/chromeos/components/tether/ble_connection_manager.cc
+++ b/chromeos/components/tether/ble_connection_manager.cc
@@ -5,6 +5,7 @@
#include "chromeos/components/tether/ble_connection_manager.h"
#include "chromeos/components/tether/ble_constants.h"
+#include "chromeos/components/tether/timer_factory.h"
#include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h"
#include "components/cryptauth/cryptauth_service.h"
#include "components/proximity_auth/logging/logging.h"
@@ -165,10 +166,6 @@ void BleConnectionManager::ConnectionMetadata::OnMessageReceived(
manager_->SendMessageReceivedEvent(remote_device_, payload);
}
-std::unique_ptr<base::Timer> BleConnectionManager::TimerFactory::CreateTimer() {
- return base::MakeUnique<base::OneShotTimer>();
-}
-
BleConnectionManager::BleConnectionManager(
cryptauth::CryptAuthService* cryptauth_service,
scoped_refptr<device::BluetoothAdapter> adapter,
@@ -183,7 +180,7 @@ BleConnectionManager::BleConnectionManager(
local_device_data_provider,
remote_beacon_seed_fetcher),
base::MakeUnique<BleAdvertisementDeviceQueue>(),
- base::WrapUnique<TimerFactory>(new TimerFactory()),
+ base::MakeUnique<TimerFactory>(),
bluetooth_throttler) {}
BleConnectionManager::BleConnectionManager(
@@ -372,7 +369,7 @@ BleConnectionManager::AddMetadataForDevice(
return existing_data;
}
- std::unique_ptr<base::Timer> timer = timer_factory_->CreateTimer();
+ std::unique_ptr<base::Timer> timer = timer_factory_->CreateOneShotTimer();
device_to_metadata_map_.insert(
std::pair<cryptauth::RemoteDevice, std::shared_ptr<ConnectionMetadata>>(
remote_device,
« no previous file with comments | « chromeos/components/tether/ble_connection_manager.h ('k') | chromeos/components/tether/ble_connection_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698