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

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h

Issue 11819007: Changed DefaultAdapter to RunCallbackOnAdapterReady function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created IsBluetoothSupported in BluetoothEventRouter to fix browser_tests. 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: chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h
index 5799c34ecbc854eddadbeb79fea43e8d30ec8904..c6c4ddbfc6efa63cb79ce5d309d2c72f1ebcc8d7 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_EXTENSION_FUNCTION_H_
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/extension_function.h"
namespace device {
@@ -32,9 +33,15 @@ class BluetoothExtensionFunction : public AsyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
private:
+ void RunOnAdapterReady(scoped_refptr<device::BluetoothAdapter> adapter);
+
// Implemented by individual bluetooth extension functions, called
// automatically once |adapter| has been initialized.
virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) = 0;
+
+ base::WeakPtrFactory<BluetoothExtensionFunction> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothExtensionFunction);
};
} // namespace api

Powered by Google App Engine
This is Rietveld 408576698