Chromium Code Reviews| 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_adapter.h" | 5 #include "device/bluetooth/bluetooth_adapter.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { | 48 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { |
| 49 DCHECK(observer); | 49 DCHECK(observer); |
| 50 observers_.AddObserver(observer); | 50 observers_.AddObserver(observer); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) { | 53 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) { |
| 54 DCHECK(observer); | 54 DCHECK(observer); |
| 55 observers_.RemoveObserver(observer); | 55 observers_.RemoveObserver(observer); |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool BluetoothAdapter::HasObserver(BluetoothAdapter::Observer* observer) { | |
| 59 return observers_.HasObserver(observer); | |
|
rkc
2016/08/08 23:53:33
Before this line,
DCHECK(observer);
puthik_chromium
2016/08/09 00:08:57
Added.
Actually, It would just return false if obs
| |
| 60 } | |
| 61 | |
| 58 void BluetoothAdapter::StartDiscoverySession( | 62 void BluetoothAdapter::StartDiscoverySession( |
| 59 const DiscoverySessionCallback& callback, | 63 const DiscoverySessionCallback& callback, |
| 60 const ErrorCallback& error_callback) { | 64 const ErrorCallback& error_callback) { |
| 61 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); | 65 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); |
| 62 } | 66 } |
| 63 | 67 |
| 64 void BluetoothAdapter::StartDiscoverySessionWithFilter( | 68 void BluetoothAdapter::StartDiscoverySessionWithFilter( |
| 65 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, | 69 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, |
| 66 const DiscoverySessionCallback& callback, | 70 const DiscoverySessionCallback& callback, |
| 67 const ErrorCallback& error_callback) { | 71 const ErrorCallback& error_callback) { |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 UMA_HISTOGRAM_ENUMERATION( | 415 UMA_HISTOGRAM_ENUMERATION( |
| 412 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), | 416 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), |
| 413 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); | 417 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); |
| 414 } | 418 } |
| 415 | 419 |
| 416 // static | 420 // static |
| 417 const base::TimeDelta BluetoothAdapter::timeoutSec = | 421 const base::TimeDelta BluetoothAdapter::timeoutSec = |
| 418 base::TimeDelta::FromSeconds(180); | 422 base::TimeDelta::FromSeconds(180); |
| 419 | 423 |
| 420 } // namespace device | 424 } // namespace device |
| OLD | NEW |