diff --git a/dom/contacts/fallback/ContactDB.jsm b/dom/contacts/fallback/ContactDB.jsm index c1a42582eac..686ebcd7371 100644 --- a/dom/contacts/fallback/ContactDB.jsm +++ b/dom/contacts/fallback/ContactDB.jsm @@ -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) { diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp index feb00dd2e4b..56865fa8cf7 100644 --- a/dom/indexedDB/IDBCursor.cpp +++ b/dom/indexedDB/IDBCursor.cpp @@ -463,7 +463,7 @@ IDBCursor::GetDirection(nsAString& aDirection) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); - switch(mDirection) { + switch (mDirection) { case NEXT: aDirection.AssignLiteral("next"); break; diff --git a/dom/indexedDB/IDBTransaction.cpp b/dom/indexedDB/IDBTransaction.cpp index 4db736cb995..9729b26233a 100644 --- a/dom/indexedDB/IDBTransaction.cpp +++ b/dom/indexedDB/IDBTransaction.cpp @@ -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;