OLD | NEW |
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_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Creates a server socket to wrap the |rfcomm_channel|, which should be an | 45 // Creates a server socket to wrap the |rfcomm_channel|, which should be an |
46 // incoming channel in the process of being opened. | 46 // incoming channel in the process of being opened. |
47 // Calls |success_callback|, passing in the created socket, on success. | 47 // Calls |success_callback|, passing in the created socket, on success. |
48 // Calls |error_callback| on failure. | 48 // Calls |error_callback| on failure. |
49 static void AcceptConnection(IOBluetoothRFCOMMChannel* rfcomm_channel, | 49 static void AcceptConnection(IOBluetoothRFCOMMChannel* rfcomm_channel, |
50 const ConnectSuccessCallback& success_callback, | 50 const ConnectSuccessCallback& success_callback, |
51 const ErrorCompletionCallback& error_callback); | 51 const ErrorCompletionCallback& error_callback); |
52 | 52 |
53 // BluetoothSocket: | 53 // BluetoothSocket: |
54 virtual void Close() OVERRIDE; | 54 virtual void Close() OVERRIDE; |
55 virtual void Disconnect(const base::Closure& callback) OVERRIDE; | 55 virtual void Disconnect(const base::Closure& success_callback) OVERRIDE; |
56 virtual void Receive( | 56 virtual void Receive( |
57 int /* buffer_size */, | 57 int /* buffer_size */, |
58 const ReceiveCompletionCallback& success_callback, | 58 const ReceiveCompletionCallback& success_callback, |
59 const ReceiveErrorCompletionCallback& error_callback) OVERRIDE; | 59 const ReceiveErrorCompletionCallback& error_callback) OVERRIDE; |
60 virtual void Send(scoped_refptr<net::IOBuffer> buffer, | 60 virtual void Send(scoped_refptr<net::IOBuffer> buffer, |
61 int buffer_size, | 61 int buffer_size, |
62 const SendCompletionCallback& success_callback, | 62 const SendCompletionCallback& success_callback, |
63 const ErrorCompletionCallback& error_callback) OVERRIDE; | 63 const ErrorCompletionCallback& error_callback) OVERRIDE; |
64 | 64 |
65 // Called by BluetoothRFCOMMChannelDelegate. | 65 // Called by BluetoothRFCOMMChannelDelegate. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 // Send queue -- one entry per pending send operation. | 143 // Send queue -- one entry per pending send operation. |
144 std::queue<linked_ptr<SendRequest> > send_queue_; | 144 std::queue<linked_ptr<SendRequest> > send_queue_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketMac); | 146 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketMac); |
147 }; | 147 }; |
148 | 148 |
149 } // namespace device | 149 } // namespace device |
150 | 150 |
151 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_ | 151 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_MAC_H_ |
OLD | NEW |