Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: device/bluetooth/bluetooth_low_energy_device_mac.h

Issue 2221353002: Bluetooth: mac: Crash while loging nil error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ortuno comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_LOW_ENERGY_DEVICE_MAC_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
7 7
8 #if defined(OS_IOS) 8 #if defined(OS_IOS)
9 #import <CoreBluetooth/CoreBluetooth.h> 9 #import <CoreBluetooth/CoreBluetooth.h>
10 #else // !defined(OS_IOS) 10 #else // !defined(OS_IOS)
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 BluetoothAdapterMac* GetMacAdapter(); 121 BluetoothAdapterMac* GetMacAdapter();
122 122
123 // Returns the CoreBluetooth Peripheral. 123 // Returns the CoreBluetooth Peripheral.
124 CBPeripheral* GetPeripheral(); 124 CBPeripheral* GetPeripheral();
125 125
126 // Returns BluetoothRemoteGattServiceMac based on the CBService. 126 // Returns BluetoothRemoteGattServiceMac based on the CBService.
127 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService( 127 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService(
128 CBService* service) const; 128 CBService* service) const;
129 129
130 // Callback used when the CoreBluetooth Peripheral is disconnected. 130 // Callback used when the CoreBluetooth Peripheral is disconnected.
131 void DidDisconnectPeripheral();
131 void DidDisconnectPeripheral(BluetoothDevice::ConnectErrorCode error_code); 132 void DidDisconnectPeripheral(BluetoothDevice::ConnectErrorCode error_code);
132 133
134 // Remove all services.
135 void RemoveAllServices();
136
133 // CoreBluetooth data structure. 137 // CoreBluetooth data structure.
134 base::scoped_nsobject<CBPeripheral> peripheral_; 138 base::scoped_nsobject<CBPeripheral> peripheral_;
135 139
136 // Objective-C delegate for the CBPeripheral. 140 // Objective-C delegate for the CBPeripheral.
137 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate> 141 base::scoped_nsobject<BluetoothLowEnergyPeripheralDelegate>
138 peripheral_delegate_; 142 peripheral_delegate_;
139 143
140 // RSSI value. 144 // RSSI value.
141 int rssi_; 145 int rssi_;
142 146
143 // Whether the device is connectable. 147 // Whether the device is connectable.
144 bool connectable_; 148 bool connectable_;
145 149
146 // The peripheral's identifier, as returned by [CBPeripheral identifier]. 150 // The peripheral's identifier, as returned by [CBPeripheral identifier].
147 std::string identifier_; 151 std::string identifier_;
148 152
149 // A local address for the device created by hashing the peripheral 153 // A local address for the device created by hashing the peripheral
150 // identifier. 154 // identifier.
151 std::string hash_address_; 155 std::string hash_address_;
152 156
153 // The services (identified by UUIDs) that this device provides. 157 // The services (identified by UUIDs) that this device provides.
154 std::set<BluetoothUUID> advertised_uuids_; 158 std::set<BluetoothUUID> advertised_uuids_;
155 159
156 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); 160 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac);
157 }; 161 };
158 162
159 } // namespace device 163 } // namespace device
160 164
161 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ 165 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698