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

Unified Diff: device/bluetooth/bluetooth_adapter_factory.h

Issue 12018024: Implemented Asynchronous Initialization of BluetoothAdapter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed RunCallbackOnAdapterReady to GetAdapter. Created 7 years, 11 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: device/bluetooth/bluetooth_adapter_factory.h
diff --git a/device/bluetooth/bluetooth_adapter_factory.h b/device/bluetooth/bluetooth_adapter_factory.h
index f2203aa7cbc6f5296abc24503370727ea775896b..87b0f1a53c945edd0a99dda303c149d44d0f20db 100644
--- a/device/bluetooth/bluetooth_adapter_factory.h
+++ b/device/bluetooth/bluetooth_adapter_factory.h
@@ -18,18 +18,21 @@ namespace device {
// adapter" which may change depending on availability.
class BluetoothAdapterFactory {
public:
+ typedef base::Callback<void(scoped_refptr<BluetoothAdapter> adapter)>
+ AdapterCallback;
keybuk 2013/01/22 18:40:57 newline afer this?
youngki 2013/01/22 20:38:13 Done.
// Returns true if the Bluetooth adapter is available for the current
// platform.
static bool IsBluetoothAdapterAvailable();
// Runs the callback with the shared instance for the default adapter when the
// adapter is available to be used.
- static void RunCallbackOnAdapterReady(
- const BluetoothAdapter::AdapterCallback& callback);
+ // Use this method to get an adapter fully initialized.
+ static void GetAdapter(const AdapterCallback& callback);
keybuk 2013/01/22 18:40:57 Better comment would be something like: Returns t
youngki 2013/01/22 20:38:13 Done.
- // Returns the shared instance of the adapter that has already been created.
+ // Returns the shared instance of the adapter that has already been created,
+ // but may or may not have been initialized.
// It returns NULL if no adapter has been created at the time.
- static scoped_refptr<BluetoothAdapter> GetAdapter();
+ static scoped_refptr<BluetoothAdapter> MaybeGetAdapter();
// Creates an instance for a specific adapter at address |address|.
static BluetoothAdapter* Create(const std::string& address);

Powered by Google App Engine
This is Rietveld 408576698