Bug 1061827 - Nfc.js serializes all the messages, even in release mode. r=allstars.chh

This commit is contained in:
Krzysztof Mioduszewski 2014-09-05 00:21:00 -04:00
parent 50f643b1d6
commit 35c6d11acf
2 changed files with 6 additions and 7 deletions

View File

@ -365,13 +365,11 @@ NfcContentHelper.prototype = {
fireRequestSuccess: function fireRequestSuccess(requestId, result) {
let request = this.takeRequest(requestId);
if (!request) {
debug("not firing success for id: " + requestId +
", result: " + JSON.stringify(result));
debug("not firing success for id: " + requestId);
return;
}
debug("fire request success, id: " + requestId +
", result: " + JSON.stringify(result));
debug("fire request success, id: " + requestId);
Services.DOMRequest.fireSuccess(request, result);
},
@ -389,7 +387,7 @@ NfcContentHelper.prototype = {
},
receiveMessage: function receiveMessage(message) {
debug("Message received: " + JSON.stringify(message));
DEBUG && debug("Message received: " + JSON.stringify(message));
let result = message.json;
switch (message.name) {

View File

@ -232,7 +232,8 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
*/
receiveMessage: function receiveMessage(message) {
debug("Received '" + JSON.stringify(message) + "' message from content process");
DEBUG && debug("Received message from content process: " + JSON.stringify(message));
if (message.name == "child-process-shutdown") {
this.removePeerTarget(message.target);
this.nfc.removeTarget(message.target);
@ -398,7 +399,7 @@ Nfc.prototype = {
*/
onEvent: function onEvent(event) {
let message = Cu.cloneInto(event, this);
debug("Received message from NFC Service: " + JSON.stringify(message));
DEBUG && debug("Received message from NFC Service: " + JSON.stringify(message));
// mapping error code to error message
if (message.status !== undefined && message.status !== NFC.NFC_SUCCESS) {