OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bluetooth_task_manager_win.h" | 5 #include "device/bluetooth/bluetooth_task_manager_win.h" |
6 | 6 |
| 7 #include <stddef.h> |
7 #include <winsock2.h> | 8 #include <winsock2.h> |
8 | 9 |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/basictypes.h" | |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/strings/sys_string_conversions.h" | 17 #include "base/strings/sys_string_conversions.h" |
18 #include "base/threading/sequenced_worker_pool.h" | 18 #include "base/threading/sequenced_worker_pool.h" |
19 #include "base/win/scoped_handle.h" | 19 #include "base/win/scoped_handle.h" |
20 #include "device/bluetooth/bluetooth_device.h" | 20 #include "device/bluetooth/bluetooth_device.h" |
21 #include "device/bluetooth/bluetooth_init_win.h" | 21 #include "device/bluetooth/bluetooth_init_win.h" |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 if (last_error == WSA_E_NO_MORE || last_error == WSAENOMORE) { | 606 if (last_error == WSA_E_NO_MORE || last_error == WSAENOMORE) { |
607 break; | 607 break; |
608 } | 608 } |
609 LogPollingError("Error calling WSALookupServiceNext", last_error); | 609 LogPollingError("Error calling WSALookupServiceNext", last_error); |
610 WSALookupServiceEnd(sdp_handle); | 610 WSALookupServiceEnd(sdp_handle); |
611 return last_error; | 611 return last_error; |
612 } | 612 } |
613 ServiceRecordState* service_record_state = new ServiceRecordState(); | 613 ServiceRecordState* service_record_state = new ServiceRecordState(); |
614 service_record_state->name = | 614 service_record_state->name = |
615 base::SysWideToUTF8(sdp_result_data->lpszServiceInstanceName); | 615 base::SysWideToUTF8(sdp_result_data->lpszServiceInstanceName); |
616 for (uint64 i = 0; i < sdp_result_data->lpBlob->cbSize; i++) { | 616 for (uint64_t i = 0; i < sdp_result_data->lpBlob->cbSize; i++) { |
617 service_record_state->sdp_bytes.push_back( | 617 service_record_state->sdp_bytes.push_back( |
618 sdp_result_data->lpBlob->pBlobData[i]); | 618 sdp_result_data->lpBlob->pBlobData[i]); |
619 } | 619 } |
620 service_record_states->push_back(service_record_state); | 620 service_record_states->push_back(service_record_state); |
621 } | 621 } |
622 if (ERROR_SUCCESS != WSALookupServiceEnd(sdp_handle)) { | 622 if (ERROR_SUCCESS != WSALookupServiceEnd(sdp_handle)) { |
623 int last_error = WSAGetLastError(); | 623 int last_error = WSAGetLastError(); |
624 LogPollingError("Error calling WSALookupServiceEnd", last_error); | 624 LogPollingError("Error calling WSALookupServiceEnd", last_error); |
625 return last_error; | 625 return last_error; |
626 } | 626 } |
(...skipping 22 matching lines...) Expand all Loading... |
649 ++iter2) { | 649 ++iter2) { |
650 ServiceRecordState* service_state = new ServiceRecordState(); | 650 ServiceRecordState* service_state = new ServiceRecordState(); |
651 service_state->gatt_uuid = | 651 service_state->gatt_uuid = |
652 BluetoothLowEnergyUuidToBluetoothUuid((*iter2)->uuid); | 652 BluetoothLowEnergyUuidToBluetoothUuid((*iter2)->uuid); |
653 service_record_states->push_back(service_state); | 653 service_record_states->push_back(service_state); |
654 } | 654 } |
655 return true; | 655 return true; |
656 } | 656 } |
657 | 657 |
658 } // namespace device | 658 } // namespace device |
OLD | NEW |