mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1174071 - Remove 'required' keyword for Bluetooth*EventInit dictionary members. r=btian, r=bz
This commit is contained in:
parent
f9572dad62
commit
79a8bee656
@ -92,13 +92,16 @@ BluetoothLeDeviceEvent::Constructor(
|
|||||||
e->mDevice = aEventInitDict.mDevice;
|
e->mDevice = aEventInitDict.mDevice;
|
||||||
e->mRssi = aEventInitDict.mRssi;
|
e->mRssi = aEventInitDict.mRssi;
|
||||||
|
|
||||||
aEventInitDict.mScanRecord.ComputeLengthAndData();
|
if (!aEventInitDict.mScanRecord.IsNull()) {
|
||||||
const uint8_t* data = aEventInitDict.mScanRecord.Data();
|
const auto& scanRecord = aEventInitDict.mScanRecord.Value();
|
||||||
size_t length = aEventInitDict.mScanRecord.Length();
|
scanRecord.ComputeLengthAndData();
|
||||||
e->mScanRecord = ArrayBuffer::Create(aGlobal.Context(), length, data);
|
e->mScanRecord = ArrayBuffer::Create(aGlobal.Context(),
|
||||||
if (!e->mScanRecord) {
|
scanRecord.Length(),
|
||||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
scanRecord.Data());
|
||||||
return nullptr;
|
if (!e->mScanRecord) {
|
||||||
|
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e->SetTrusted(trusted);
|
e->SetTrusted(trusted);
|
||||||
@ -106,7 +109,7 @@ BluetoothLeDeviceEvent::Constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
BluetoothDevice*
|
BluetoothDevice*
|
||||||
BluetoothLeDeviceEvent::Device() const
|
BluetoothLeDeviceEvent::GetDevice() const
|
||||||
{
|
{
|
||||||
return mDevice;
|
return mDevice;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
const BluetoothLeDeviceEventInit& aEventInitDict,
|
const BluetoothLeDeviceEventInit& aEventInitDict,
|
||||||
ErrorResult& aRv);
|
ErrorResult& aRv);
|
||||||
|
|
||||||
BluetoothDevice* Device() const;
|
BluetoothDevice* GetDevice() const;
|
||||||
|
|
||||||
int16_t Rssi() const;
|
int16_t Rssi() const;
|
||||||
|
|
||||||
|
@ -15,5 +15,5 @@ interface BluetoothAttributeEvent : Event
|
|||||||
|
|
||||||
dictionary BluetoothAttributeEventInit : EventInit
|
dictionary BluetoothAttributeEventInit : EventInit
|
||||||
{
|
{
|
||||||
required sequence<DOMString> attrs;
|
sequence<DOMString> attrs = [];
|
||||||
};
|
};
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
optional BluetoothGattCharacteristicEventInit eventInitDict)]
|
optional BluetoothGattCharacteristicEventInit eventInitDict)]
|
||||||
interface BluetoothGattCharacteristicEvent : Event
|
interface BluetoothGattCharacteristicEvent : Event
|
||||||
{
|
{
|
||||||
readonly attribute BluetoothGattCharacteristic characteristic;
|
readonly attribute BluetoothGattCharacteristic? characteristic;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary BluetoothGattCharacteristicEventInit : EventInit
|
dictionary BluetoothGattCharacteristicEventInit : EventInit
|
||||||
{
|
{
|
||||||
required BluetoothGattCharacteristic characteristic;
|
BluetoothGattCharacteristic? characteristic = null;
|
||||||
};
|
};
|
||||||
|
@ -8,15 +8,15 @@
|
|||||||
Constructor(DOMString type, optional BluetoothLeDeviceEventInit eventInitDict)]
|
Constructor(DOMString type, optional BluetoothLeDeviceEventInit eventInitDict)]
|
||||||
interface BluetoothLeDeviceEvent : Event
|
interface BluetoothLeDeviceEvent : Event
|
||||||
{
|
{
|
||||||
readonly attribute BluetoothDevice device;
|
readonly attribute BluetoothDevice? device;
|
||||||
readonly attribute short rssi;
|
readonly attribute short rssi;
|
||||||
[Throws]
|
[Throws]
|
||||||
readonly attribute ArrayBuffer scanRecord;
|
readonly attribute ArrayBuffer? scanRecord;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary BluetoothLeDeviceEventInit : EventInit
|
dictionary BluetoothLeDeviceEventInit : EventInit
|
||||||
{
|
{
|
||||||
required BluetoothDevice device;
|
BluetoothDevice? device = null;
|
||||||
short rssi = 0;
|
short rssi = 0;
|
||||||
required ArrayBuffer scanRecord;
|
ArrayBuffer? scanRecord = null;
|
||||||
};
|
};
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
optional BluetoothPairingEventInit eventInitDict)]
|
optional BluetoothPairingEventInit eventInitDict)]
|
||||||
interface BluetoothPairingEvent : Event
|
interface BluetoothPairingEvent : Event
|
||||||
{
|
{
|
||||||
readonly attribute DOMString deviceName;
|
readonly attribute DOMString deviceName;
|
||||||
readonly attribute BluetoothPairingHandle handle;
|
readonly attribute BluetoothPairingHandle? handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary BluetoothPairingEventInit : EventInit
|
dictionary BluetoothPairingEventInit : EventInit
|
||||||
{
|
{
|
||||||
required DOMString deviceName;
|
DOMString deviceName = "";
|
||||||
required BluetoothPairingHandle handle;
|
BluetoothPairingHandle? handle = null;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user