| 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 #ifndef COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
| 6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 // | 465 // |
| 466 // When a handle is reserved, an entry is placed into the advertisements_ | 466 // When a handle is reserved, an entry is placed into the advertisements_ |
| 467 // map. This entry is not yet associated with a device::BluetoothAdvertisement | 467 // map. This entry is not yet associated with a device::BluetoothAdvertisement |
| 468 // because the instance hasn't sent us any advertising data yet, so its | 468 // because the instance hasn't sent us any advertising data yet, so its |
| 469 // mapped value is nullptr until that happens. Thus we have three states for a | 469 // mapped value is nullptr until that happens. Thus we have three states for a |
| 470 // handle: | 470 // handle: |
| 471 // * unmapped -> free | 471 // * unmapped -> free |
| 472 // * mapped to nullptr -> reserved, awaiting data | 472 // * mapped to nullptr -> reserved, awaiting data |
| 473 // * mapped to a device::BluetoothAdvertisement -> in use, and the mapped | 473 // * mapped to a device::BluetoothAdvertisement -> in use, and the mapped |
| 474 // BluetoothAdvertisement is currently registered with the adapter. | 474 // BluetoothAdvertisement is currently registered with the adapter. |
| 475 enum { kMaxAdvertisements = 5 }; | 475 // TODO(crbug.com/658385) Change back to 5 when we support setting signal |
| 476 // strength per each advertisement slot. |
| 477 enum { kMaxAdvertisements = 1 }; |
| 476 std::map<int32_t, scoped_refptr<device::BluetoothAdvertisement>> | 478 std::map<int32_t, scoped_refptr<device::BluetoothAdvertisement>> |
| 477 advertisements_; | 479 advertisements_; |
| 478 | 480 |
| 479 base::ThreadChecker thread_checker_; | 481 base::ThreadChecker thread_checker_; |
| 480 | 482 |
| 481 // WeakPtrFactory to use for callbacks. | 483 // WeakPtrFactory to use for callbacks. |
| 482 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; | 484 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; |
| 483 | 485 |
| 484 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); | 486 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); |
| 485 }; | 487 }; |
| 486 | 488 |
| 487 } // namespace arc | 489 } // namespace arc |
| 488 | 490 |
| 489 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 491 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
| OLD | NEW |