| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |