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

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

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: Mac bustage Created 4 years 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 const std::vector<uint8_t>& value); 494 const std::vector<uint8_t>& value);
495 495
496 // The timeout in seconds used by RemoveTimedOutDevices. 496 // The timeout in seconds used by RemoveTimedOutDevices.
497 static const base::TimeDelta timeoutSec; 497 static const base::TimeDelta timeoutSec;
498 498
499 protected: 499 protected:
500 friend class base::RefCounted<BluetoothAdapter>; 500 friend class base::RefCounted<BluetoothAdapter>;
501 friend class BluetoothDiscoverySession; 501 friend class BluetoothDiscoverySession;
502 friend class BluetoothTestBase; 502 friend class BluetoothTestBase;
503 503
504 typedef base::ScopedPtrHashMap<std::string, std::unique_ptr<BluetoothDevice>> 504 using DevicesMap =
505 DevicesMap; 505 std::unordered_map<std::string, std::unique_ptr<BluetoothDevice>>;
506 typedef std::pair<BluetoothDevice::PairingDelegate*, PairingDelegatePriority> 506 using PairingDelegatePair =
507 PairingDelegatePair; 507 std::pair<BluetoothDevice::PairingDelegate*, PairingDelegatePriority>;
508 typedef base::Callback<void(UMABluetoothDiscoverySessionOutcome)> 508 using DiscoverySessionErrorCallback =
509 DiscoverySessionErrorCallback; 509 base::Callback<void(UMABluetoothDiscoverySessionOutcome)>;
510 510
511 BluetoothAdapter(); 511 BluetoothAdapter();
512 virtual ~BluetoothAdapter(); 512 virtual ~BluetoothAdapter();
513 513
514 // Internal methods for initiating and terminating device discovery sessions. 514 // Internal methods for initiating and terminating device discovery sessions.
515 // An implementation of BluetoothAdapter keeps an internal reference count to 515 // An implementation of BluetoothAdapter keeps an internal reference count to
516 // make sure that the underlying controller is constantly searching for nearby 516 // make sure that the underlying controller is constantly searching for nearby
517 // devices and retrieving information from them as long as there are clients 517 // devices and retrieving information from them as long as there are clients
518 // who have requested discovery. These methods behave in the following way: 518 // who have requested discovery. These methods behave in the following way:
519 // 519 //
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 std::set<BluetoothDiscoverySession*> discovery_sessions_; 633 std::set<BluetoothDiscoverySession*> discovery_sessions_;
634 634
635 // Note: This should remain the last member so it'll be destroyed and 635 // Note: This should remain the last member so it'll be destroyed and
636 // invalidate its weak pointers before any other members are destroyed. 636 // invalidate its weak pointers before any other members are destroyed.
637 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; 637 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_;
638 }; 638 };
639 639
640 } // namespace device 640 } // namespace device
641 641
642 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ 642 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_adapter.cc » ('j') | device/bluetooth/bluetooth_adapter_mac_unittest.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698