| 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_TASK_MANAGER_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 void PostSetPoweredBluetoothTask( | 59 void PostSetPoweredBluetoothTask( |
| 60 bool powered, | 60 bool powered, |
| 61 const base::Closure& callback, | 61 const base::Closure& callback, |
| 62 const BluetoothAdapter::ErrorCallback& error_callback); | 62 const BluetoothAdapter::ErrorCallback& error_callback); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 friend class base::RefCountedThreadSafe<BluetoothTaskManagerWin>; | 65 friend class base::RefCountedThreadSafe<BluetoothTaskManagerWin>; |
| 66 friend class BluetoothTaskManagerWinTest; | 66 friend class BluetoothTaskManagerWinTest; |
| 67 | 67 |
| 68 // Returns true if the machine has a bluetooth stack available. The first call | |
| 69 // to this function will involve file IO, so it should be done on an | |
| 70 // appropriate thread. This function is not threadsafe. | |
| 71 static bool HasBluetoothStack(); | |
| 72 | |
| 73 static const int kPollIntervalMs; | 68 static const int kPollIntervalMs; |
| 74 | 69 |
| 75 // Constructor to pass |ui_task_runner_| and |bluetooth_task_runner_| for | 70 // Constructor to pass |ui_task_runner_| and |bluetooth_task_runner_| for |
| 76 // testing. | 71 // testing. |
| 77 BluetoothTaskManagerWin( | 72 BluetoothTaskManagerWin( |
| 78 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | 73 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, |
| 79 scoped_refptr<base::SequencedTaskRunner> bluetooth_task_runner); | 74 scoped_refptr<base::SequencedTaskRunner> bluetooth_task_runner); |
| 80 | 75 |
| 81 virtual ~BluetoothTaskManagerWin(); | 76 virtual ~BluetoothTaskManagerWin(); |
| 82 | 77 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 102 | 97 |
| 103 // Adapter handle owned by bluetooth task runner. | 98 // Adapter handle owned by bluetooth task runner. |
| 104 base::win::ScopedHandle adapter_handle_; | 99 base::win::ScopedHandle adapter_handle_; |
| 105 | 100 |
| 106 DISALLOW_COPY_AND_ASSIGN(BluetoothTaskManagerWin); | 101 DISALLOW_COPY_AND_ASSIGN(BluetoothTaskManagerWin); |
| 107 }; | 102 }; |
| 108 | 103 |
| 109 } // namespace device | 104 } // namespace device |
| 110 | 105 |
| 111 #endif // DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ | 106 #endif // DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ |
| OLD | NEW |