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

Unified Diff: device/bluetooth/bluetooth_adapter_factory_wrapper.cc

Issue 2384463002: bluetooth: mac: Reject requestDevice promise if Mac version is <= 10.9 (Closed)
Patch Set: Rebase Created 4 years, 2 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: device/bluetooth/bluetooth_adapter_factory_wrapper.cc
diff --git a/device/bluetooth/bluetooth_adapter_factory_wrapper.cc b/device/bluetooth/bluetooth_adapter_factory_wrapper.cc
index e4b858a04c600bd9618e7d226ec8a9df17bb40fd..722fb247e4851b012ada60d855ff3a082186dc8c 100644
--- a/device/bluetooth/bluetooth_adapter_factory_wrapper.cc
+++ b/device/bluetooth/bluetooth_adapter_factory_wrapper.cc
@@ -35,9 +35,12 @@ BluetoothAdapterFactoryWrapper& BluetoothAdapterFactoryWrapper::Get() {
return g_singleton.Get();
}
-bool BluetoothAdapterFactoryWrapper::IsBluetoothAdapterAvailable() {
+bool BluetoothAdapterFactoryWrapper::IsLowEnergyAvailable() {
DCHECK(thread_checker_.CalledOnValidThread());
- return BluetoothAdapterFactory::IsBluetoothAdapterAvailable();
+ if (adapter_ != nullptr) {
+ return true;
+ }
+ return BluetoothAdapterFactory::IsLowEnergyAvailable();
}
void BluetoothAdapterFactoryWrapper::AcquireAdapter(
@@ -53,7 +56,7 @@ void BluetoothAdapterFactoryWrapper::AcquireAdapter(
return;
}
- DCHECK(BluetoothAdapterFactory::IsBluetoothAdapterAvailable());
+ DCHECK(BluetoothAdapterFactory::IsLowEnergyAvailable());
BluetoothAdapterFactory::GetAdapter(
base::Bind(&BluetoothAdapterFactoryWrapper::OnGetAdapter,
weak_ptr_factory_.GetWeakPtr(), callback));
« no previous file with comments | « device/bluetooth/bluetooth_adapter_factory_wrapper.h ('k') | third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698