OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H |
6 #define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H | 6 #define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 BluetoothConnection(const RemoteDevice& remote_device, | 35 BluetoothConnection(const RemoteDevice& remote_device, |
36 const device::BluetoothUUID& uuid); | 36 const device::BluetoothUUID& uuid); |
37 ~BluetoothConnection() override; | 37 ~BluetoothConnection() override; |
38 | 38 |
39 // Connection: | 39 // Connection: |
40 void Connect() override; | 40 void Connect() override; |
41 void Disconnect() override; | 41 void Disconnect() override; |
42 | 42 |
43 protected: | 43 protected: |
44 // Connection: | 44 // Connection: |
45 void SendMessageImpl(scoped_ptr<WireMessage> message) override; | 45 void SendMessageImpl(std::unique_ptr<WireMessage> message) override; |
46 | 46 |
47 // BluetoothAdapter::Observer: | 47 // BluetoothAdapter::Observer: |
48 void DeviceChanged(device::BluetoothAdapter* adapter, | 48 void DeviceChanged(device::BluetoothAdapter* adapter, |
49 device::BluetoothDevice* device) override; | 49 device::BluetoothDevice* device) override; |
50 void DeviceRemoved(device::BluetoothAdapter* adapter, | 50 void DeviceRemoved(device::BluetoothAdapter* adapter, |
51 device::BluetoothDevice* device) override; | 51 device::BluetoothDevice* device) override; |
52 | 52 |
53 private: | 53 private: |
54 // Registers receive callbacks with the backing |socket_|. | 54 // Registers receive callbacks with the backing |socket_|. |
55 void StartReceive(); | 55 void StartReceive(); |
(...skipping 15 matching lines...) Expand all Loading... |
71 // The Bluetooth adapter over which this connection is made. Non-null iff | 71 // The Bluetooth adapter over which this connection is made. Non-null iff |
72 // |this| connection is registered as an observer of the |adapter_|. | 72 // |this| connection is registered as an observer of the |adapter_|. |
73 scoped_refptr<device::BluetoothAdapter> adapter_; | 73 scoped_refptr<device::BluetoothAdapter> adapter_; |
74 | 74 |
75 // The Bluetooth socket that backs this connection. NULL iff the connection is | 75 // The Bluetooth socket that backs this connection. NULL iff the connection is |
76 // not in a connected state. | 76 // not in a connected state. |
77 scoped_refptr<device::BluetoothSocket> socket_; | 77 scoped_refptr<device::BluetoothSocket> socket_; |
78 | 78 |
79 // The message that was sent over the backing |socket_|. NULL iff there is no | 79 // The message that was sent over the backing |socket_|. NULL iff there is no |
80 // send operation in progress. | 80 // send operation in progress. |
81 scoped_ptr<WireMessage> pending_message_; | 81 std::unique_ptr<WireMessage> pending_message_; |
82 | 82 |
83 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_; | 83 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection); | 85 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace proximity_auth | 88 } // namespace proximity_auth |
89 | 89 |
90 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H | 90 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H |
OLD | NEW |