OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/memory/weak_ptr.h" | |
12 | |
13 namespace chromeos { | |
14 | |
15 class BluetoothDevice; | |
16 | |
17 // The BluetoothSocket class represents a socket to a specific service on | |
18 // a BluetoothDevice. | |
19 class BluetoothSocket : public base::SupportsWeakPtr<BluetoothSocket> { | |
20 public: | |
21 BluetoothSocket(BluetoothDevice *device, const std::string &service_uuid, | |
22 int id); | |
keybuk
2012/04/16 22:25:36
nit: "* " and "& " not " *" and " &"
Public const
| |
23 virtual ~BluetoothSocket() {} | |
24 | |
25 // The id of this socket. | |
26 int id() const { return id_; } | |
keybuk
2012/04/16 22:25:36
What is id? I tend to dislike arbitrary lookup typ
| |
27 | |
28 // Close this socket connection. | |
29 void Close(); | |
keybuk
2012/04/16 22:25:36
RAII: Close should be the destructor.
| |
30 | |
31 private: | |
32 BluetoothDevice* device_; | |
33 const std::string service_uuid_; | |
34 const int id_; | |
keybuk
2012/04/16 22:25:36
Is this going to be derivable? How will we deal wi
| |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(BluetoothSocket); | |
37 }; | |
38 | |
39 } // namespace chromeos | |
40 | |
41 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_ | |
OLD | NEW |