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

Unified Diff: device/bluetooth/bluetooth_socket.h

Issue 278663002: Implement chrome.bluetoothSocket.listenUsing*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix BluetoothAdapterMac include typo Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_socket.h
diff --git a/device/bluetooth/bluetooth_socket.h b/device/bluetooth/bluetooth_socket.h
index 7a41a2f25075922d142202c89d6ec7a52b27cc94..1c7e50facb33e9ed60b4e88766c229464f723f04 100644
--- a/device/bluetooth/bluetooth_socket.h
+++ b/device/bluetooth/bluetooth_socket.h
@@ -16,6 +16,9 @@ class IOBuffer;
namespace device {
+class BluetoothDevice;
+class BluetoothUUID;
+
// BluetoothSocket represents a socket to a specific service on a
// BluetoothDevice. BluetoothSocket objects are ref counted and may outlive
// both the BluetoothDevice and BluetoothAdapter that were involved in their
@@ -31,6 +34,9 @@ class BluetoothSocket : public base::RefCountedThreadSafe<BluetoothSocket> {
typedef base::Callback<void(int)> SendCompletionCallback;
typedef base::Callback<void(int, scoped_refptr<net::IOBuffer> io_buffer)>
ReceiveCompletionCallback;
+ typedef base::Callback<void(const BluetoothDevice* device,
+ scoped_refptr<BluetoothSocket> socket)>
+ AcceptCompletionCallback;
typedef base::Callback<void(const std::string& error_message)>
ErrorCompletionCallback;
typedef base::Callback<void(ErrorReason, const std::string& error_message)>
@@ -62,6 +68,13 @@ class BluetoothSocket : public base::RefCountedThreadSafe<BluetoothSocket> {
const SendCompletionCallback& success_callback,
const ErrorCompletionCallback& error_callback) = 0;
+ // Accepts a pending client connection from the socket and calls
+ // |success_callback| on completion, passing a new BluetoothSocket instance
+ // for the new client. If an error occurs, calls |error_callback| with a
+ // reason and an error message.
+ virtual void Accept(const AcceptCompletionCallback& success_callback,
+ const ErrorCompletionCallback& error_callback) = 0;
+
protected:
friend class base::RefCountedThreadSafe<BluetoothSocket>;
virtual ~BluetoothSocket();

Powered by Google App Engine
This is Rietveld 408576698