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/bluetooth_adapter_mac.h" | 5 #include "device/bluetooth/bluetooth_adapter_mac.h" |
6 | 6 |
7 #import <IOBluetooth/objc/IOBluetoothDevice.h> | 7 #import <IOBluetooth/objc/IOBluetoothDevice.h> |
8 #import <IOBluetooth/objc/IOBluetoothHostController.h> | 8 #import <IOBluetooth/objc/IOBluetoothHostController.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
17 #include "base/location.h" | 17 #include "base/location.h" |
18 #include "base/mac/mac_util.h" | 18 #include "base/mac/mac_util.h" |
19 #include "base/mac/sdk_forward_declarations.h" | 19 #include "base/mac/sdk_forward_declarations.h" |
20 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
21 #include "base/profiler/scoped_tracker.h" | 21 #include "base/profiler/scoped_tracker.h" |
22 #include "base/sequenced_task_runner.h" | 22 #include "base/sequenced_task_runner.h" |
23 #include "base/single_thread_task_runner.h" | 23 #include "base/single_thread_task_runner.h" |
24 #include "base/strings/sys_string_conversions.h" | 24 #include "base/strings/sys_string_conversions.h" |
25 #include "base/thread_task_runner_handle.h" | 25 #include "base/threading/thread_task_runner_handle.h" |
26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
27 #include "device/bluetooth/bluetooth_classic_device_mac.h" | 27 #include "device/bluetooth/bluetooth_classic_device_mac.h" |
28 #include "device/bluetooth/bluetooth_discovery_session.h" | 28 #include "device/bluetooth/bluetooth_discovery_session.h" |
29 #include "device/bluetooth/bluetooth_discovery_session_outcome.h" | 29 #include "device/bluetooth/bluetooth_discovery_session_outcome.h" |
30 #include "device/bluetooth/bluetooth_low_energy_central_manager_delegate.h" | 30 #include "device/bluetooth/bluetooth_low_energy_central_manager_delegate.h" |
31 #include "device/bluetooth/bluetooth_socket_mac.h" | 31 #include "device/bluetooth/bluetooth_socket_mac.h" |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
35 // The frequency with which to poll the adapter for updates. | 35 // The frequency with which to poll the adapter for updates. |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 std::string device_address = | 628 std::string device_address = |
629 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); | 629 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); |
630 DevicesMap::const_iterator iter = devices_.find(device_address); | 630 DevicesMap::const_iterator iter = devices_.find(device_address); |
631 if (iter == devices_.end()) { | 631 if (iter == devices_.end()) { |
632 return nil; | 632 return nil; |
633 } | 633 } |
634 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); | 634 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); |
635 } | 635 } |
636 | 636 |
637 } // namespace device | 637 } // namespace device |
OLD | NEW |