Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/arc/bluetooth/arc_bluetooth_bridge.h" | 5 #include "components/arc/bluetooth/arc_bluetooth_bridge.h" |
| 6 | 6 |
| 7 #include <bluetooth/bluetooth.h> | 7 #include <bluetooth/bluetooth.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1535 mojo::Array<mojom::BluetoothAdvertisingDataPtr> advertising_data; | 1535 mojo::Array<mojom::BluetoothAdvertisingDataPtr> advertising_data; |
| 1536 | 1536 |
| 1537 // LocalName | 1537 // LocalName |
| 1538 mojom::BluetoothAdvertisingDataPtr local_name = | 1538 mojom::BluetoothAdvertisingDataPtr local_name = |
| 1539 mojom::BluetoothAdvertisingData::New(); | 1539 mojom::BluetoothAdvertisingData::New(); |
| 1540 local_name->set_local_name(device->GetName() ? device->GetName().value() | 1540 local_name->set_local_name(device->GetName() ? device->GetName().value() |
| 1541 : nullptr); | 1541 : nullptr); |
| 1542 advertising_data.push_back(std::move(local_name)); | 1542 advertising_data.push_back(std::move(local_name)); |
| 1543 | 1543 |
| 1544 // ServiceUuid | 1544 // ServiceUuid |
| 1545 BluetoothDevice::UUIDList uuid_list = device->GetServiceDataUUIDs(); | 1545 BluetoothDevice::UUIDList uuid_list = device->GetUUIDs(); |
|
ortuno
2016/08/15 15:46:57
There is more to fix in this function. I would rec
puthik_chromium
2016/08/15 21:19:01
Sorry. I was careless. Fixed.
| |
| 1546 if (uuid_list.size() > 0) { | 1546 if (uuid_list.size() > 0) { |
| 1547 mojom::BluetoothAdvertisingDataPtr service_uuids = | 1547 mojom::BluetoothAdvertisingDataPtr service_uuids = |
| 1548 mojom::BluetoothAdvertisingData::New(); | 1548 mojom::BluetoothAdvertisingData::New(); |
| 1549 service_uuids->set_service_uuids( | 1549 service_uuids->set_service_uuids( |
| 1550 mojo::Array<mojom::BluetoothUUIDPtr>::From(uuid_list)); | 1550 mojo::Array<mojom::BluetoothUUIDPtr>::From(uuid_list)); |
| 1551 advertising_data.push_back(std::move(service_uuids)); | 1551 advertising_data.push_back(std::move(service_uuids)); |
| 1552 } | 1552 } |
| 1553 | 1553 |
| 1554 // Service data | 1554 // Service data |
| 1555 for (auto& uuid : uuid_list) { | 1555 for (auto& uuid : uuid_list) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1662 LOG(WARNING) << "Bluetooth instance is too old (version " << version | 1662 LOG(WARNING) << "Bluetooth instance is too old (version " << version |
| 1663 << ") need version " << version_need; | 1663 << ") need version " << version_need; |
| 1664 return false; | 1664 return false; |
| 1665 } | 1665 } |
| 1666 | 1666 |
| 1667 bool ArcBluetoothBridge::CalledOnValidThread() { | 1667 bool ArcBluetoothBridge::CalledOnValidThread() { |
| 1668 return thread_checker_.CalledOnValidThread(); | 1668 return thread_checker_.CalledOnValidThread(); |
| 1669 } | 1669 } |
| 1670 | 1670 |
| 1671 } // namespace arc | 1671 } // namespace arc |
| OLD | NEW |