OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_ | |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/memory/ref_counted.h" | |
11 #include "device/bluetooth/bluetooth_socket.h" | |
12 | |
13 namespace device { | |
14 | |
15 class BluetoothServiceRecord; | |
16 | |
17 } // namespace device | |
18 | |
19 namespace net { | |
20 | |
21 class DrainableIOBuffer; | |
22 class GrowableIOBuffer; | |
23 | |
24 } // namespace net | |
25 | |
26 namespace chromeos { | |
27 | |
28 // This class is an implementation of BluetoothSocket class for Chrome OS | |
29 // platform. | |
30 class BluetoothSocketChromeOS : public device::BluetoothSocket { | |
31 public: | |
32 static scoped_refptr<device::BluetoothSocket> CreateBluetoothSocket( | |
33 const device::BluetoothServiceRecord& service_record); | |
34 | |
35 // BluetoothSocket override | |
36 virtual bool Receive(net::GrowableIOBuffer* buffer) OVERRIDE; | |
37 virtual bool Send(net::DrainableIOBuffer* buffer) OVERRIDE; | |
38 virtual std::string GetLastErrorMessage() const OVERRIDE; | |
39 | |
40 protected: | |
41 virtual ~BluetoothSocketChromeOS(); | |
42 | |
43 private: | |
44 BluetoothSocketChromeOS(int fd); | |
45 | |
46 const int fd_; | |
47 std::string error_message_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketChromeOS); | |
50 }; | |
51 | |
52 } // namespace chromeos | |
53 | |
54 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_ | |
OLD | NEW |