OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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_EXPERIMENTAL_CHROMEOS_H_ | |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_EXPERIMENTAL_CHROMEOS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "chromeos/chromeos_export.h" | |
13 #include "dbus/file_descriptor.h" | |
youngki
2013/04/25 14:34:34
I think FileDescriptor class can be forward-declar
keybuk
2013/04/25 17:16:41
Done.
| |
14 #include "device/bluetooth/bluetooth_socket.h" | |
15 | |
16 namespace net { | |
17 | |
18 class DrainableIOBuffer; | |
19 class GrowableIOBuffer; | |
20 | |
21 } // namespace net | |
22 | |
23 namespace chromeos { | |
24 | |
25 class CHROMEOS_EXPORT BluetoothSocketExperimentalChromeOS | |
26 : public device::BluetoothSocket { | |
27 public: | |
28 // BluetoothSocket override. | |
29 virtual bool Receive(net::GrowableIOBuffer* buffer) OVERRIDE; | |
30 virtual bool Send(net::DrainableIOBuffer* buffer) OVERRIDE; | |
31 virtual std::string GetLastErrorMessage() const OVERRIDE; | |
32 | |
33 // Create an instance of a BluetoothSocket from the passed file descriptor | |
34 // received over D-Bus in |fd|, the descriptor will be taken from that object | |
35 // and ownership passed to the returned object. | |
36 static scoped_refptr<device::BluetoothSocket> Create( | |
37 dbus::FileDescriptor* fd); | |
38 | |
39 protected: | |
40 virtual ~BluetoothSocketExperimentalChromeOS(); | |
41 | |
42 private: | |
43 BluetoothSocketExperimentalChromeOS(int fd); | |
44 | |
45 // File descriptor of the socket. | |
46 const int fd_; | |
47 | |
48 // Last error message, set during Receive() and Send() and retrieved using | |
49 // GetLastErrorMessage(). | |
50 std::string error_message_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketExperimentalChromeOS); | |
53 }; | |
54 | |
55 } // namespace chromeos | |
56 | |
57 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_EXPERIMENTAL_CHROMEOS_H_ | |
OLD | NEW |