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

Unified Diff: device/bluetooth/bluetooth_discovery_filter.cc

Issue 2063353002: device/bluetooth: split out transport enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing new use in components/arc/bluetooth Created 4 years, 6 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_discovery_filter.cc
diff --git a/device/bluetooth/bluetooth_discovery_filter.cc b/device/bluetooth/bluetooth_discovery_filter.cc
index 8b96a18984732be45231169111091cb32b214f5d..19e7dbec131b94500ac76880f9e5af5b1b71c086 100644
--- a/device/bluetooth/bluetooth_discovery_filter.cc
+++ b/device/bluetooth/bluetooth_discovery_filter.cc
@@ -6,9 +6,12 @@
#include <memory>
+#include "device/bluetooth/bluetooth_common.h"
+
namespace device {
-BluetoothDiscoveryFilter::BluetoothDiscoveryFilter(TransportMask transport) {
+BluetoothDiscoveryFilter::BluetoothDiscoveryFilter(
+ BluetoothTransport transport) {
SetTransport(transport);
}
@@ -47,13 +50,12 @@ void BluetoothDiscoveryFilter::SetPathloss(uint16_t pathloss) {
*pathloss_ = pathloss;
}
-BluetoothDiscoveryFilter::TransportMask BluetoothDiscoveryFilter::GetTransport()
- const {
+BluetoothTransport BluetoothDiscoveryFilter::GetTransport() const {
return transport_;
}
-void BluetoothDiscoveryFilter::SetTransport(TransportMask transport) {
- DCHECK(transport > 0 && transport < 4);
+void BluetoothDiscoveryFilter::SetTransport(BluetoothTransport transport) {
+ DCHECK(transport != BLUETOOTH_TRANSPORT_INVALID);
transport_ = transport;
}
@@ -106,7 +108,7 @@ BluetoothDiscoveryFilter::Merge(
return result;
}
- result.reset(new BluetoothDiscoveryFilter(Transport::TRANSPORT_DUAL));
+ result.reset(new BluetoothDiscoveryFilter(BLUETOOTH_TRANSPORT_DUAL));
if (!filter_a || !filter_b || filter_a->IsDefault() ||
filter_b->IsDefault()) {
@@ -114,7 +116,8 @@ BluetoothDiscoveryFilter::Merge(
}
// both filters are not empty, so they must have transport set.
- result->SetTransport(filter_a->transport_ | filter_b->transport_);
+ result->SetTransport(static_cast<BluetoothTransport>(filter_a->transport_ |
+ filter_b->transport_));
// if both filters have uuids, them merge them. Otherwise uuids filter should
// be left empty
@@ -173,7 +176,7 @@ bool BluetoothDiscoveryFilter::Equals(
bool BluetoothDiscoveryFilter::IsDefault() const {
return !(rssi_.get() || pathloss_.get() || uuids_.size() ||
- transport_ != Transport::TRANSPORT_DUAL);
+ transport_ != BLUETOOTH_TRANSPORT_DUAL);
}
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_discovery_filter.h ('k') | device/bluetooth/bluetooth_discovery_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698