| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "device/bluetooth/bluetooth_adapter.h" | 17 #include "device/bluetooth/bluetooth_adapter.h" |
| 18 #include "device/bluetooth/bluetooth_task_manager_win.h" | 18 #include "device/bluetooth/bluetooth_task_manager_win.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class SequencedTaskRunner; | 21 class SequencedTaskRunner; |
| 22 class Thread; | 22 class Thread; |
| 23 } // namespace base | 23 } // namespace base |
| 24 | 24 |
| 25 namespace device { | 25 namespace device { |
| 26 | 26 |
| 27 class BluetoothAdapterWinTest; | 27 class BluetoothAdapterWinTest; |
| 28 class BluetoothDevice; | 28 class BluetoothDevice; |
| 29 class BluetoothSocketThreadWin; | 29 class BluetoothSocketThread; |
| 30 | 30 |
| 31 class BluetoothAdapterWin : public BluetoothAdapter, | 31 class BluetoothAdapterWin : public BluetoothAdapter, |
| 32 public BluetoothTaskManagerWin::Observer { | 32 public BluetoothTaskManagerWin::Observer { |
| 33 public: | 33 public: |
| 34 static base::WeakPtr<BluetoothAdapter> CreateAdapter( | 34 static base::WeakPtr<BluetoothAdapter> CreateAdapter( |
| 35 const InitCallback& init_callback); | 35 const InitCallback& init_callback); |
| 36 | 36 |
| 37 // BluetoothAdapter: | 37 // BluetoothAdapter: |
| 38 virtual void AddObserver(BluetoothAdapter::Observer* observer) OVERRIDE; | 38 virtual void AddObserver(BluetoothAdapter::Observer* observer) OVERRIDE; |
| 39 virtual void RemoveObserver(BluetoothAdapter::Observer* observer) OVERRIDE; | 39 virtual void RemoveObserver(BluetoothAdapter::Observer* observer) OVERRIDE; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 bool powered_; | 120 bool powered_; |
| 121 DiscoveryStatus discovery_status_; | 121 DiscoveryStatus discovery_status_; |
| 122 base::hash_set<std::string> discovered_devices_; | 122 base::hash_set<std::string> discovered_devices_; |
| 123 | 123 |
| 124 std::vector<std::pair<base::Closure, ErrorCallback> > | 124 std::vector<std::pair<base::Closure, ErrorCallback> > |
| 125 on_start_discovery_callbacks_; | 125 on_start_discovery_callbacks_; |
| 126 std::vector<base::Closure> on_stop_discovery_callbacks_; | 126 std::vector<base::Closure> on_stop_discovery_callbacks_; |
| 127 size_t num_discovery_listeners_; | 127 size_t num_discovery_listeners_; |
| 128 | 128 |
| 129 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 129 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 130 scoped_refptr<BluetoothSocketThreadWin> socket_thread_; | 130 scoped_refptr<BluetoothSocketThread> socket_thread_; |
| 131 scoped_refptr<BluetoothTaskManagerWin> task_manager_; | 131 scoped_refptr<BluetoothTaskManagerWin> task_manager_; |
| 132 | 132 |
| 133 base::ThreadChecker thread_checker_; | 133 base::ThreadChecker thread_checker_; |
| 134 | 134 |
| 135 // List of observers interested in event notifications from us. | 135 // List of observers interested in event notifications from us. |
| 136 ObserverList<BluetoothAdapter::Observer> observers_; | 136 ObserverList<BluetoothAdapter::Observer> observers_; |
| 137 | 137 |
| 138 // NOTE: This should remain the last member so it'll be destroyed and | 138 // NOTE: This should remain the last member so it'll be destroyed and |
| 139 // invalidate its weak pointers before any other members are destroyed. | 139 // invalidate its weak pointers before any other members are destroyed. |
| 140 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_; | 140 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_; |
| 141 | 141 |
| 142 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin); | 142 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace device | 145 } // namespace device |
| 146 | 146 |
| 147 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ | 147 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ |
| OLD | NEW |