Bug 823999 - Add logging to the Contacts code to diagnose intermittent failure.

--HG--
extra : rebase_source : 7ded707e14bb280ea93582da5dbd460248518418
This commit is contained in:
Reuben Morais 2013-04-12 01:51:49 -07:00
parent 80586339fa
commit bc4c528383
3 changed files with 9 additions and 3 deletions

View File

@ -4,7 +4,7 @@
"use strict";
const DEBUG = false;
let DEBUG = false;
function debug(s) { dump("-*- ContactManager: " + s + "\n"); }
const Cc = Components.classes;
@ -637,6 +637,7 @@ ContactManager.prototype = {
},
find: function(aOptions) {
DEBUG = false;
if (DEBUG) debug("find! " + JSON.stringify(aOptions));
let request = this.createRequest();
let options = { findOptions: aOptions };
@ -701,6 +702,7 @@ ContactManager.prototype = {
},
clear: function() {
DEBUG = true;
if (DEBUG) debug("clear");
let request;
request = this.createRequest();

View File

@ -6,7 +6,7 @@
this.EXPORTED_SYMBOLS = ['ContactDB'];
const DEBUG = false;
let DEBUG = false;
function debug(s) { dump("-*- ContactDB component: " + s + "\n"); }
const Cu = Components.utils;
@ -461,6 +461,7 @@ ContactDB.prototype = {
},
clear: function clear(aSuccessCb, aErrorCb) {
DEBUG = true;
this.newTxn("readwrite", STORE_NAME, function (txn, store) {
if (DEBUG) debug("Going to clear all!");
store.clear();
@ -618,6 +619,7 @@ ContactDB.prototype = {
* - count
*/
find: function find(aSuccessCb, aFailureCb, aOptions) {
DEBUG = false;
if (DEBUG) debug("ContactDB:find val:" + aOptions.filterValue + " by: " + aOptions.filterBy + " op: " + aOptions.filterOp);
let self = this;
this.newTxn("readonly", STORE_NAME, function (txn, store) {

View File

@ -4,7 +4,7 @@
"use strict";
const DEBUG = false;
let DEBUG = false;
function debug(s) { dump("-*- Fallback ContactService component: " + s + "\n"); }
const Cu = Components.utils;
@ -90,6 +90,7 @@ let ContactService = {
switch (aMessage.name) {
case "Contacts:Find":
DEBUG = false;
if (!this.assertPermission(aMessage, "contacts-read")) {
return null;
}
@ -150,6 +151,7 @@ let ContactService = {
);
break;
case "Contacts:Clear":
DEBUG = true;
if (!this.assertPermission(aMessage, "contacts-write")) {
return null;
}