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

Side by Side Diff: trunk/src/device/bluetooth/bluetooth_adapter_win.h

Issue 227493006: Revert 262175 "* Replace "read" method with onReceiveXxx events." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | Annotate | Revision Log
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_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
21 class SequencedTaskRunner; 22 class SequencedTaskRunner;
22 class Thread; 23
23 } // namespace base 24 } // namespace base
24 25
25 namespace device { 26 namespace device {
26 27
27 class BluetoothAdapterFactory; 28 class BluetoothAdapterFactory;
28 class BluetoothAdapterWinTest; 29 class BluetoothAdapterWinTest;
29 class BluetoothDevice; 30 class BluetoothDevice;
30 class BluetoothSocketThreadWin;
31 31
32 class BluetoothAdapterWin : public BluetoothAdapter, 32 class BluetoothAdapterWin : public BluetoothAdapter,
33 public BluetoothTaskManagerWin::Observer { 33 public BluetoothTaskManagerWin::Observer {
34 public: 34 public:
35 typedef base::Callback<void()> InitCallback; 35 typedef base::Callback<void()> InitCallback;
36 36
37 // BluetoothAdapter override 37 // BluetoothAdapter override
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;
40 virtual std::string GetAddress() const OVERRIDE; 40 virtual std::string GetAddress() const OVERRIDE;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 bool powered_; 114 bool powered_;
115 DiscoveryStatus discovery_status_; 115 DiscoveryStatus discovery_status_;
116 base::hash_set<std::string> discovered_devices_; 116 base::hash_set<std::string> discovered_devices_;
117 117
118 std::vector<std::pair<base::Closure, ErrorCallback> > 118 std::vector<std::pair<base::Closure, ErrorCallback> >
119 on_start_discovery_callbacks_; 119 on_start_discovery_callbacks_;
120 std::vector<base::Closure> on_stop_discovery_callbacks_; 120 std::vector<base::Closure> on_stop_discovery_callbacks_;
121 size_t num_discovery_listeners_; 121 size_t num_discovery_listeners_;
122 122
123 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; 123 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
124 scoped_refptr<BluetoothSocketThreadWin> socket_thread_;
125 scoped_refptr<BluetoothTaskManagerWin> task_manager_; 124 scoped_refptr<BluetoothTaskManagerWin> task_manager_;
126 125
127 base::ThreadChecker thread_checker_; 126 base::ThreadChecker thread_checker_;
128 127
129 // List of observers interested in event notifications from us. 128 // List of observers interested in event notifications from us.
130 ObserverList<BluetoothAdapter::Observer> observers_; 129 ObserverList<BluetoothAdapter::Observer> observers_;
131 130
132 // NOTE: This should remain the last member so it'll be destroyed and 131 // NOTE: This should remain the last member so it'll be destroyed and
133 // invalidate its weak pointers before any other members are destroyed. 132 // invalidate its weak pointers before any other members are destroyed.
134 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_; 133 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_;
135 134
136 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin); 135 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin);
137 }; 136 };
138 137
139 } // namespace device 138 } // namespace device
140 139
141 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ 140 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_
OLDNEW
« no previous file with comments | « trunk/src/device/bluetooth/bluetooth_adapter.h ('k') | trunk/src/device/bluetooth/bluetooth_adapter_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698