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

Side by Side Diff: device/bluetooth/bluetooth_socket_chromeos.h

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code. 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SOCKET_CHROMEOS_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "chromeos/chromeos_export.h" 12 #include "chromeos/chromeos_export.h"
13 #include "device/bluetooth/bluetooth_socket.h" 13 #include "device/bluetooth/bluetooth_socket.h"
14 14
15 namespace dbus { 15 namespace dbus {
16
17 class FileDescriptor; 16 class FileDescriptor;
18
19 } // namespace dbus 17 } // namespace dbus
20 18
21 namespace net { 19 namespace net {
22 20 class IOBuffer;
23 class DrainableIOBuffer;
24 class GrowableIOBuffer;
25
26 } // namespace net 21 } // namespace net
27 22
28 namespace chromeos { 23 namespace chromeos {
29 24
30 // The BluetoothSocketChromeOS class implements BluetoothSocket for the 25 // The BluetoothSocketChromeOS class implements BluetoothSocket for the
31 // Chrome OS platform. 26 // Chrome OS platform.
32 class CHROMEOS_EXPORT BluetoothSocketChromeOS 27 class CHROMEOS_EXPORT BluetoothSocketChromeOS
33 : public device::BluetoothSocket { 28 : public device::BluetoothSocket {
34 public: 29 public:
35 // BluetoothSocket override. 30 // BluetoothSocket override
36 virtual bool Receive(net::GrowableIOBuffer* buffer) OVERRIDE; 31 virtual void Release() OVERRIDE;
37 virtual bool Send(net::DrainableIOBuffer* buffer) OVERRIDE; 32 virtual void Disconnect(const base::Closure& callback) OVERRIDE;
38 virtual std::string GetLastErrorMessage() const OVERRIDE; 33 virtual void Receive(int count,
34 const ReceiveCompletionCallback& success_callback,
35 const ReceiveErrorCompletionCallback& error_callback)
36 OVERRIDE;
37 virtual void Send(scoped_refptr<net::IOBuffer> buffer,
38 int buffer_size,
39 const SendCompletionCallback& success_callback,
40 const ErrorCompletionCallback& error_callback) OVERRIDE;
39 41
40 // Create an instance of a BluetoothSocket from the passed file descriptor 42 // Create an instance of a BluetoothSocket from the passed file descriptor
41 // received over D-Bus in |fd|, the descriptor will be taken from that object 43 // received over D-Bus in |fd|, the descriptor will be taken from that object
42 // and ownership passed to the returned object. 44 // and ownership passed to the returned object.
43 static scoped_refptr<device::BluetoothSocket> Create( 45 static scoped_refptr<device::BluetoothSocket> Create(
44 dbus::FileDescriptor* fd); 46 dbus::FileDescriptor* fd);
45 47
46 protected: 48 protected:
47 virtual ~BluetoothSocketChromeOS(); 49 virtual ~BluetoothSocketChromeOS();
48 50
(...skipping 15 matching lines...) Expand all
64 // Last error message, set during Receive() and Send() and retrieved using 66 // Last error message, set during Receive() and Send() and retrieved using
65 // GetLastErrorMessage(). 67 // GetLastErrorMessage().
66 std::string error_message_; 68 std::string error_message_;
67 69
68 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketChromeOS); 70 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketChromeOS);
69 }; 71 };
70 72
71 } // namespace chromeos 73 } // namespace chromeos
72 74
73 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_ 75 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698