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

Unified Diff: device/bluetooth/bluetooth_profile_chromeos.h

Issue 267633003: Reimplement BluetoothSocketChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Got windows compiling, ship it Created 6 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
« no previous file with comments | « device/bluetooth/bluetooth_profile.cc ('k') | device/bluetooth/bluetooth_profile_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_profile_chromeos.h
diff --git a/device/bluetooth/bluetooth_profile_chromeos.h b/device/bluetooth/bluetooth_profile_chromeos.h
index fd3ad1984ea0e1a997dd8ecd8acbb000a685433d..93af714a8363b8ee1dd028b92964ea5f6282445e 100644
--- a/device/bluetooth/bluetooth_profile_chromeos.h
+++ b/device/bluetooth/bluetooth_profile_chromeos.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/sequenced_task_runner.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/dbus/bluetooth_profile_manager_client.h"
#include "chromeos/dbus/bluetooth_profile_service_provider.h"
@@ -25,8 +26,14 @@ class FileDescriptor;
} // namespace dbus
+namespace device {
+class BluetoothSocketThread;
+} // namespace device
+
namespace chromeos {
+class BluetoothSocketChromeOS;
+
// The BluetoothProfileChromeOS class implements BluetoothProfile for the
// Chrome OS platform.
class CHROMEOS_EXPORT BluetoothProfileChromeOS
@@ -45,7 +52,9 @@ class CHROMEOS_EXPORT BluetoothProfileChromeOS
private:
friend class BluetoothProfile;
- BluetoothProfileChromeOS();
+ BluetoothProfileChromeOS(
+ scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
+ scoped_refptr<device::BluetoothSocketThread> socket_thread);
virtual ~BluetoothProfileChromeOS();
// Called by BluetoothProfile::Register to initialize the profile object
@@ -105,6 +114,17 @@ class CHROMEOS_EXPORT BluetoothProfileChromeOS
const ConfirmationCallback& callback,
scoped_ptr<dbus::FileDescriptor> fd);
+ // Methods run after the socket has been connected to a
+ // BluetoothSocketChromeOS instance on the I/O thread, these methods complete
+ // the incoming connection calling both the Bluetooth daemon callback
+ // |callback| to indicate success or failure and calling this object's
+ // new connection callback method.
+ void OnConnect(const dbus::ObjectPath& device_path,
+ scoped_refptr<BluetoothSocketChromeOS> socket,
+ const ConfirmationCallback& callback);
+ void OnConnectError(const ConfirmationCallback& callback,
+ const std::string& error_message);
+
// UUID of the profile passed during initialization.
device::BluetoothUUID uuid_;
@@ -126,6 +146,10 @@ class CHROMEOS_EXPORT BluetoothProfileChromeOS
// connected socket to profile object owner.
ConnectionCallback connection_callback_;
+ // UI thread task runner and socket thread object used to create sockets.
+ scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
+ scoped_refptr<device::BluetoothSocketThread> socket_thread_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<BluetoothProfileChromeOS> weak_ptr_factory_;
« no previous file with comments | « device/bluetooth/bluetooth_profile.cc ('k') | device/bluetooth/bluetooth_profile_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698