mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Bug 1085296 - B2G NFC: enable debug when either flag is enabled or settings is enabled. r=dimi
This commit is contained in:
parent
a415e20197
commit
98d7ceef14
@ -37,7 +37,7 @@ let DEBUG = NFC.DEBUG_CONTENT_HELPER;
|
||||
|
||||
let debug;
|
||||
function updateDebug() {
|
||||
if (DEBUG) {
|
||||
if (DEBUG || NFC.DEBUG_CONTENT_HELPER) {
|
||||
debug = function (s) {
|
||||
dump("-*- NfcContentHelper: " + s + "\n");
|
||||
};
|
||||
@ -99,7 +99,7 @@ NfcContentHelper.prototype = {
|
||||
this._window = aWindow;
|
||||
this.initDOMRequestHelper(this._window, NFC_IPC_MSG_NAMES);
|
||||
|
||||
if (this._window.navigator.mozSettings) {
|
||||
if (!NFC.DEBUG_CONTENT_HELPER && this._window.navigator.mozSettings) {
|
||||
let lock = this._window.navigator.mozSettings.createLock();
|
||||
var nfcDebug = lock.get(NFC.SETTING_NFC_DEBUG);
|
||||
nfcDebug.onsuccess = function _nfcDebug() {
|
||||
|
@ -40,7 +40,7 @@ let DEBUG = NFC.DEBUG_NFC;
|
||||
|
||||
let debug;
|
||||
function updateDebug() {
|
||||
if (DEBUG) {
|
||||
if (DEBUG || NFC.DEBUG_NFC) {
|
||||
debug = function (s) {
|
||||
dump("-*- Nfc: " + s + "\n");
|
||||
};
|
||||
@ -108,10 +108,12 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
|
||||
init: function init(nfc) {
|
||||
this.nfc = nfc;
|
||||
|
||||
let lock = gSettingsService.createLock();
|
||||
lock.get(NFC.SETTING_NFC_DEBUG, this.nfc);
|
||||
if (!NFC.DEBUG_NFC) {
|
||||
let lock = gSettingsService.createLock();
|
||||
lock.get(NFC.SETTING_NFC_DEBUG, this.nfc);
|
||||
Services.obs.addObserver(this, NFC.TOPIC_MOZSETTINGS_CHANGED, false);
|
||||
}
|
||||
|
||||
Services.obs.addObserver(this, NFC.TOPIC_MOZSETTINGS_CHANGED, false);
|
||||
Services.obs.addObserver(this, NFC.TOPIC_XPCOM_SHUTDOWN, false);
|
||||
this._registerMessageListeners();
|
||||
},
|
||||
|
@ -19,8 +19,8 @@
|
||||
this.DEBUG_ALL = false;
|
||||
|
||||
// Set individually to debug specific layers
|
||||
this.DEBUG_CONTENT_HELPER = false || DEBUG_ALL;
|
||||
this.DEBUG_NFC = false || DEBUG_ALL;
|
||||
this.DEBUG_CONTENT_HELPER = DEBUG_ALL || false;
|
||||
this.DEBUG_NFC = DEBUG_ALL || false;
|
||||
|
||||
// Gecko specific error codes
|
||||
this.NFC_GECKO_SUCCESS = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user