Closed
Bug 1087925
Opened 11 years ago
Closed 11 years ago
calling some NFCTag API should throw if the condition is not met.
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.1 S9 (21Nov)
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
(Whiteboard: [p=1])
Attachments
(1 file, 1 obsolete file)
|
1.83 KB,
patch
|
dimi
:
review+
smaug
:
review+
|
Details | Diff | Splinter Review |
In Bug 1074611 we will add maxNDEFSize, isReadOnly, canBeMadeReadOnly attributes into MozNFCTag.
So the following situations should throw.
1. Writing a NDEF that exceeds the maxNDEFSize or isReadOnly is true
2. call makeReadOnly when canBeMadeReadOnly is false.
| Assignee | ||
Comment 1•11 years ago
|
||
Also calling format when the tag is not formatable should throw.
Depends on: 1086179
| Assignee | ||
Comment 2•11 years ago
|
||
Assignee: nobody → allstars.chh
Attachment #8517321 -
Flags: review?(dlee)
| Assignee | ||
Updated•11 years ago
|
No longer blocks: b2g-nfc-privilege
| Assignee | ||
Updated•11 years ago
|
Blocks: b2g-nfc-privilege
| Assignee | ||
Updated•11 years ago
|
No longer blocks: b2g-nfc-privilege
Comment 3•11 years ago
|
||
Comment on attachment 8517321 [details] [diff] [review]
Patch
Review of attachment 8517321 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/nsNfc.js
@@ +78,5 @@
> +
> + let ndefLen = 0;
> + for (let record of records) {
> + let idLen = record.id.length ? 1 : 0;
> + let payloadLen = record.payload.length > 256 ? 4 : 1;
Check the NDEF spec,it doesn't define that a NDEF record with payload length less than 256, it must use a short record.
So we should check SR field in flag here.
Attachment #8517321 -
Flags: review?(dlee)
Comment 4•11 years ago
|
||
(In reply to Dimi Lee[:dimi][:dlee] from comment #3)
> Comment on attachment 8517321 [details] [diff] [review]
> Patch
>
> Review of attachment 8517321 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/nfc/nsNfc.js
> @@ +78,5 @@
> > +
> > + let ndefLen = 0;
> > + for (let record of records) {
> > + let idLen = record.id.length ? 1 : 0;
> > + let payloadLen = record.payload.length > 256 ? 4 : 1;
>
> Check the NDEF spec,it doesn't define that a NDEF record with payload length
> less than 256, it must use a short record.
> So we should check SR field in flag here.
After checking, the flag in NDEF is set in nfcd not in App, so current way is correct.
Updated•11 years ago
|
Attachment #8517321 -
Flags: review+
| Assignee | ||
Comment 5•11 years ago
|
||
use record.size base on Bug 1094669.
Attachment #8517321 -
Attachment is obsolete: true
Attachment #8518682 -
Flags: review?(dlee)
Updated•11 years ago
|
Attachment #8518682 -
Flags: review?(dlee) → review+
| Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8518682 [details] [diff] [review]
Patch v2.
Add r? to smaug for reviewing the DOMError part.
Attachment #8518682 -
Flags: review?(bugs)
Updated•11 years ago
|
Attachment #8518682 -
Flags: review?(bugs) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
Whiteboard: [p=1]
Target Milestone: --- → 2.1 S9 (21Nov)
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•11 years ago
|
Blocks: b2g-nfc-privilege
You need to log in
before you can comment on or make changes to this bug.
Description
•