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

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm

Issue 2906923002: bluetooth: macOS: Remove c-style casting (Closed)
Patch Set: Merge from top of tree Created 3 years, 6 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_remote_gatt_descriptor_mac.h" 5 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #import "base/mac/foundation_util.h" 8 #import "base/mac/foundation_util.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 BluetoothRemoteGattDescriptorMac::BluetoothRemoteGattDescriptorMac( 45 BluetoothRemoteGattDescriptorMac::BluetoothRemoteGattDescriptorMac(
46 BluetoothRemoteGattCharacteristicMac* characteristic, 46 BluetoothRemoteGattCharacteristicMac* characteristic,
47 CBDescriptor* descriptor) 47 CBDescriptor* descriptor)
48 : gatt_characteristic_(characteristic), 48 : gatt_characteristic_(characteristic),
49 cb_descriptor_(descriptor, base::scoped_policy::RETAIN), 49 cb_descriptor_(descriptor, base::scoped_policy::RETAIN),
50 value_read_or_write_in_progress_(false) { 50 value_read_or_write_in_progress_(false) {
51 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([cb_descriptor_ UUID]); 51 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([cb_descriptor_ UUID]);
52 identifier_ = base::SysNSStringToUTF8( 52 identifier_ = base::SysNSStringToUTF8(
53 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(), 53 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(),
54 (void*)cb_descriptor_]); 54 cb_descriptor_.get()]);
55 } 55 }
56 56
57 std::string BluetoothRemoteGattDescriptorMac::GetIdentifier() const { 57 std::string BluetoothRemoteGattDescriptorMac::GetIdentifier() const {
58 return identifier_; 58 return identifier_;
59 } 59 }
60 60
61 BluetoothUUID BluetoothRemoteGattDescriptorMac::GetUUID() const { 61 BluetoothUUID BluetoothRemoteGattDescriptorMac::GetUUID() const {
62 return uuid_; 62 return uuid_;
63 } 63 }
64 64
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 static_cast<const BluetoothRemoteGattCharacteristicMac*>( 190 static_cast<const BluetoothRemoteGattCharacteristicMac*>(
191 descriptor.GetCharacteristic()); 191 descriptor.GetCharacteristic());
192 return out << "<BluetoothRemoteGattDescriptorMac " 192 return out << "<BluetoothRemoteGattDescriptorMac "
193 << descriptor.GetUUID().canonical_value() << "/" << &descriptor 193 << descriptor.GetUUID().canonical_value() << "/" << &descriptor
194 << ", characteristic: " 194 << ", characteristic: "
195 << characteristic_mac->GetUUID().canonical_value() << "/" 195 << characteristic_mac->GetUUID().canonical_value() << "/"
196 << characteristic_mac << ">"; 196 << characteristic_mac << ">";
197 } 197 }
198 198
199 } // namespace device. 199 } // namespace device.
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm ('k') | device/bluetooth/bluetooth_remote_gatt_service_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698