Index: device/bluetooth/bluetooth_socket_experimental_chromeos.h |
diff --git a/device/bluetooth/bluetooth_socket_experimental_chromeos.h b/device/bluetooth/bluetooth_socket_experimental_chromeos.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d9c0b0927c230505c302ac7d917b9a5e8de57335 |
--- /dev/null |
+++ b/device/bluetooth/bluetooth_socket_experimental_chromeos.h |
@@ -0,0 +1,57 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_EXPERIMENTAL_CHROMEOS_H_ |
+#define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_EXPERIMENTAL_CHROMEOS_H_ |
+ |
+#include <string> |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/ref_counted.h" |
+#include "chromeos/chromeos_export.h" |
+#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.
|
+#include "device/bluetooth/bluetooth_socket.h" |
+ |
+namespace net { |
+ |
+class DrainableIOBuffer; |
+class GrowableIOBuffer; |
+ |
+} // namespace net |
+ |
+namespace chromeos { |
+ |
+class CHROMEOS_EXPORT BluetoothSocketExperimentalChromeOS |
+ : public device::BluetoothSocket { |
+ public: |
+ // BluetoothSocket override. |
+ virtual bool Receive(net::GrowableIOBuffer* buffer) OVERRIDE; |
+ virtual bool Send(net::DrainableIOBuffer* buffer) OVERRIDE; |
+ virtual std::string GetLastErrorMessage() const OVERRIDE; |
+ |
+ // Create an instance of a BluetoothSocket from the passed file descriptor |
+ // received over D-Bus in |fd|, the descriptor will be taken from that object |
+ // and ownership passed to the returned object. |
+ static scoped_refptr<device::BluetoothSocket> Create( |
+ dbus::FileDescriptor* fd); |
+ |
+ protected: |
+ virtual ~BluetoothSocketExperimentalChromeOS(); |
+ |
+ private: |
+ BluetoothSocketExperimentalChromeOS(int fd); |
+ |
+ // File descriptor of the socket. |
+ const int fd_; |
+ |
+ // Last error message, set during Receive() and Send() and retrieved using |
+ // GetLastErrorMessage(). |
+ std::string error_message_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BluetoothSocketExperimentalChromeOS); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_EXPERIMENTAL_CHROMEOS_H_ |