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

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: Fix threading ownership related to ApiResourceManager<BluetoothApiSocket> and BluetoothSocketEventD… 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"
(...skipping 14 matching lines...) Expand all
25 25
26 } // namespace net 26 } // namespace net
27 27
28 namespace chromeos { 28 namespace chromeos {
29 29
30 // The BluetoothSocketChromeOS class implements BluetoothSocket for the 30 // The BluetoothSocketChromeOS class implements BluetoothSocket for the
31 // Chrome OS platform. 31 // Chrome OS platform.
32 class CHROMEOS_EXPORT BluetoothSocketChromeOS 32 class CHROMEOS_EXPORT BluetoothSocketChromeOS
33 : public device::BluetoothSocket { 33 : public device::BluetoothSocket {
34 public: 34 public:
35 // BluetoothSocket override. 35 // BluetoothSocket override
36 virtual bool Receive(net::GrowableIOBuffer* buffer) OVERRIDE; 36 virtual void Connect(const base::Closure& success_callback,
37 virtual bool Send(net::DrainableIOBuffer* buffer) OVERRIDE; 37 const ErrorCompletionCallback& error_callback) OVERRIDE;
38 virtual std::string GetLastErrorMessage() const OVERRIDE; 38 virtual void Disconnect(const base::Closure& callback) OVERRIDE;
39 virtual void Receive(int count,
40 const ReceiveCompletionCallback& success_callback,
41 const ReceiveErrorCompletionCallback& error_callback)
42 OVERRIDE;
43 virtual void Send(scoped_refptr<net::DrainableIOBuffer> buffer,
44 const SendCompletionCallback& success_callback,
45 const ErrorCompletionCallback& error_callback) OVERRIDE;
39 46
40 // Create an instance of a BluetoothSocket from the passed file descriptor 47 // 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 48 // received over D-Bus in |fd|, the descriptor will be taken from that object
42 // and ownership passed to the returned object. 49 // and ownership passed to the returned object.
43 static scoped_refptr<device::BluetoothSocket> Create( 50 static scoped_refptr<device::BluetoothSocket> Create(
44 dbus::FileDescriptor* fd); 51 dbus::FileDescriptor* fd);
45 52
46 protected: 53 protected:
47 virtual ~BluetoothSocketChromeOS(); 54 virtual ~BluetoothSocketChromeOS();
48 55
(...skipping 15 matching lines...) Expand all
64 // Last error message, set during Receive() and Send() and retrieved using 71 // Last error message, set during Receive() and Send() and retrieved using
65 // GetLastErrorMessage(). 72 // GetLastErrorMessage().
66 std::string error_message_; 73 std::string error_message_;
67 74
68 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketChromeOS); 75 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketChromeOS);
69 }; 76 };
70 77
71 } // namespace chromeos 78 } // namespace chromeos
72 79
73 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_ 80 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698