mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 748852 - Contacts API: Fix leak, error handling. r=fabrice
This commit is contained in:
parent
423a1ad7a5
commit
46b2d1ab44
@ -334,8 +334,6 @@ ContactManager.prototype = {
|
||||
"Contact:Save:Return:OK", "Contact:Save:Return:KO",
|
||||
"Contact:Remove:Return:OK", "Contact:Remove:Return:KO"]);
|
||||
|
||||
Services.obs.addObserver(this, "inner-window-destroyed", false);
|
||||
|
||||
let principal = aWindow.document.nodePrincipal;
|
||||
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
|
||||
|
||||
|
@ -153,27 +153,10 @@ ContactDB.prototype = {
|
||||
};
|
||||
|
||||
txn.onabort = function (event) {
|
||||
debug("Caught error on transaction" + event.target.error.name);
|
||||
switch(event.target.error.name) {
|
||||
case "AbortError":
|
||||
case "ConstraintError":
|
||||
case "DataError":
|
||||
case "SyntaxError":
|
||||
case "InvalidStateError":
|
||||
case "NotFoundError":
|
||||
case "QuotaExceededError":
|
||||
case "ReadOnlyError":
|
||||
case "TimeoutError":
|
||||
case "TransactionInactiveError":
|
||||
case "VersionError":
|
||||
case "UnknownError":
|
||||
debug("Caught error on transaction");
|
||||
// FIXXMEE: this will work in the future. Bug 748630
|
||||
// failureCb(event.target.error.name);
|
||||
failureCb("UnknownError");
|
||||
break;
|
||||
default:
|
||||
debug("Unknown error", event.target.error.name);
|
||||
failureCb("UnknownError");
|
||||
break;
|
||||
}
|
||||
};
|
||||
callback(txn, store);
|
||||
}, failureCb);
|
||||
|
@ -61,6 +61,7 @@ let DOMContactManager = {
|
||||
this._messages = null;
|
||||
if (this._db)
|
||||
this._db.close();
|
||||
this._db = null;
|
||||
},
|
||||
|
||||
receiveMessage: function(aMessage) {
|
||||
|
Loading…
Reference in New Issue
Block a user