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_POSIX_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_POSIX_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "chrome/browser/chromeos/bluetooth/bluetooth_service_record_dbus.h" | |
12 | |
13 namespace chromeos { | |
14 | |
15 class BluetoothDeviceDBus; | |
16 | |
17 // The BluetoothSocketPosix class represents a socket to a specific service on | |
18 // a BluetoothDevice. BluetoothSocketPosix objects are ref counted and may | |
19 // outlive both the BluetoothDevice and BluetoothAdapter that were involved in | |
20 // their creation. | |
21 class BluetoothSocketPosix : public base::RefCounted<BluetoothSocketPosix> { | |
bryeung
2012/09/07 18:35:57
Please make the interface for this (as we discusse
youngki
2012/09/13 18:05:02
Done. For now I just used fd() as an interface API
| |
22 public: | |
23 static scoped_refptr<BluetoothSocketPosix> CreateBluetoothSocket( | |
24 const BluetoothServiceRecordDBus& service_record); | |
25 | |
26 int fd() const { return fd_; } | |
27 | |
28 private: | |
29 friend class base::RefCounted<BluetoothSocketPosix>; | |
30 | |
31 BluetoothSocketPosix(const std::string& address, int fd); | |
32 virtual ~BluetoothSocketPosix(); | |
33 | |
34 const std::string address_; | |
35 const int fd_; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(BluetoothSocketPosix); | |
38 }; | |
39 | |
40 } // namespace chromeos | |
41 | |
42 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_POSIX_H_ | |
OLD | NEW |