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

Side by Side Diff: device/bluetooth/bluetooth_device.cc

Issue 2254833003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_device.h" 5 #include "device/bluetooth/bluetooth_device.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 void BluetoothDevice::ClearAdvertisementData() { 391 void BluetoothDevice::ClearAdvertisementData() {
392 device_uuids_.ClearAdvertisedUUIDs(); 392 device_uuids_.ClearAdvertisedUUIDs();
393 service_data_.clear(); 393 service_data_.clear();
394 GetAdapter()->NotifyDeviceChanged(this); 394 GetAdapter()->NotifyDeviceChanged(this);
395 } 395 }
396 396
397 void BluetoothDevice::DidConnectGatt() { 397 void BluetoothDevice::DidConnectGatt() {
398 for (const auto& callback : create_gatt_connection_success_callbacks_) { 398 for (const auto& callback : create_gatt_connection_success_callbacks_) {
399 callback.Run( 399 callback.Run(
400 base::WrapUnique(new BluetoothGattConnection(adapter_, GetAddress()))); 400 base::MakeUnique<BluetoothGattConnection>(adapter_, GetAddress()));
401 } 401 }
402 create_gatt_connection_success_callbacks_.clear(); 402 create_gatt_connection_success_callbacks_.clear();
403 create_gatt_connection_error_callbacks_.clear(); 403 create_gatt_connection_error_callbacks_.clear();
404 GetAdapter()->NotifyDeviceChanged(this); 404 GetAdapter()->NotifyDeviceChanged(this);
405 } 405 }
406 406
407 void BluetoothDevice::DidFailToConnectGatt(ConnectErrorCode error) { 407 void BluetoothDevice::DidFailToConnectGatt(ConnectErrorCode error) {
408 // Connection request should only be made if there are no active 408 // Connection request should only be made if there are no active
409 // connections. 409 // connections.
410 DCHECK(gatt_connections_.empty()); 410 DCHECK(gatt_connections_.empty());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 const base::Closure& callback, 451 const base::Closure& callback,
452 const ConnectErrorCallback& error_callback) { 452 const ConnectErrorCallback& error_callback) {
453 NOTREACHED(); 453 NOTREACHED();
454 } 454 }
455 455
456 void BluetoothDevice::UpdateTimestamp() { 456 void BluetoothDevice::UpdateTimestamp() {
457 last_update_time_ = base::Time::NowFromSystemTime(); 457 last_update_time_ = base::Time::NowFromSystemTime();
458 } 458 }
459 459
460 } // namespace device 460 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_advertisement_unittest.cc ('k') | device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698