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

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

Issue 778443002: bluetooth: Make device/bluetooth a shared library component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Set DelayLoadDLL settings on shared library as well Created 6 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "device/bluetooth/bluetooth_export.h"
12 13
13 namespace net { 14 namespace net {
14 class IOBuffer; 15 class IOBuffer;
15 } // namespace net 16 } // namespace net
16 17
17 namespace device { 18 namespace device {
18 19
19 class BluetoothDevice; 20 class BluetoothDevice;
20 class BluetoothUUID; 21 class BluetoothUUID;
21 22
22 // BluetoothSocket represents a socket to a specific service on a 23 // BluetoothSocket represents a socket to a specific service on a
23 // BluetoothDevice. BluetoothSocket objects are ref counted and may outlive 24 // BluetoothDevice. BluetoothSocket objects are ref counted and may outlive
24 // both the BluetoothDevice and BluetoothAdapter that were involved in their 25 // both the BluetoothDevice and BluetoothAdapter that were involved in their
25 // creation. In terms of threading, platform specific implementations may 26 // creation. In terms of threading, platform specific implementations may
26 // differ slightly, but platform independent consumers must guarantee calling 27 // differ slightly, but platform independent consumers must guarantee calling
27 // various instance methods on the same thread as the thread used at 28 // various instance methods on the same thread as the thread used at
28 // construction time -- platform specific implementation are responsible for 29 // construction time -- platform specific implementation are responsible for
29 // marshalling calls to a different thread if required. 30 // marshalling calls to a different thread if required.
30 class BluetoothSocket : public base::RefCountedThreadSafe<BluetoothSocket> { 31 class DEVICE_BLUETOOTH_EXPORT BluetoothSocket
32 : public base::RefCountedThreadSafe<BluetoothSocket> {
31 public: 33 public:
32 enum ErrorReason { kSystemError, kIOPending, kDisconnected }; 34 enum ErrorReason { kSystemError, kIOPending, kDisconnected };
33 35
34 typedef base::Callback<void(int)> SendCompletionCallback; 36 typedef base::Callback<void(int)> SendCompletionCallback;
35 typedef base::Callback<void(int, scoped_refptr<net::IOBuffer> io_buffer)> 37 typedef base::Callback<void(int, scoped_refptr<net::IOBuffer> io_buffer)>
36 ReceiveCompletionCallback; 38 ReceiveCompletionCallback;
37 typedef base::Callback<void(const BluetoothDevice* device, 39 typedef base::Callback<void(const BluetoothDevice* device,
38 scoped_refptr<BluetoothSocket> socket)> 40 scoped_refptr<BluetoothSocket> socket)>
39 AcceptCompletionCallback; 41 AcceptCompletionCallback;
40 typedef base::Callback<void(const std::string& error_message)> 42 typedef base::Callback<void(const std::string& error_message)>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const ErrorCompletionCallback& error_callback) = 0; 78 const ErrorCompletionCallback& error_callback) = 0;
77 79
78 protected: 80 protected:
79 friend class base::RefCountedThreadSafe<BluetoothSocket>; 81 friend class base::RefCountedThreadSafe<BluetoothSocket>;
80 virtual ~BluetoothSocket(); 82 virtual ~BluetoothSocket();
81 }; 83 };
82 84
83 } // namespace device 85 } // namespace device
84 86
85 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_H_ 87 #endif // DEVICE_BLUETOOTH_BLUETOOTH_SOCKET_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_service_record_win.h ('k') | device/bluetooth/bluetooth_socket_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698