Closed
Bug 1137107
Opened 10 years ago
Closed 10 years ago
Move RequestType, ResponseType and NotificationTypes into NfcOptions.webidl
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(firefox39 fixed)
RESOLVED
FIXED
2.2 S12 (15may)
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
(Whiteboard: [p=3])
Attachments
(3 files, 1 obsolete file)
12.91 KB,
patch
|
dimi
:
review+
smaug
:
review+
|
Details | Diff | Splinter Review |
23.53 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
6.27 KB,
patch
|
Details | Diff | Splinter Review |
We could take advantage of the enum in WebIDL to define those message types sent between nfcd.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8569740 -
Flags: review?(dlee)
Assignee | ||
Updated•10 years ago
|
Attachment #8569741 -
Flags: review?(dlee)
Updated•10 years ago
|
Attachment #8569740 -
Flags: review?(dlee) → review+
Updated•10 years ago
|
Attachment #8569741 -
Flags: review?(dlee) → review+
Assignee | ||
Updated•10 years ago
|
Attachment #8569740 -
Flags: review?(bugs)
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8569740 [details] [diff] [review]
Part 1: Add NfcRequestType.
Sorry, type too fast
r? to smaug for the WebIDL change in NfcOptions.webidl.
Assignee | ||
Comment 4•10 years ago
|
||
Comment on attachment 8569741 [details] [diff] [review]
Part 2: Add NfcResponseType and NfcNotificationType.
r? to smaug for the WebIDL change in NfcOptions.webidl.
Attachment #8569741 -
Flags: review?(bugs)
Comment 5•10 years ago
|
||
Comment on attachment 8569740 [details] [diff] [review]
Part 1: Add NfcRequestType.
I wonder if some other NfcCommandOptions properties could be 'required' too.
Attachment #8569740 -
Flags: review?(bugs) → review+
Comment 6•10 years ago
|
||
Comment on attachment 8569741 [details] [diff] [review]
Part 2: Add NfcResponseType and NfcNotificationType.
notiType sounds really odd.
Isn't the API a bit odd if there is rspType and notiType but only value
from one of them is used.
Does webidl support
(NfcResponseType or NfcNotificationType) type;
Attachment #8569741 -
Flags: review?(bugs) → review-
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #6)
> Comment on attachment 8569741 [details] [diff] [review]
> Part 2: Add NfcResponseType and NfcNotificationType.
>
> notiType sounds really odd.
>
> Isn't the API a bit odd if there is rspType and notiType but only value
> from one of them is used.
>
These two properties are in dictionary so they could be optional, so they won't exist at the same time.
Actually my first attempt is to divide the options into two dictionaries, one for response and the other for notification, but it turned out I have to modify a lot of code which using the dictionary, I didn't finish it and turn to this patch.
I'll try if I cound merge these two properties.
> Does webidl support
> (NfcResponseType or NfcNotificationType) type;
No, they are both enums
self._parser_results = parser.finish()
File "/home/allstars/src/github/mozilla-b2g/B2G_FlameKK/gecko/dom/bindings/parser/WebIDL.py", line 5788, in finish
production.finish(self.globalScope())
File "/home/allstars/src/github/mozilla-b2g/B2G_FlameKK/gecko/dom/bindings/parser/WebIDL.py", line 1454, in finish
member.complete(scope)
File "/home/allstars/src/github/mozilla-b2g/B2G_FlameKK/gecko/dom/bindings/parser/WebIDL.py", line 3553, in complete
type = self.type.complete(scope)
File "/home/allstars/src/github/mozilla-b2g/B2G_FlameKK/gecko/dom/bindings/parser/WebIDL.py", line 2178, in complete
[self.location, t.location, u.location])
WebIDL.WebIDLError: error: Flat member types of a union should be distinguishable, NfcResponseType (Wrapper) is not distinguishable from NfcNotificationType (Wrapper), /home/allstars/src/github/mozilla-b2g/B2G_FlameKK/gecko/dom/webidl/NfcOptions.webidl line 65:2
(NfcResponseType or NfcNotificationType) type;
^
/home/allstars/src/github/mozilla-b2g/B2G_FlameKK/gecko/dom/webidl/NfcOptions.webidl line 65:3
(NfcResponseType or NfcNotificationType) type;
^
/home/allstars/src/github/mozilla-b2g/B2G_FlameKK/gecko/dom/webidl/NfcOptions.webidl line 65:22
(NfcResponseType or NfcNotificationType) type;
^
make[6]: *** [codegen.pp] Error 1
make[5]: *** [dom/bindings/export] Error 2
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [export] Error 2
make[3]: *** [default] Error 2
make[2]: *** [realbuild] Error 2
make[1]: *** [build] Error 2
make: *** [out/target/product/flame/obj/DATA/gecko_intermediates/gecko] Error 2
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #5)
> Comment on attachment 8569740 [details] [diff] [review]
> Part 1: Add NfcRequestType.
>
> I wonder if some other NfcCommandOptions properties could be 'required' too.
Hi Smaug
No. Only the type and requestId are mandatory.
Assignee | ||
Comment 9•10 years ago
|
||
Hi Smaug
See my comment 7 for your previous question.
The term 'Notification' is from NFC Specification, and the specification uses XXX_RSP and XXX_NTF for the messages.
So how do you think I rename them to
- ntfType
- rspType
And if you still think the dict seems odd, I'll file a separate bug to split the dict into two, one fo response and the other for notification.
How do you think?
Thanks
Flags: needinfo?(bugs)
Comment 10•10 years ago
|
||
ntfType and rspType is better.
Should the relevant method throw if both types are used?
Flags: needinfo?(bugs)
Assignee | ||
Comment 11•10 years ago
|
||
rename to ntfType,
also add MOZ_ASSERT for checking only one of rspType and ntfType should be used.
Attachment #8569741 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8572396 -
Flags: review?(bugs)
Assignee | ||
Comment 12•10 years ago
|
||
add interdiff for Part 2.
Updated•10 years ago
|
Attachment #8572396 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 13•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/16fef4e9b00b
https://hg.mozilla.org/integration/b2g-inbound/rev/80d1a77e6c2a
Whiteboard: [p=3]
Target Milestone: --- → 2.2 S12 (15may)
You need to log in
before you can comment on or make changes to this bug.
Description
•