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

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_service_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
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "device/bluetooth/bluetooth_remote_gatt_service_mac.h" 5 #include "device/bluetooth/bluetooth_remote_gatt_service_mac.h"
6 6
7 #import <CoreBluetooth/CoreBluetooth.h> 7 #import <CoreBluetooth/CoreBluetooth.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 11 matching lines...) Expand all
22 CBService* service, 22 CBService* service,
23 bool is_primary) 23 bool is_primary)
24 : bluetooth_device_mac_(bluetooth_device_mac), 24 : bluetooth_device_mac_(bluetooth_device_mac),
25 service_(service, base::scoped_policy::RETAIN), 25 service_(service, base::scoped_policy::RETAIN),
26 is_primary_(is_primary), 26 is_primary_(is_primary),
27 is_discovery_complete_(false), 27 is_discovery_complete_(false),
28 discovery_pending_count_(0) { 28 discovery_pending_count_(0) {
29 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([service_.get() UUID]); 29 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([service_.get() UUID]);
30 identifier_ = base::SysNSStringToUTF8( 30 identifier_ = base::SysNSStringToUTF8(
31 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(), 31 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(),
32 (void*)service_]); 32 service_.get()]);
33 } 33 }
34 34
35 BluetoothRemoteGattServiceMac::~BluetoothRemoteGattServiceMac() {} 35 BluetoothRemoteGattServiceMac::~BluetoothRemoteGattServiceMac() {}
36 36
37 std::string BluetoothRemoteGattServiceMac::GetIdentifier() const { 37 std::string BluetoothRemoteGattServiceMac::GetIdentifier() const {
38 return identifier_; 38 return identifier_;
39 } 39 }
40 40
41 BluetoothUUID BluetoothRemoteGattServiceMac::GetUUID() const { 41 BluetoothUUID BluetoothRemoteGattServiceMac::GetUUID() const {
42 return uuid_; 42 return uuid_;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 const BluetoothRemoteGattServiceMac& service) { 240 const BluetoothRemoteGattServiceMac& service) {
241 const BluetoothLowEnergyDeviceMac* bluetooth_device_mac_ = 241 const BluetoothLowEnergyDeviceMac* bluetooth_device_mac_ =
242 static_cast<const BluetoothLowEnergyDeviceMac*>(service.GetDevice()); 242 static_cast<const BluetoothLowEnergyDeviceMac*>(service.GetDevice());
243 return out << "<BluetoothRemoteGattServiceMac " 243 return out << "<BluetoothRemoteGattServiceMac "
244 << service.GetUUID().canonical_value() << "/" << &service 244 << service.GetUUID().canonical_value() << "/" << &service
245 << ", device: " << bluetooth_device_mac_->GetAddress() << "/" 245 << ", device: " << bluetooth_device_mac_->GetAddress() << "/"
246 << bluetooth_device_mac_ << ">"; 246 << bluetooth_device_mac_ << ">";
247 } 247 }
248 248
249 } // namespace device 249 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698