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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 329 } |
330 | 330 |
331 std::unique_ptr<BluetoothDiscoveryFilter> | 331 std::unique_ptr<BluetoothDiscoveryFilter> |
332 BluetoothAdapter::GetMergedDiscoveryFilterHelper( | 332 BluetoothAdapter::GetMergedDiscoveryFilterHelper( |
333 const BluetoothDiscoveryFilter* masked_filter, | 333 const BluetoothDiscoveryFilter* masked_filter, |
334 bool omit) const { | 334 bool omit) const { |
335 std::unique_ptr<BluetoothDiscoveryFilter> result; | 335 std::unique_ptr<BluetoothDiscoveryFilter> result; |
336 bool first_merge = true; | 336 bool first_merge = true; |
337 | 337 |
338 std::set<BluetoothDiscoverySession*> temp(discovery_sessions_); | 338 std::set<BluetoothDiscoverySession*> temp(discovery_sessions_); |
339 for (const auto& iter : temp) { | 339 for (auto* iter : temp) { |
340 const BluetoothDiscoveryFilter* curr_filter = iter->GetDiscoveryFilter(); | 340 const BluetoothDiscoveryFilter* curr_filter = iter->GetDiscoveryFilter(); |
341 | 341 |
342 if (!iter->IsActive()) | 342 if (!iter->IsActive()) |
343 continue; | 343 continue; |
344 | 344 |
345 if (omit && curr_filter == masked_filter) { | 345 if (omit && curr_filter == masked_filter) { |
346 // if masked_filter is pointing to empty filter, and there are | 346 // if masked_filter is pointing to empty filter, and there are |
347 // multiple empty filters in discovery_sessions_, make sure we'll | 347 // multiple empty filters in discovery_sessions_, make sure we'll |
348 // process next empty sessions. | 348 // process next empty sessions. |
349 omit = false; | 349 omit = false; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 UMA_HISTOGRAM_ENUMERATION( | 411 UMA_HISTOGRAM_ENUMERATION( |
412 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), | 412 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), |
413 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); | 413 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); |
414 } | 414 } |
415 | 415 |
416 // static | 416 // static |
417 const base::TimeDelta BluetoothAdapter::timeoutSec = | 417 const base::TimeDelta BluetoothAdapter::timeoutSec = |
418 base::TimeDelta::FromSeconds(180); | 418 base::TimeDelta::FromSeconds(180); |
419 | 419 |
420 } // namespace device | 420 } // namespace device |
OLD | NEW |