| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_discovery_session.h" | 5 #include "device/bluetooth/bluetooth_discovery_session.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 static void IgnoreDiscoveryOutcome( | 92 static void IgnoreDiscoveryOutcome( |
| 93 const base::Closure& error_callback, | 93 const base::Closure& error_callback, |
| 94 UMABluetoothDiscoverySessionOutcome outcome) { | 94 UMABluetoothDiscoverySessionOutcome outcome) { |
| 95 error_callback.Run(); | 95 error_callback.Run(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void BluetoothDiscoverySession::SetDiscoveryFilter( | 98 void BluetoothDiscoverySession::SetDiscoveryFilter( |
| 99 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, | 99 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, |
| 100 const base::Closure& callback, | 100 const base::Closure& callback, |
| 101 const ErrorCallback& error_callback) { | 101 const ErrorCallback& error_callback) { |
| 102 discovery_filter_.reset(discovery_filter.release()); | 102 discovery_filter_ = std::move(discovery_filter); |
| 103 // BluetoothDiscoverySession::SetDiscoveryFilter is only used from a private | 103 // BluetoothDiscoverySession::SetDiscoveryFilter is only used from a private |
| 104 // extension API, so we don't bother histogramming its failures. | 104 // extension API, so we don't bother histogramming its failures. |
| 105 adapter_->SetDiscoveryFilter( | 105 adapter_->SetDiscoveryFilter( |
| 106 adapter_->GetMergedDiscoveryFilter(), callback, | 106 adapter_->GetMergedDiscoveryFilter(), callback, |
| 107 base::Bind(&IgnoreDiscoveryOutcome, error_callback)); | 107 base::Bind(&IgnoreDiscoveryOutcome, error_callback)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 const BluetoothDiscoveryFilter* BluetoothDiscoverySession::GetDiscoveryFilter() | 110 const BluetoothDiscoveryFilter* BluetoothDiscoverySession::GetDiscoveryFilter() |
| 111 const { | 111 const { |
| 112 return discovery_filter_.get(); | 112 return discovery_filter_.get(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace device | 115 } // namespace device |
| OLD | NEW |