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

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

Issue 1965023002: Finish https://codereview.chromium.org/1948763003 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split code Created 4 years, 7 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 | « no previous file | 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 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 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h"
6 6
7 #import <CoreFoundation/CoreFoundation.h> 7 #import <CoreFoundation/CoreFoundation.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 << error.localizedDescription.UTF8String << " (" << error.domain 245 << error.localizedDescription.UTF8String << " (" << error.domain
246 << ": " << error.code << ")"; 246 << ": " << error.code << ")";
247 return; 247 return;
248 } 248 }
249 for (CBService* cb_service in GetPeripheral().services) { 249 for (CBService* cb_service in GetPeripheral().services) {
250 BluetoothRemoteGattServiceMac* gatt_service = 250 BluetoothRemoteGattServiceMac* gatt_service =
251 GetBluetoothRemoteGattService(cb_service); 251 GetBluetoothRemoteGattService(cb_service);
252 if (!gatt_service) { 252 if (!gatt_service) {
253 gatt_service = new BluetoothRemoteGattServiceMac(this, cb_service, 253 gatt_service = new BluetoothRemoteGattServiceMac(this, cb_service,
254 true /* is_primary */); 254 true /* is_primary */);
255 gatt_services_.add(gatt_service->GetIdentifier(), 255 auto result_iter = gatt_services_.add(gatt_service->GetIdentifier(),
256 base::WrapUnique(gatt_service)); 256 base::WrapUnique(gatt_service));
257 DCHECK(result_iter.second);
257 adapter_->NotifyGattServiceAdded(gatt_service); 258 adapter_->NotifyGattServiceAdded(gatt_service);
258 } 259 }
259 } 260 }
260 // TODO(http://crbug.com/609064): Services are fully discovered once all 261 // TODO(http://crbug.com/609064): Services are fully discovered once all
261 // characteristics have been found. 262 // characteristics have been found.
262 SetGattServicesDiscoveryComplete(true); 263 SetGattServicesDiscoveryComplete(true);
263 adapter_->NotifyGattServicesDiscovered(this); 264 adapter_->NotifyGattServicesDiscovered(this);
264 } 265 }
265 266
266 void BluetoothLowEnergyDeviceMac::DidModifyServices( 267 void BluetoothLowEnergyDeviceMac::DidModifyServices(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 for (const auto& key : service_keys) { 332 for (const auto& key : service_keys) {
332 gatt_services_.take_and_erase(key); 333 gatt_services_.take_and_erase(key);
333 } 334 }
334 if (create_gatt_connection_error_callbacks_.empty()) { 335 if (create_gatt_connection_error_callbacks_.empty()) {
335 // TODO(http://crbug.com/585897): Need to pass the error. 336 // TODO(http://crbug.com/585897): Need to pass the error.
336 DidDisconnectGatt(); 337 DidDisconnectGatt();
337 } else { 338 } else {
338 DidFailToConnectGatt(error_code); 339 DidFailToConnectGatt(error_code);
339 } 340 }
340 } 341 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698