Closed
Bug 1152702
Opened 11 years ago
Closed 11 years ago
[bluetooth2] Fix upper bound in ContiguousEnumSerializers for BluetoothStatus and BluetoothSspVariant
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(firefox40 fixed)
RESOLVED
FIXED
2.2 S10 (17apr)
| Tracking | Status | |
|---|---|---|
| firefox40 | --- | fixed |
People
(Reporter: yrliou, Assigned: yrliou)
Details
(Whiteboard: [webbt-api])
Attachments
(1 file, 1 obsolete file)
Currently we pass the last valid value in our enums into ContiguousEnumSerializers as the upper bound, which is incorrect.
For example, we will hit |MOZ_ASSERT(EnumValidator::IsLegalValue(aValue))| if we try to send STATUS_RMT_DEV_DOWN through IPC.
This bug is to add a NUM_* in these enums as the upper bound.
| Assignee | ||
Updated•11 years ago
|
Whiteboard: [webbt-api]
| Assignee | ||
Comment 1•11 years ago
|
||
Hi Thomas,
Could you help review my patch?
Thanks,
Jocelyn
Attachment #8590163 -
Flags: review?(tzimmermann)
Comment 2•11 years ago
|
||
Comment on attachment 8590163 [details] [diff] [review]
Bug 1152702 - Fix upper bounds of ContiguousEnumSerializer for BluetoothStatus and BluetoothSspVariant.
Review of attachment 8590163 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/bluetooth2/BluetoothCommon.h
@@ +238,5 @@
> STATUS_PARM_INVALID,
> STATUS_UNHANDLED,
> STATUS_AUTH_FAILURE,
> + STATUS_RMT_DEV_DOWN,
> + NUM_STATUS
I don't know the plural of 'status'.
@@ +281,5 @@
> SSP_VARIANT_PASSKEY_CONFIRMATION,
> SSP_VARIANT_PASSKEY_ENTRY,
> SSP_VARIANT_CONSENT,
> + SSP_VARIANT_PASSKEY_NOTIFICATION,
> + NUM_SSP_VARIANT
Maybe call it 'NUM_SSP_VARIANTS'
@@ +449,5 @@
> enum BluetoothObjectType {
> TYPE_MANAGER = 0,
> TYPE_ADAPTER = 1,
> TYPE_DEVICE = 2,
> + NUM_TYPE
and 'NUM_TYPES'.
Attachment #8590163 -
Flags: review?(tzimmermann) → review+
| Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #2)
> Comment on attachment 8590163 [details] [diff] [review]
> Bug 1152702 - Fix upper bounds of ContiguousEnumSerializer for
> BluetoothStatus and BluetoothSspVariant.
>
> Review of attachment 8590163 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/bluetooth2/BluetoothCommon.h
> @@ +238,5 @@
> > STATUS_PARM_INVALID,
> > STATUS_UNHANDLED,
> > STATUS_AUTH_FAILURE,
> > + STATUS_RMT_DEV_DOWN,
> > + NUM_STATUS
>
> I don't know the plural of 'status'.
>
> @@ +281,5 @@
> > SSP_VARIANT_PASSKEY_CONFIRMATION,
> > SSP_VARIANT_PASSKEY_ENTRY,
> > SSP_VARIANT_CONSENT,
> > + SSP_VARIANT_PASSKEY_NOTIFICATION,
> > + NUM_SSP_VARIANT
>
> Maybe call it 'NUM_SSP_VARIANTS'
>
> @@ +449,5 @@
> > enum BluetoothObjectType {
> > TYPE_MANAGER = 0,
> > TYPE_ADAPTER = 1,
> > TYPE_DEVICE = 2,
> > + NUM_TYPE
>
> and 'NUM_TYPES'.
Hi Thomas,
I'm not sure that we should use plural nouns here.
According to the comment of ContiguousEnumSerializer[1], it looks like we shouldn't use plural nouns?
[1] https://dxr.mozilla.org/mozilla-central/source/ipc/glue/IPCMessageUtils.h#164
Thanks,
Jocelyn
Flags: needinfo?(tzimmermann)
| Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
| Assignee | ||
Comment 6•11 years ago
|
||
No try server result since dom/bluetooth/bluetooth2 won't be built.
Comment 7•11 years ago
|
||
Keywords: checkin-needed
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S10 (17apr)
You need to log in
before you can comment on or make changes to this bug.
Description
•