| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 // If old and new filter are not null and equal then don't make request, just | 1454 // If old and new filter are not null and equal then don't make request, just |
| 1455 // call succes callback | 1455 // call succes callback |
| 1456 if (current_filter_ && discovery_filter && | 1456 if (current_filter_ && discovery_filter && |
| 1457 current_filter_->Equals(*discovery_filter)) { | 1457 current_filter_->Equals(*discovery_filter)) { |
| 1458 callback.Run(); | 1458 callback.Run(); |
| 1459 return; | 1459 return; |
| 1460 } | 1460 } |
| 1461 | 1461 |
| 1462 current_filter_.reset(discovery_filter.release()); | 1462 current_filter_ = std::move(discovery_filter); |
| 1463 | 1463 |
| 1464 bluez::BluetoothAdapterClient::DiscoveryFilter dbus_discovery_filter; | 1464 bluez::BluetoothAdapterClient::DiscoveryFilter dbus_discovery_filter; |
| 1465 | 1465 |
| 1466 if (current_filter_.get()) { | 1466 if (current_filter_.get()) { |
| 1467 uint16_t pathloss; | 1467 uint16_t pathloss; |
| 1468 int16_t rssi; | 1468 int16_t rssi; |
| 1469 uint8_t transport; | 1469 uint8_t transport; |
| 1470 std::set<device::BluetoothUUID> uuids; | 1470 std::set<device::BluetoothUUID> uuids; |
| 1471 | 1471 |
| 1472 if (current_filter_->GetPathloss(&pathloss)) | 1472 if (current_filter_->GetPathloss(&pathloss)) |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) { | 1741 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) { |
| 1742 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS; | 1742 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS; |
| 1743 } else if (error_name == bluetooth_adapter::kErrorNotReady) { | 1743 } else if (error_name == bluetooth_adapter::kErrorNotReady) { |
| 1744 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY; | 1744 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY; |
| 1745 } | 1745 } |
| 1746 | 1746 |
| 1747 error_callback.Run(code); | 1747 error_callback.Run(code); |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 } // namespace bluez | 1750 } // namespace bluez |
| OLD | NEW |