| Index: device/bluetooth/test/bluetooth_test_mac.mm
|
| diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
|
| index 73527a2bbafe639696dab33a984c6f43d2ece5e2..cc4b8d85f108e4324b61616c904472b36a309f8d 100644
|
| --- a/device/bluetooth/test/bluetooth_test_mac.mm
|
| +++ b/device/bluetooth/test/bluetooth_test_mac.mm
|
| @@ -41,18 +41,20 @@ explicit ScopedMockCentralManager(MockCentralManager* mock_central_manager) {
|
|
|
| namespace {
|
|
|
| -NSDictionary* CreateAdvertisementData(NSString* name, NSArray* uuids) {
|
| - NSMutableDictionary* advertisement_data =
|
| +scoped_nsobject<NSDictionary> CreateAdvertisementData(NSString* name,
|
| + NSArray* uuids) {
|
| + NSMutableDictionary* advertisement_data(
|
| [NSMutableDictionary dictionaryWithDictionary:@{
|
| CBAdvertisementDataLocalNameKey : name,
|
| CBAdvertisementDataServiceDataKey : @{},
|
| CBAdvertisementDataIsConnectable : @(YES),
|
| - }];
|
| + }]);
|
| if (uuids) {
|
| [advertisement_data setObject:uuids
|
| forKey:CBAdvertisementDataServiceUUIDsKey];
|
| }
|
| - return [advertisement_data retain];
|
| + return scoped_nsobject<NSDictionary>(advertisement_data,
|
| + base::scoped_policy::RETAIN);
|
| }
|
|
|
| } // namespace
|
| @@ -229,7 +231,7 @@ explicit ScopedMockCentralManager(MockCentralManager* mock_central_manager) {
|
| static_cast<BluetoothLowEnergyDeviceMac*>(device);
|
| CBPeripheral* peripheral = device_mac->GetPeripheral();
|
| MockCBPeripheral* peripheral_mock = ObjCCast<MockCBPeripheral>(peripheral);
|
| - scoped_nsobject<NSMutableArray> services = [[NSMutableArray alloc] init];
|
| + scoped_nsobject<NSMutableArray> services([[NSMutableArray alloc] init]);
|
| for (auto uuid : uuids) {
|
| CBUUID* cb_service_uuid = [CBUUID UUIDWithString:@(uuid.c_str())];
|
| [services addObject:cb_service_uuid];
|
|
|