| Index: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
|
| diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
|
| index 26c3303df356965b057e2a957f0b9dd999754200..2d1d7c87ef3264d98fc13a56b6e4e0c16028ff46 100644
|
| --- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
|
| +++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
|
| @@ -89,34 +89,6 @@ namespace api {
|
| // Base class for bluetoothLowEnergy API functions. This class handles some of
|
| // the common logic involved in all API functions, such as checking for
|
| // platform support and returning the correct error.
|
| -//
|
| -// DEPRECATED: This inherits from AsyncExtensionFunction, which we're trying to
|
| -// get rid of for various reasons. Please inherit from the
|
| -// BluetoothLowEnergyExtensionFunction class instead.
|
| -class BluetoothLowEnergyExtensionFunctionDeprecated
|
| - : public AsyncExtensionFunction {
|
| - public:
|
| - BluetoothLowEnergyExtensionFunctionDeprecated();
|
| -
|
| - protected:
|
| - ~BluetoothLowEnergyExtensionFunctionDeprecated() override;
|
| -
|
| - // AsyncExtensionFunction override.
|
| - bool RunAsync() override;
|
| -
|
| - // Implemented by individual bluetoothLowEnergy extension functions to perform
|
| - // the body of the function. This invoked asynchonously after RunAsync after
|
| - // the BluetoothLowEnergyEventRouter has obtained a handle on the
|
| - // BluetoothAdapter.
|
| - virtual bool DoWork() = 0;
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunctionDeprecated);
|
| -};
|
| -
|
| -// Replacement for BluetoothLowEnergyExtensionFunctionDeprecated. Has the same
|
| -// functionality except that instead of the SendResponse/return combo, we'll
|
| -// return our response with Respond().
|
| class BluetoothLowEnergyExtensionFunction : public UIThreadExtensionFunction {
|
| public:
|
| BluetoothLowEnergyExtensionFunction();
|
| @@ -170,7 +142,7 @@ class BLEPeripheralExtensionFunction
|
| };
|
|
|
| class BluetoothLowEnergyConnectFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.connect",
|
| BLUETOOTHLOWENERGY_CONNECT);
|
| @@ -178,8 +150,8 @@ class BluetoothLowEnergyConnectFunction
|
| protected:
|
| ~BluetoothLowEnergyConnectFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -189,7 +161,7 @@ class BluetoothLowEnergyConnectFunction
|
| };
|
|
|
| class BluetoothLowEnergyDisconnectFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.disconnect",
|
| BLUETOOTHLOWENERGY_DISCONNECT);
|
| @@ -197,8 +169,8 @@ class BluetoothLowEnergyDisconnectFunction
|
| protected:
|
| ~BluetoothLowEnergyDisconnectFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -208,7 +180,7 @@ class BluetoothLowEnergyDisconnectFunction
|
| };
|
|
|
| class BluetoothLowEnergyGetServiceFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.getService",
|
| BLUETOOTHLOWENERGY_GETSERVICE);
|
| @@ -216,12 +188,12 @@ class BluetoothLowEnergyGetServiceFunction
|
| protected:
|
| ~BluetoothLowEnergyGetServiceFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
| };
|
|
|
| class BluetoothLowEnergyGetServicesFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.getServices",
|
| BLUETOOTHLOWENERGY_GETSERVICES);
|
| @@ -229,12 +201,12 @@ class BluetoothLowEnergyGetServicesFunction
|
| protected:
|
| ~BluetoothLowEnergyGetServicesFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
| };
|
|
|
| class BluetoothLowEnergyGetCharacteristicFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.getCharacteristic",
|
| BLUETOOTHLOWENERGY_GETCHARACTERISTIC);
|
| @@ -242,12 +214,12 @@ class BluetoothLowEnergyGetCharacteristicFunction
|
| protected:
|
| ~BluetoothLowEnergyGetCharacteristicFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
| };
|
|
|
| class BluetoothLowEnergyGetCharacteristicsFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.getCharacteristics",
|
| BLUETOOTHLOWENERGY_GETCHARACTERISTICS);
|
| @@ -255,12 +227,12 @@ class BluetoothLowEnergyGetCharacteristicsFunction
|
| protected:
|
| ~BluetoothLowEnergyGetCharacteristicsFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
| };
|
|
|
| class BluetoothLowEnergyGetIncludedServicesFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.getIncludedServices",
|
| BLUETOOTHLOWENERGY_GETINCLUDEDSERVICES);
|
| @@ -268,12 +240,12 @@ class BluetoothLowEnergyGetIncludedServicesFunction
|
| protected:
|
| ~BluetoothLowEnergyGetIncludedServicesFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
| };
|
|
|
| class BluetoothLowEnergyGetDescriptorFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.getDescriptor",
|
| BLUETOOTHLOWENERGY_GETDESCRIPTOR);
|
| @@ -281,12 +253,12 @@ class BluetoothLowEnergyGetDescriptorFunction
|
| protected:
|
| ~BluetoothLowEnergyGetDescriptorFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
| };
|
|
|
| class BluetoothLowEnergyGetDescriptorsFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.getDescriptors",
|
| BLUETOOTHLOWENERGY_GETDESCRIPTORS);
|
| @@ -294,12 +266,12 @@ class BluetoothLowEnergyGetDescriptorsFunction
|
| protected:
|
| ~BluetoothLowEnergyGetDescriptorsFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
| };
|
|
|
| class BluetoothLowEnergyReadCharacteristicValueFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.readCharacteristicValue",
|
| BLUETOOTHLOWENERGY_READCHARACTERISTICVALUE);
|
| @@ -307,8 +279,8 @@ class BluetoothLowEnergyReadCharacteristicValueFunction
|
| protected:
|
| ~BluetoothLowEnergyReadCharacteristicValueFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -321,7 +293,7 @@ class BluetoothLowEnergyReadCharacteristicValueFunction
|
| };
|
|
|
| class BluetoothLowEnergyWriteCharacteristicValueFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.writeCharacteristicValue",
|
| BLUETOOTHLOWENERGY_WRITECHARACTERISTICVALUE);
|
| @@ -329,8 +301,8 @@ class BluetoothLowEnergyWriteCharacteristicValueFunction
|
| protected:
|
| ~BluetoothLowEnergyWriteCharacteristicValueFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -343,7 +315,7 @@ class BluetoothLowEnergyWriteCharacteristicValueFunction
|
| };
|
|
|
| class BluetoothLowEnergyStartCharacteristicNotificationsFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION(
|
| "bluetoothLowEnergy.startCharacteristicNotifications",
|
| @@ -352,8 +324,8 @@ class BluetoothLowEnergyStartCharacteristicNotificationsFunction
|
| protected:
|
| ~BluetoothLowEnergyStartCharacteristicNotificationsFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -363,7 +335,7 @@ class BluetoothLowEnergyStartCharacteristicNotificationsFunction
|
| };
|
|
|
| class BluetoothLowEnergyStopCharacteristicNotificationsFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION(
|
| "bluetoothLowEnergy.stopCharacteristicNotifications",
|
| @@ -372,8 +344,8 @@ class BluetoothLowEnergyStopCharacteristicNotificationsFunction
|
| protected:
|
| ~BluetoothLowEnergyStopCharacteristicNotificationsFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -383,7 +355,7 @@ class BluetoothLowEnergyStopCharacteristicNotificationsFunction
|
| };
|
|
|
| class BluetoothLowEnergyReadDescriptorValueFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.readDescriptorValue",
|
| BLUETOOTHLOWENERGY_READDESCRIPTORVALUE);
|
| @@ -391,8 +363,8 @@ class BluetoothLowEnergyReadDescriptorValueFunction
|
| protected:
|
| ~BluetoothLowEnergyReadDescriptorValueFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -405,7 +377,7 @@ class BluetoothLowEnergyReadDescriptorValueFunction
|
| };
|
|
|
| class BluetoothLowEnergyWriteDescriptorValueFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.writeDescriptorValue",
|
| BLUETOOTHLOWENERGY_WRITEDESCRIPTORVALUE);
|
| @@ -413,8 +385,8 @@ class BluetoothLowEnergyWriteDescriptorValueFunction
|
| protected:
|
| ~BluetoothLowEnergyWriteDescriptorValueFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| // Success and error callbacks, called by
|
| @@ -427,7 +399,7 @@ class BluetoothLowEnergyWriteDescriptorValueFunction
|
| };
|
|
|
| class BluetoothLowEnergyAdvertisementFunction
|
| - : public BluetoothLowEnergyExtensionFunctionDeprecated {
|
| + : public BluetoothLowEnergyExtensionFunction {
|
| public:
|
| BluetoothLowEnergyAdvertisementFunction();
|
|
|
| @@ -441,7 +413,7 @@ class BluetoothLowEnergyAdvertisementFunction
|
| const base::hash_set<int>* GetAdvertisementIds();
|
|
|
| // ExtensionFunction override.
|
| - bool RunAsync() override;
|
| + ResponseAction Run() override;
|
|
|
| private:
|
| void Initialize();
|
| @@ -460,8 +432,8 @@ class BluetoothLowEnergyRegisterAdvertisementFunction
|
| protected:
|
| ~BluetoothLowEnergyRegisterAdvertisementFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| void SuccessCallback(scoped_refptr<device::BluetoothAdvertisement>);
|
| @@ -477,8 +449,8 @@ class BluetoothLowEnergyUnregisterAdvertisementFunction
|
| protected:
|
| ~BluetoothLowEnergyUnregisterAdvertisementFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| void SuccessCallback(int advertisement_id);
|
| @@ -495,8 +467,8 @@ class BluetoothLowEnergyResetAdvertisingFunction
|
| protected:
|
| ~BluetoothLowEnergyResetAdvertisingFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| - bool DoWork() override;
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| + void DoWork() override;
|
|
|
| private:
|
| void SuccessCallback();
|
| @@ -514,7 +486,7 @@ class BluetoothLowEnergySetAdvertisingIntervalFunction
|
| protected:
|
| ~BluetoothLowEnergySetAdvertisingIntervalFunction() override {}
|
|
|
| - // BluetoothLowEnergyExtensionFunctionDeprecated override.
|
| + // BluetoothLowEnergyExtensionFunction override.
|
| void DoWork() override;
|
|
|
| private:
|
|
|