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

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: Address code review feedback. Created 6 years, 9 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 Connect(const base::Closure& success_callback,
37 virtual bool Send(net::DrainableIOBuffer* buffer) OVERRIDE; 32 const ErrorCompletionCallback& error_callback) OVERRIDE;
38 virtual std::string GetLastErrorMessage() const OVERRIDE; 33 virtual void Disconnect(const base::Closure& callback) OVERRIDE;
34 virtual void Receive(int count,
35 const ReceiveCompletionCallback& success_callback,
36 const ReceiveErrorCompletionCallback& error_callback)
37 OVERRIDE;
38 virtual void Send(scoped_refptr<net::IOBuffer> buffer,
39 int buffer_size,
40 const SendCompletionCallback& success_callback,
41 const ErrorCompletionCallback& error_callback) OVERRIDE;
39 42
40 // Create an instance of a BluetoothSocket from the passed file descriptor 43 // 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 44 // received over D-Bus in |fd|, the descriptor will be taken from that object
42 // and ownership passed to the returned object. 45 // and ownership passed to the returned object.
43 static scoped_refptr<device::BluetoothSocket> Create( 46 static scoped_refptr<device::BluetoothSocket> Create(
44 dbus::FileDescriptor* fd); 47 dbus::FileDescriptor* fd);
45 48
46 protected: 49 protected:
47 virtual ~BluetoothSocketChromeOS(); 50 virtual ~BluetoothSocketChromeOS();
48 51
(...skipping 15 matching lines...) Expand all
64 // Last error message, set during Receive() and Send() and retrieved using 67 // Last error message, set during Receive() and Send() and retrieved using
65 // GetLastErrorMessage(). 68 // GetLastErrorMessage().
66 std::string error_message_; 69 std::string error_message_;
67 70
68 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketChromeOS); 71 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketChromeOS);
69 }; 72 };
70 73
71 } // namespace chromeos 74 } // namespace chromeos
72 75
73 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_ 76 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698