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

Side by Side Diff: chrome/browser/chromeos/bluetooth/bluetooth_socket.h

Issue 10007008: Add support for creating bluetooth RFCOMM sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase diff to exclude extensions code Created 8 years, 8 months 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 | Annotate | Revision Log
OLDNEW
(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 #include "chrome/browser/chromeos/bluetooth/bluetooth_service_record.h"
13
14 namespace chromeos {
15
16 class BluetoothDevice;
17
18 // The BluetoothSocket class represents a socket to a specific service on
19 // a BluetoothDevice. BluetoothSocket objects are ref counted and may outlive
20 // both the BluetoothDevice and BluetoothAdapter that were involved in their
21 // creation.
22 class BluetoothSocket : public base::RefCounted<BluetoothSocket> {
23 public:
24 static scoped_refptr<BluetoothSocket> CreateBluetoothSocket(
25 const BluetoothServiceRecord& service_record);
26
27 int fd() const { return fd_; }
28
29 private:
30 friend class base::RefCounted<BluetoothSocket>;
31
32 BluetoothSocket(const std::string& address, int fd);
33 virtual ~BluetoothSocket();
34
35 const std::string address_;
36 const int fd_;
37
38 DISALLOW_COPY_AND_ASSIGN(BluetoothSocket);
39 };
40
41 } // namespace chromeos
42
43 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698