| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 void BluetoothAdapter::StartDiscoverySession( | 68 void BluetoothAdapter::StartDiscoverySession( |
| 69 const DiscoverySessionCallback& callback, | 69 const DiscoverySessionCallback& callback, |
| 70 const ErrorCallback& error_callback) { | 70 const ErrorCallback& error_callback) { |
| 71 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); | 71 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void BluetoothAdapter::StartDiscoverySessionWithFilter( | 74 void BluetoothAdapter::StartDiscoverySessionWithFilter( |
| 75 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, | 75 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, |
| 76 const DiscoverySessionCallback& callback, | 76 const DiscoverySessionCallback& callback, |
| 77 const ErrorCallback& error_callback) { | 77 const ErrorCallback& error_callback) { |
| 78 LOG(ERROR) << "[DJKim] BluetoothAdapter::StartDiscoverySessionWithFilter >> st
art"; |
| 78 BluetoothDiscoveryFilter* ptr = discovery_filter.get(); | 79 BluetoothDiscoveryFilter* ptr = discovery_filter.get(); |
| 79 AddDiscoverySession( | 80 AddDiscoverySession( |
| 80 ptr, base::Bind(&BluetoothAdapter::OnStartDiscoverySession, | 81 ptr, base::Bind(&BluetoothAdapter::OnStartDiscoverySession, |
| 81 weak_ptr_factory_.GetWeakPtr(), | 82 weak_ptr_factory_.GetWeakPtr(), |
| 82 base::Passed(&discovery_filter), callback), | 83 base::Passed(&discovery_filter), callback), |
| 83 base::Bind(&BluetoothAdapter::OnStartDiscoverySessionError, | 84 base::Bind(&BluetoothAdapter::OnStartDiscoverySessionError, |
| 84 weak_ptr_factory_.GetWeakPtr(), error_callback)); | 85 weak_ptr_factory_.GetWeakPtr(), error_callback)); |
| 86 LOG(ERROR) << "[DJKim] BluetoothAdapter::StartDiscoverySessionWithFilter >> en
d"; |
| 85 } | 87 } |
| 86 | 88 |
| 87 std::unique_ptr<BluetoothDiscoveryFilter> | 89 std::unique_ptr<BluetoothDiscoveryFilter> |
| 88 BluetoothAdapter::GetMergedDiscoveryFilter() const { | 90 BluetoothAdapter::GetMergedDiscoveryFilter() const { |
| 89 return GetMergedDiscoveryFilterHelper(nullptr, false); | 91 return GetMergedDiscoveryFilterHelper(nullptr, false); |
| 90 } | 92 } |
| 91 | 93 |
| 92 std::unique_ptr<BluetoothDiscoveryFilter> | 94 std::unique_ptr<BluetoothDiscoveryFilter> |
| 93 BluetoothAdapter::GetMergedDiscoveryFilterMasked( | 95 BluetoothAdapter::GetMergedDiscoveryFilterMasked( |
| 94 BluetoothDiscoveryFilter* masked_filter) const { | 96 BluetoothDiscoveryFilter* masked_filter) const { |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 UMA_HISTOGRAM_ENUMERATION( | 422 UMA_HISTOGRAM_ENUMERATION( |
| 421 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), | 423 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), |
| 422 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); | 424 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); |
| 423 } | 425 } |
| 424 | 426 |
| 425 // static | 427 // static |
| 426 const base::TimeDelta BluetoothAdapter::timeoutSec = | 428 const base::TimeDelta BluetoothAdapter::timeoutSec = |
| 427 base::TimeDelta::FromSeconds(180); | 429 base::TimeDelta::FromSeconds(180); |
| 428 | 430 |
| 429 } // namespace device | 431 } // namespace device |
| OLD | NEW |