Chromium Code Reviews| 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..05cb1cd8d3abf96f49bda7b42e5371a46e255682 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,12 +50,11 @@ void BluetoothDiscoveryFilter::SetPathloss(uint16_t pathloss) { |
| *pathloss_ = pathloss; |
| } |
| -BluetoothDiscoveryFilter::TransportMask BluetoothDiscoveryFilter::GetTransport() |
| - const { |
| +BluetoothTransport BluetoothDiscoveryFilter::GetTransport() const { |
| return transport_; |
| } |
| -void BluetoothDiscoveryFilter::SetTransport(TransportMask transport) { |
| +void BluetoothDiscoveryFilter::SetTransport(BluetoothTransport transport) { |
| DCHECK(transport > 0 && transport < 4); |
| 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_ | |
|
ortuno
2016/06/15 23:09:31
Why do you need this static_cast?
|
| + 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 |