Closed Bug 1085301 Opened 11 years ago Closed 11 years ago

B2G NFC: checking sessionToken in notifyPeerReady is unneccesary.

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S8 (7Nov)

People

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

References

Details

(Whiteboard: [p=1])

Attachments

(1 file, 1 obsolete file)

In notifyPeerReady from nsNfc.js it will call getNFCPeer to get the peer object, however the getNFCPeer will also do the session check, which is not neccesary.
Assignee: nobody → allstars.chh
Comment on attachment 8517173 [details] [diff] [review] Patch Review of attachment 8517173 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/nfc/nsNfc.js @@ +202,5 @@ > > + _createNFCPeer: function _createNFCPeer(sessionToken) { > + let peer = new MozNFCPeerImpl(this._window, sessionToken); > + this.nfcPeer = this._window.MozNFCPeer._create(this._window, peer); > + return this.nfcPeer; _createNFCPeer is a private function of mozNfc and this function set both |this.ncPeer| member variable and return this member variable. I think it would be better just: return this._window.MozNFCPeer._create(this._window, peer);
Attachment #8517173 - Flags: review?(dlee) → review+
Attached patch Patch v2.Splinter Review
move assigning this.nfcPeer outside.
Attachment #8517173 - Attachment is obsolete: true
Attachment #8517263 - Flags: review+
Whiteboard: [p=1]
Target Milestone: --- → 2.1 S8 (7Nov)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: