Bug 735357: Fix Contacts API to use new IndexedDB constants. r=gwagner

This commit is contained in:
Jonas Sicking 2012-03-13 13:25:05 -07:00
parent fe5be9ae3c
commit 52729f8ff5
3 changed files with 7 additions and 7 deletions

View File

@ -123,7 +123,7 @@ ContactDB.prototype = {
* Start a new transaction.
*
* @param txn_type
* Type of transaction (e.g. IDBTransaction.READ_WRITE)
* Type of transaction (e.g. "readwrite")
* @param callback
* Function to call when the transaction is available. It will
* be invoked with the transaction and the 'contacts' object store.
@ -234,7 +234,7 @@ ContactDB.prototype = {
saveContact: function saveContact(aContact, successCb, errorCb) {
let contact = this.makeImport(aContact);
this.newTxn(Ci.nsIIDBTransaction.READ_WRITE, function (txn, store) {
this.newTxn("readwrite", function (txn, store) {
debug("Going to update" + JSON.stringify(contact));
// Look up the existing record and compare the update timestamp.
@ -263,14 +263,14 @@ ContactDB.prototype = {
},
removeContact: function removeContact(aId, aSuccessCb, aErrorCb) {
this.newTxn(Ci.nsIIDBTransaction.READ_WRITE, function (txn, store) {
this.newTxn("readwrite", function (txn, store) {
debug("Going to delete" + aId);
store.delete(aId);
}, aSuccessCb, aErrorCb);
},
clear: function clear(aSuccessCb, aErrorCb) {
this.newTxn(Ci.nsIIDBTransaction.READ_WRITE, function (txn, store) {
this.newTxn("readwrite", function (txn, store) {
debug("Going to clear all!");
store.clear();
}, aSuccessCb, aErrorCb);
@ -297,7 +297,7 @@ ContactDB.prototype = {
debug("ContactDB:find val:" + aOptions.filterValue + " by: " + aOptions.filterBy + " op: " + aOptions.filterOp + "\n");
let self = this;
this.newTxn(Ci.nsIIDBTransaction.READ_ONLY, function (txn, store) {
this.newTxn("readonly", function (txn, store) {
if (aOptions && aOptions.filterOp == "equals") {
self._findWithIndex(txn, store, aOptions);
} else if (aOptions && aOptions.filterBy) {

View File

@ -463,7 +463,7 @@ IDBCursor::GetDirection(nsAString& aDirection)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
switch(mDirection) {
switch (mDirection) {
case NEXT:
aDirection.AssignLiteral("next");
break;

View File

@ -532,7 +532,7 @@ IDBTransaction::GetMode(nsAString& aMode)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
switch(mMode) {
switch (mMode) {
case READ_ONLY:
aMode.AssignLiteral("readonly");
break;