Bug 665217. Handling corrupt statements in finally blocks. [r=zpao]

This commit is contained in:
Jared Wein 2011-06-21 10:44:10 -07:00
Родитель 9b31b86272
Коммит e53a45ad27
1 изменённых файлов: 48 добавлений и 16 удалений

Просмотреть файл

@ -349,7 +349,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("_addLogin failed: " + e.name + " : " + e.message);
throw "Couldn't write to database, login not added.";
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
// Send a notification that a login was added.
@ -378,7 +380,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("_removeLogin failed: " + e.name + " : " + e.message);
throw "Couldn't write to database, login not removed.";
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
this._sendNotification("removeLogin", storedLogin);
@ -517,7 +521,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("modifyLogin failed: " + e.name + " : " + e.message);
throw "Couldn't write to database, login not modified.";
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
this._sendNotification("modifyLogin", [oldStoredLogin, newLogin]);
@ -665,7 +671,9 @@ LoginManagerStorage_mozStorage.prototype = {
} catch (e) {
this.log("_searchLogins failed: " + e.name + " : " + e.message);
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
this.log("_searchLogins: returning " + logins.length + " logins");
@ -693,7 +701,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("_removeAllLogins failed: " + e.name + " : " + e.message);
throw "Couldn't write to database";
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
this._sendNotification("removeAllLogins", null);
@ -750,7 +760,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("setLoginSavingEnabled failed: " + e.name + " : " + e.message);
throw "Couldn't write to database"
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
this._sendNotification(enabled ? "hostSavingEnabled" : "hostSavingDisabled", hostname);
@ -805,7 +817,9 @@ LoginManagerStorage_mozStorage.prototype = {
} catch (e) {
this.log("_countLogins failed: " + e.name + " : " + e.message);
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
this.log("_countLogins: counted logins: " + numLogins);
@ -905,7 +919,9 @@ LoginManagerStorage_mozStorage.prototype = {
} catch (e) {
this.log("_queryDisabledHosts failed: " + e.name + " : " + e.message);
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
return disabledHosts;
@ -1028,7 +1044,9 @@ LoginManagerStorage_mozStorage.prototype = {
} catch (e) {
this.log("_isGuidUnique failed: " + e.name + " : " + e.message);
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
return (numLogins == 0);
@ -1213,7 +1231,9 @@ LoginManagerStorage_mozStorage.prototype = {
// Ignore singular errors, continue trying to update others.
this.log("_reencryptBase64Logins caught error: " + e);
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
}
} catch (e) {
@ -1386,7 +1406,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("Failed getting IDs: " + e);
throw e;
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
// Generate a GUID for each login and update the DB.
@ -1404,7 +1426,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("Failed setting GUID: " + e);
throw e;
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
}
},
@ -1447,7 +1471,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("Failed getting logins: " + e);
throw e;
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
// Determine encryption type for each login and update the DB.
@ -1460,7 +1486,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("Failed setting encType: " + e);
throw e;
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
}
},
@ -1495,7 +1523,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("Failed getting IDs: " + e);
throw e;
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
// Initialize logins with current time.
@ -1514,7 +1544,9 @@ LoginManagerStorage_mozStorage.prototype = {
this.log("Failed setting timestamps: " + e);
throw e;
} finally {
stmt.reset();
if (stmt) {
stmt.reset();
}
}
}
},