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

Side by Side Diff: device/bluetooth/bluetooth_adapter.h

Issue 1842223003: Remove outdated devices from Android device chooser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test for ItemChooserDialog Created 4 years, 8 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 (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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 void NotifyGattCharacteristicRemoved( 416 void NotifyGattCharacteristicRemoved(
417 BluetoothGattCharacteristic* characteristic); 417 BluetoothGattCharacteristic* characteristic);
418 void NotifyGattDescriptorAdded(BluetoothGattDescriptor* descriptor); 418 void NotifyGattDescriptorAdded(BluetoothGattDescriptor* descriptor);
419 void NotifyGattDescriptorRemoved(BluetoothGattDescriptor* descriptor); 419 void NotifyGattDescriptorRemoved(BluetoothGattDescriptor* descriptor);
420 void NotifyGattCharacteristicValueChanged( 420 void NotifyGattCharacteristicValueChanged(
421 BluetoothGattCharacteristic* characteristic, 421 BluetoothGattCharacteristic* characteristic,
422 const std::vector<uint8_t>& value); 422 const std::vector<uint8_t>& value);
423 void NotifyGattDescriptorValueChanged(BluetoothGattDescriptor* descriptor, 423 void NotifyGattDescriptorValueChanged(BluetoothGattDescriptor* descriptor,
424 const std::vector<uint8_t>& value); 424 const std::vector<uint8_t>& value);
425 425
426 // Removes from |devices_| any previously paired, connected or seen
427 // devices which are no longer present. Notifies observers. Note:
428 // this is only used by platforms where there is no notification of
429 // lost devices.
430 void RemoveTimedOutDevices();
scheib 2016/04/07 22:05:02 This seems odd to me to be called externally. Inst
perja 2016/04/08 07:47:35 Yeah, we could do that instead I guess. The recurr
scheib 2016/04/12 05:01:57 Tricky. Because it doesn't affect only the cache.
431
432 // The timeout in seconds used by RemoveTimedOutDevices.
433 static const base::TimeDelta timeoutSec;
434
426 protected: 435 protected:
427 friend class base::RefCounted<BluetoothAdapter>; 436 friend class base::RefCounted<BluetoothAdapter>;
428 friend class BluetoothDiscoverySession; 437 friend class BluetoothDiscoverySession;
429 friend class BluetoothTestBase; 438 friend class BluetoothTestBase;
430 439
431 typedef base::ScopedPtrHashMap<std::string, scoped_ptr<BluetoothDevice>> 440 typedef base::ScopedPtrHashMap<std::string, scoped_ptr<BluetoothDevice>>
432 DevicesMap; 441 DevicesMap;
433 typedef std::pair<BluetoothDevice::PairingDelegate*, PairingDelegatePriority> 442 typedef std::pair<BluetoothDevice::PairingDelegate*, PairingDelegatePriority>
434 PairingDelegatePair; 443 PairingDelegatePair;
435 typedef base::Callback<void(UMABluetoothDiscoverySessionOutcome)> 444 typedef base::Callback<void(UMABluetoothDiscoverySessionOutcome)>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 std::set<BluetoothDiscoverySession*> discovery_sessions_; 563 std::set<BluetoothDiscoverySession*> discovery_sessions_;
555 564
556 // Note: This should remain the last member so it'll be destroyed and 565 // Note: This should remain the last member so it'll be destroyed and
557 // invalidate its weak pointers before any other members are destroyed. 566 // invalidate its weak pointers before any other members are destroyed.
558 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; 567 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_;
559 }; 568 };
560 569
561 } // namespace device 570 } // namespace device
562 571
563 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ 572 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698