Closed Bug 1057998 Opened 7 years ago Closed 7 years ago

B2G NFC: Remove NDEFRecord from NfcOptions.webidl

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

Attachments

(1 file)

Hi Smaug

When I implemented this I met the following error when I try to send NDEFs

08-26 05:33:24.873: E/GeckoConsole(177): [JavaScript Error: "Element of 'records' member of NfcCommandOptions does not implement interface MozNDEFRecord." {file: "jar:file:///system/b2g/omni.ja!/components/Nfc.js" line: 372}]

I recall that in NfcContentHelper.js we convert it to plain JS object in 
http://dxr.mozilla.org/mozilla-central/source/dom/nfc/NfcContentHelper.js?from=NfcContentHelper.js#171

as nsFrameMessageManager can't create structure clone of MozNDEFRecord.

Can you help to provide some suggestions when I should do here?

Thanks
Flags: needinfo?(bugs)
Attached patch WIP PatchSplinter Review
Upload the WIP patch.
Add a ChromeConstructor to MozNDEFRecord and create such objects from plain JS 
https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings#ChromeConstructor ?
Flags: needinfo?(bugs)
Hi, smaug
Thanks for your suggestion, however I check [ChromeConstructor] cannot be used with [Constructor] on the same interface, which means I have to create another interface called 'ChromeNDEFRecord', right?

But isn't this the same question you asked in https://bugzilla.mozilla.org/show_bug.cgi?id=1053732#c9

Or what exactly do you mean in "We should be able to have just one"?
Flags: needinfo?(bugs)
Oops, sorry I think smaug means remove either MozNDEFRecordOptions or NDEFRecord dictionaries?
I confused it with MozNDEFRecord. :P
Flags: needinfo?(bugs)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.