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

Unified 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: adding disconnect 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/bluetooth/bluetooth_socket.h
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_socket.h b/chrome/browser/chromeos/bluetooth/bluetooth_socket.h
new file mode 100644
index 0000000000000000000000000000000000000000..2663944640b5eac22315f43278bcc07ba01d5f6e
--- /dev/null
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_socket.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_
+#define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_
+#pragma once
+
+#include <string>
+
+#include "base/memory/weak_ptr.h"
+
+namespace chromeos {
+
+class BluetoothDevice;
+
+// The BluetoothSocket class represents a socket to a specific service on
+// a BluetoothDevice.
+class BluetoothSocket : public base::SupportsWeakPtr<BluetoothSocket> {
+ public:
+ BluetoothSocket(BluetoothDevice *device, const std::string &service_uuid,
+ int id);
keybuk 2012/04/16 22:25:36 nit: "* " and "& " not " *" and " &" Public const
+ virtual ~BluetoothSocket() {}
+
+ // The id of this socket.
+ int id() const { return id_; }
keybuk 2012/04/16 22:25:36 What is id? I tend to dislike arbitrary lookup typ
+
+ // Close this socket connection.
+ void Close();
keybuk 2012/04/16 22:25:36 RAII: Close should be the destructor.
+
+ private:
+ BluetoothDevice* device_;
+ const std::string service_uuid_;
+ const int id_;
keybuk 2012/04/16 22:25:36 Is this going to be derivable? How will we deal wi
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothSocket);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_SOCKET_H_

Powered by Google App Engine
This is Rietveld 408576698