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

Unified Diff: components/proximity_auth/bluetooth_low_energy_connection_finder.cc

Issue 2859053003: [EasyUnlock] Add beacon_seeds to RemoteDevice. (Closed)
Patch Set: fix memory issue 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: components/proximity_auth/bluetooth_low_energy_connection_finder.cc
diff --git a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
index 6029eb46191886a5c15511a35fda5f7ce66cbe91..94ed7d37ad42e8e1ded043156ba0ab44b2850501 100644
--- a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
+++ b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
@@ -41,24 +41,20 @@ const int kRestartDiscoveryOnErrorDelaySeconds = 2;
BluetoothLowEnergyConnectionFinder::BluetoothLowEnergyConnectionFinder(
const cryptauth::RemoteDevice remote_device,
- const std::vector<cryptauth::BeaconSeed>& beacon_seeds,
cryptauth::BluetoothThrottler* bluetooth_throttler)
: BluetoothLowEnergyConnectionFinder(
remote_device,
kBLEGattServiceUUID,
- beacon_seeds,
base::MakeUnique<cryptauth::BackgroundEidGenerator>(),
bluetooth_throttler) {}
BluetoothLowEnergyConnectionFinder::BluetoothLowEnergyConnectionFinder(
const cryptauth::RemoteDevice remote_device,
const std::string& service_uuid,
- const std::vector<cryptauth::BeaconSeed>& beacon_seeds,
std::unique_ptr<cryptauth::BackgroundEidGenerator> eid_generator,
cryptauth::BluetoothThrottler* bluetooth_throttler)
: remote_device_(remote_device),
service_uuid_(service_uuid),
- beacon_seeds_(beacon_seeds),
eid_generator_(std::move(eid_generator)),
bluetooth_throttler_(bluetooth_throttler),
weak_ptr_factory_(this) {}
@@ -168,9 +164,10 @@ bool BluetoothLowEnergyConnectionFinder::IsRightDevice(
if (!service_data)
return false;
+ PA_LOG(INFO) << "Generating EIDs for: " << device->GetAddress();
std::string service_data_string(service_data->begin(), service_data->end());
std::vector<cryptauth::DataWithTimestamp> nearest_eids =
- eid_generator_->GenerateNearestEids(beacon_seeds_);
+ eid_generator_->GenerateNearestEids(remote_device_.beacon_seeds);
for (const cryptauth::DataWithTimestamp& eid : nearest_eids) {
if (eid.data == service_data_string) {
PA_LOG(INFO) << "Found a matching EID: " << eid.DataInHex();

Powered by Google App Engine
This is Rietveld 408576698