diff --git a/dom/nfc/nsNfc.js b/dom/nfc/nsNfc.js index 78c88167333..7033155ba7d 100644 --- a/dom/nfc/nsNfc.js +++ b/dom/nfc/nsNfc.js @@ -192,6 +192,10 @@ MozNFCTagImpl.prototype = { return callback.promise; }, + notifyLost: function notifyLost() { + this.isLost = true; + }, + classID: Components.ID("{4e1e2e90-3137-11e3-aa6e-0800200c9a66}"), contractID: "@mozilla.org/nfc/tag;1", QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, @@ -244,6 +248,10 @@ MozNFCPeerImpl.prototype = { return callback.promise; }, + notifyLost: function notifyLost() { + this.isLost = true; + }, + classID: Components.ID("{c1b2bcf0-35eb-11e3-aa6e-0800200c9a66}"), contractID: "@mozilla.org/nfc/peer;1", QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, @@ -432,7 +440,7 @@ MozNFCImpl.prototype = { this, /* useCapture */false); } - this.nfcTag.isLost = true; + this.nfcTag.notifyLost(); this.nfcTag = null; debug("fire ontaglost " + sessionToken); @@ -491,7 +499,7 @@ MozNFCImpl.prototype = { this, /* useCapture */false); } - this.nfcPeer.isLost = true; + this.nfcPeer.notifyLost(); this.nfcPeer = null; debug("fire onpeerlost"); diff --git a/dom/webidl/MozNFCPeer.webidl b/dom/webidl/MozNFCPeer.webidl index a98b7a635c5..1ab4bccce2e 100644 --- a/dom/webidl/MozNFCPeer.webidl +++ b/dom/webidl/MozNFCPeer.webidl @@ -10,6 +10,11 @@ [JSImplementation="@mozilla.org/nfc/peer;1", AvailableIn="PrivilegedApps"] interface MozNFCPeer { + /** + * Indicate if this peer is already lost. + */ + readonly attribute boolean isLost; + /** * Send NDEF data to peer device. */ @@ -28,8 +33,6 @@ partial interface MozNFCPeer { [ChromeOnly] attribute DOMString session; - /** - * Indicate if this peer is already lost. - */ - readonly attribute boolean isLost; + [ChromeOnly] + void notifyLost(); }; diff --git a/dom/webidl/MozNFCTag.webidl b/dom/webidl/MozNFCTag.webidl index 07b31ab1f2c..07f564b4ef0 100644 --- a/dom/webidl/MozNFCTag.webidl +++ b/dom/webidl/MozNFCTag.webidl @@ -72,6 +72,11 @@ interface MozNFCTag { */ readonly attribute boolean? canBeMadeReadOnly; + /** + * Indicate if this tag is already lost. + */ + readonly attribute boolean isLost; + /** * Read current NDEF data on the tag. */ @@ -102,8 +107,6 @@ partial interface MozNFCTag { [ChromeOnly] attribute DOMString session; - /** - * Indicate if this tag is already lost. - */ - readonly attribute boolean isLost; + [ChromeOnly] + void notifyLost(); };