summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_socket_mac.mm
diff options
context:
space:
mode:
authorjlebel <jlebel@chromium.org>2016-02-23 19:38:59 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-24 03:41:17 +0000
commitad0d07421f17d5d822994cf906412f0d9788d500 (patch)
tree2f446b8afabba3d2517dc40a1e42c71567fd6057 /device/bluetooth/bluetooth_socket_mac.mm
parent29d9194bbcd704fdea127244e2321ef3a1e4de06 (diff)
downloadchromium_src-ad0d07421f17d5d822994cf906412f0d9788d500.zip
chromium_src-ad0d07421f17d5d822994cf906412f0d9788d500.tar.gz
chromium_src-ad0d07421f17d5d822994cf906412f0d9788d500.tar.bz2
Chrome doesn't need to compile on 10.6, cleaning up the code
BUG= Review URL: https://codereview.chromium.org/1712183002 Cr-Commit-Position: refs/heads/master@{#377208}
Diffstat (limited to 'device/bluetooth/bluetooth_socket_mac.mm')
-rw-r--r--device/bluetooth/bluetooth_socket_mac.mm48
1 files changed, 22 insertions, 26 deletions
diff --git a/device/bluetooth/bluetooth_socket_mac.mm b/device/bluetooth/bluetooth_socket_mac.mm
index c82e5d2..235168a 100644
--- a/device/bluetooth/bluetooth_socket_mac.mm
+++ b/device/bluetooth/bluetooth_socket_mac.mm
@@ -264,7 +264,7 @@ IOBluetoothSDPUUID* GetIOBluetoothSDPUUID(const BluetoothUUID& uuid) {
// Converts the given |integer| to a string.
NSString* IntToNSString(int integer) {
- return [[NSNumber numberWithInt:integer] stringValue];
+ return [@(integer) stringValue];
}
// Returns a dictionary containing the Bluetooth service definition
@@ -305,20 +305,17 @@ NSDictionary* BuildRfcommServiceDefinition(
const BluetoothUUID& uuid,
const BluetoothAdapter::ServiceOptions& options) {
int channel_id = options.channel ? *options.channel : kInvalidRfcommChannelId;
- NSArray* rfcomm_protocol_definition =
- @[
- @[
- [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16L2CAP]
- ],
- @[
- [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16RFCOMM],
- @{
- @"DataElementType": @1, // Unsigned integer.
- @"DataElementSize": @1, // 1 byte.
- @"DataElementValue": [NSNumber numberWithInt:channel_id]
- }
- ]
- ];
+ NSArray* rfcomm_protocol_definition = @[
+ @[ [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16L2CAP] ],
+ @[
+ [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16RFCOMM],
+ @{
+ @"DataElementType" : @1, // Unsigned integer.
+ @"DataElementSize" : @1, // 1 byte.
+ @"DataElementValue" : @(channel_id),
+ },
+ ],
+ ];
return BuildServiceDefinition(
uuid, options.name.get(), rfcomm_protocol_definition);
}
@@ -329,17 +326,16 @@ NSDictionary* BuildL2capServiceDefinition(
const BluetoothUUID& uuid,
const BluetoothAdapter::ServiceOptions& options) {
int psm = options.psm ? *options.psm : kInvalidL2capPsm;
- NSArray* l2cap_protocol_definition =
- @[
- @[
- [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16L2CAP],
- @{
- @"DataElementType": @1, // Unsigned integer.
- @"DataElementSize": @2, // 2 bytes.
- @"DataElementValue": [NSNumber numberWithInt:psm]
- }
- ]
- ];
+ NSArray* l2cap_protocol_definition = @[
+ @[
+ [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16L2CAP],
+ @{
+ @"DataElementType" : @1, // Unsigned integer.
+ @"DataElementSize" : @2, // 2 bytes.
+ @"DataElementValue" : @(psm),
+ },
+ ],
+ ];
return BuildServiceDefinition(
uuid, options.name.get(), l2cap_protocol_definition);
}