mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 987595 - B2G NFC: onpeerready isn't called. r=dimi
This commit is contained in:
parent
d57ebccf9b
commit
1e5774cd89
@ -358,21 +358,10 @@ NfcContentHelper.prototype = {
|
||||
receiveMessage: function receiveMessage(message) {
|
||||
debug("Message received: " + JSON.stringify(message));
|
||||
let result = message.json;
|
||||
let requester = this._requestMap[result.requestId];
|
||||
if (!requester) {
|
||||
debug("Response Invalid requestId=" + result.requestId);
|
||||
return;
|
||||
}
|
||||
delete this._requestMap[result.requestId];
|
||||
|
||||
if (result.status !== NFC.GECKO_NFC_ERROR_SUCCESS) {
|
||||
this.fireRequestError(atob(result.requestId), result.status);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (message.name) {
|
||||
case "NFC:ReadNDEFResponse":
|
||||
this.handleReadNDEFResponse(requester, result);
|
||||
this.handleReadNDEFResponse(result);
|
||||
break;
|
||||
case "NFC:GetDetailsNDEFResponse":
|
||||
this.handleGetDetailsNDEFResponse(result);
|
||||
@ -397,7 +386,19 @@ NfcContentHelper.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
handleReadNDEFResponse: function handleReadNDEFResponse(requester, result) {
|
||||
handleReadNDEFResponse: function handleReadNDEFResponse(result) {
|
||||
let requester = this._requestMap[result.requestId];
|
||||
if (!requester) {
|
||||
debug("Response Invalid requestId=" + result.requestId);
|
||||
return;
|
||||
}
|
||||
delete this._requestMap[result.requestId];
|
||||
|
||||
if (result.status !== NFC.GECKO_NFC_ERROR_SUCCESS) {
|
||||
this.fireRequestError(atob(result.requestId), result.status);
|
||||
return;
|
||||
}
|
||||
|
||||
let requestId = atob(result.requestId);
|
||||
let ndefMsg = [];
|
||||
let records = result.records;
|
||||
@ -412,6 +413,11 @@ NfcContentHelper.prototype = {
|
||||
},
|
||||
|
||||
handleGetDetailsNDEFResponse: function handleGetDetailsNDEFResponse(result) {
|
||||
if (result.status !== NFC.GECKO_NFC_ERROR_SUCCESS) {
|
||||
this.fireRequestError(atob(result.requestId), result.status);
|
||||
return;
|
||||
}
|
||||
|
||||
let requestId = atob(result.requestId);
|
||||
let result = new GetDetailsNDEFResponse(result);
|
||||
this.fireRequestSuccess(requestId, result);
|
||||
|
Loading…
Reference in New Issue
Block a user