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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 23 matching lines...) Expand all Loading... | |
34 class BluetoothChromeOSTest; | 34 class BluetoothChromeOSTest; |
35 class BluetoothAdapterProfileChromeOS; | 35 class BluetoothAdapterProfileChromeOS; |
36 class BluetoothDeviceChromeOS; | 36 class BluetoothDeviceChromeOS; |
37 class BluetoothPairingChromeOS; | 37 class BluetoothPairingChromeOS; |
38 class BluetoothRemoteGattCharacteristicChromeOS; | 38 class BluetoothRemoteGattCharacteristicChromeOS; |
39 class BluetoothRemoteGattDescriptorChromeOS; | 39 class BluetoothRemoteGattDescriptorChromeOS; |
40 class BluetoothRemoteGattServiceChromeOS; | 40 class BluetoothRemoteGattServiceChromeOS; |
41 | 41 |
42 // The BluetoothAdapterChromeOS class implements BluetoothAdapter for the | 42 // The BluetoothAdapterChromeOS class implements BluetoothAdapter for the |
43 // Chrome OS platform. | 43 // Chrome OS platform. |
44 // | |
45 // Methods tolerate the dbus system being before the BluetoothAdapterChromeOS | |
armansito
2015/02/19 01:44:47
nit: '...dbus system being _shutdown_ before the..
scheib
2015/02/19 21:34:15
Done.
| |
46 // object is destroyed. This is signaled by Shutdown() and IsPresent will be | |
47 // false. BluetoothChromeOSTest Shutdown should include all methods. | |
44 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS | 48 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS |
45 : public device::BluetoothAdapter, | 49 : public device::BluetoothAdapter, |
46 public chromeos::BluetoothAdapterClient::Observer, | 50 public chromeos::BluetoothAdapterClient::Observer, |
47 public chromeos::BluetoothDeviceClient::Observer, | 51 public chromeos::BluetoothDeviceClient::Observer, |
48 public chromeos::BluetoothInputClient::Observer, | 52 public chromeos::BluetoothInputClient::Observer, |
49 public chromeos::BluetoothAgentServiceProvider::Delegate { | 53 public chromeos::BluetoothAgentServiceProvider::Delegate { |
50 public: | 54 public: |
51 typedef base::Callback<void(const std::string& error_message)> | 55 typedef base::Callback<void(const std::string& error_message)> |
52 ErrorCompletionCallback; | 56 ErrorCompletionCallback; |
53 typedef base::Callback<void(BluetoothAdapterProfileChromeOS* profile)> | 57 typedef base::Callback<void(BluetoothAdapterProfileChromeOS* profile)> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 void ReleaseProfile(const device::BluetoothUUID& uuid); | 146 void ReleaseProfile(const device::BluetoothUUID& uuid); |
143 | 147 |
144 protected: | 148 protected: |
145 // BluetoothAdapter: | 149 // BluetoothAdapter: |
146 void RemovePairingDelegateInternal( | 150 void RemovePairingDelegateInternal( |
147 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; | 151 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; |
148 | 152 |
149 private: | 153 private: |
150 friend class base::DeleteHelper<BluetoothAdapterChromeOS>; | 154 friend class base::DeleteHelper<BluetoothAdapterChromeOS>; |
151 friend class BluetoothChromeOSTest; | 155 friend class BluetoothChromeOSTest; |
156 friend class BluetoothChromeOSTest_Shutdown_Test; | |
armansito
2015/02/19 01:44:47
Is this necessary? I thought the friendship above
scheib
2015/02/19 21:34:15
Yes, the previous friend only applies to the fixtu
armansito
2015/02/19 21:40:49
sgtm
| |
152 | 157 |
153 // typedef for callback parameters that are passed to AddDiscoverySession | 158 // typedef for callback parameters that are passed to AddDiscoverySession |
154 // and RemoveDiscoverySession. This is used to queue incoming requests while | 159 // and RemoveDiscoverySession. This is used to queue incoming requests while |
155 // a call to BlueZ is pending. | 160 // a call to BlueZ is pending. |
156 typedef std::pair<base::Closure, ErrorCallback> DiscoveryCallbackPair; | 161 typedef std::pair<base::Closure, ErrorCallback> DiscoveryCallbackPair; |
157 typedef std::queue<DiscoveryCallbackPair> DiscoveryCallbackQueue; | 162 typedef std::queue<DiscoveryCallbackPair> DiscoveryCallbackQueue; |
158 | 163 |
159 BluetoothAdapterChromeOS(); | 164 BluetoothAdapterChromeOS(); |
160 ~BluetoothAdapterChromeOS() override; | 165 ~BluetoothAdapterChromeOS() override; |
161 | 166 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 // Note: This should remain the last member so it'll be destroyed and | 334 // Note: This should remain the last member so it'll be destroyed and |
330 // invalidate its weak pointers before any other members are destroyed. | 335 // invalidate its weak pointers before any other members are destroyed. |
331 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; | 336 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; |
332 | 337 |
333 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); | 338 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); |
334 }; | 339 }; |
335 | 340 |
336 } // namespace chromeos | 341 } // namespace chromeos |
337 | 342 |
338 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ | 343 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ |
OLD | NEW |