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

Unified Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc

Issue 2805113002: [CrOS Tether] Make BluetoothThrottler a singleton which can be easily shared between EasyUnlock and… (Closed)
Patch Set: Created 3 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: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
index 1ca33d32863b8866ac9d7b2e60569e985763a890..4e5f6208a44ab962fa576aac7cf31f8deedc626d 100644
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
@@ -1049,16 +1049,11 @@ EasyUnlockPrivateSetAutoPairingResultFunction::Run() {
}
EasyUnlockPrivateFindSetupConnectionFunction::
- EasyUnlockPrivateFindSetupConnectionFunction()
- : bluetooth_throttler_(new cryptauth::BluetoothThrottlerImpl(
- base::MakeUnique<base::DefaultTickClock>())) {}
+ EasyUnlockPrivateFindSetupConnectionFunction() {}
EasyUnlockPrivateFindSetupConnectionFunction::
~EasyUnlockPrivateFindSetupConnectionFunction() {
- // |connection_finder_| has a raw pointer to |bluetooth_throttler_|, so it
- // should be destroyed first.
connection_finder_.reset();
- bluetooth_throttler_.reset();
}
void EasyUnlockPrivateFindSetupConnectionFunction::
@@ -1092,7 +1087,7 @@ bool EasyUnlockPrivateFindSetupConnectionFunction::RunAsync() {
new proximity_auth::BluetoothLowEnergyConnectionFinder(
cryptauth::RemoteDevice(), params->setup_service_uuid,
proximity_auth::BluetoothLowEnergyConnectionFinder::FIND_ANY_DEVICE,
- nullptr, bluetooth_throttler_.get(), 3));
+ nullptr, cryptauth::BluetoothThrottlerImpl::GetInstance(), 3));
connection_finder_->Find(base::Bind(
&EasyUnlockPrivateFindSetupConnectionFunction::OnConnectionFound, this));

Powered by Google App Engine
This is Rietveld 408576698