Chromium Code Reviews| 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. | |
|
keybuk
2012/04/19 01:05:40
Comment should explain about ref counting.
| |
| 19 class BluetoothSocket : public base::RefCounted<BluetoothSocket> { | |
| 20 public: | |
| 21 // The fd of this socket. | |
| 22 int fd() const { return fd_; } | |
| 23 | |
| 24 private: | |
| 25 friend class base::RefCounted<BluetoothSocket>; | |
| 26 friend class BluetoothDevice; | |
| 27 | |
| 28 BluetoothSocket(BluetoothDevice* device, const std::string& service_uuid, | |
| 29 int fd); | |
| 30 virtual ~BluetoothSocket(); | |
| 31 | |
| 32 BluetoothDevice* device_; | |
| 33 const std::string service_uuid_; | |
| 34 const int fd_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(BluetoothSocket); | |
| 37 }; | |
| 38 | |
| 39 } // namespace chromeos | |
| 40 | |
| 41 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_ | |
| OLD | NEW |