Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: device/bluetooth/bluez/bluetooth_adapter_bluez.cc

Issue 2860963002: Spell success correctly. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/bluez/bluetooth_adapter_bluez.h" 5 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstdint> 8 #include <cstdint>
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 1448
1449 void BluetoothAdapterBlueZ::SetDiscoveryFilter( 1449 void BluetoothAdapterBlueZ::SetDiscoveryFilter(
1450 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, 1450 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter,
1451 const base::Closure& callback, 1451 const base::Closure& callback,
1452 const DiscoverySessionErrorCallback& error_callback) { 1452 const DiscoverySessionErrorCallback& error_callback) {
1453 if (!IsPresent()) { 1453 if (!IsPresent()) {
1454 error_callback.Run(UMABluetoothDiscoverySessionOutcome::ADAPTER_REMOVED); 1454 error_callback.Run(UMABluetoothDiscoverySessionOutcome::ADAPTER_REMOVED);
1455 return; 1455 return;
1456 } 1456 }
1457 1457
1458 // If old and new filter are equal (null) then don't make request, just call 1458 // If the old and new filter are both null and equal then don't make the
dschuyler 2017/05/04 22:43:52 s/ and equal//
Lei Zhang 2017/05/17 21:14:39 Done.
1459 // succes callback 1459 // request, and just call the success callback.
1460 if (!current_filter_ && !discovery_filter.get()) { 1460 // Do the same if the old and new filter are both not null and equal.
1461 if ((!current_filter_ && !discovery_filter.get()) ||
1462 (current_filter_ && discovery_filter &&
1463 current_filter_->Equals(*discovery_filter))) {
1461 callback.Run(); 1464 callback.Run();
1462 return; 1465 return;
1463 } 1466 }
1464
1465 // If old and new filter are not null and equal then don't make request, just
1466 // call succes callback
1467 if (current_filter_ && discovery_filter &&
1468 current_filter_->Equals(*discovery_filter)) {
1469 callback.Run();
1470 return;
1471 }
1472 1467
1473 current_filter_ = std::move(discovery_filter); 1468 current_filter_ = std::move(discovery_filter);
1474 1469
1475 bluez::BluetoothAdapterClient::DiscoveryFilter dbus_discovery_filter; 1470 bluez::BluetoothAdapterClient::DiscoveryFilter dbus_discovery_filter;
1476 1471
1477 if (current_filter_.get()) { 1472 if (current_filter_.get()) {
1478 uint16_t pathloss; 1473 uint16_t pathloss;
1479 int16_t rssi; 1474 int16_t rssi;
1480 uint8_t transport; 1475 uint8_t transport;
1481 std::set<device::BluetoothUUID> uuids; 1476 std::set<device::BluetoothUUID> uuids;
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) { 1748 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) {
1754 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS; 1749 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS;
1755 } else if (error_name == bluetooth_adapter::kErrorNotReady) { 1750 } else if (error_name == bluetooth_adapter::kErrorNotReady) {
1756 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY; 1751 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY;
1757 } 1752 }
1758 1753
1759 error_callback.Run(code); 1754 error_callback.Run(code);
1760 } 1755 }
1761 1756
1762 } // namespace bluez 1757 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698