mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 735357: Fix Contacts API to use new IndexedDB constants. r=gwagner
This commit is contained in:
parent
9ebec5c37a
commit
a6918c141f
@ -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) {
|
||||
|
@ -463,7 +463,7 @@ IDBCursor::GetDirection(nsAString& aDirection)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
switch(mDirection) {
|
||||
switch (mDirection) {
|
||||
case NEXT:
|
||||
aDirection.AssignLiteral("next");
|
||||
break;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user