Bug 1824112 - switch to addLoginAsync r=credential-management-reviewers,sgalich,sync-reviewers,markh

Differential Revision: https://phabricator.services.mozilla.com/D175666
This commit is contained in:
Johannes J. Schmidt 2023-05-10 07:47:24 +00:00
parent f327741028
commit d47a190db0
4 changed files with 6 additions and 3 deletions

View File

@ -562,7 +562,7 @@ LoginManagerStorage.prototype = {
if (existingLogins.length) {
Services.logins.modifyLogin(existingLogins[0], login);
} else {
Services.logins.addLogin(login);
await Services.logins.addLoginAsync(login);
}
log.trace("finished write of user data to the login manager");
} catch (ex) {

View File

@ -346,7 +346,7 @@ PasswordStore.prototype = {
"formSubmitURL: " +
JSON.stringify(login.formActionOrigin)
);
Services.logins.addLogin(login);
await Services.logins.addLoginAsync(login);
},
async remove(record) {

View File

@ -99,6 +99,7 @@ Password.prototype = {
this.props.usernameField,
this.props.passwordField
);
// TODO: use `addLoginAsync` instead, see https://bugzilla.mozilla.org/show_bug.cgi?id=1829396
Services.logins.addLogin(login);
login.QueryInterface(Ci.nsILoginMetaInfo);
return login.guid;

View File

@ -1414,7 +1414,9 @@ export class LoginManagerParent extends JSWindowActorParent {
existingLogin.password = formLogin.password;
} else if (!autoSavedLogin) {
lazy.log("Auto-saving new login with empty username.");
existingLogin = Services.logins.addLogin(formLoginWithoutUsername);
existingLogin = await Services.logins.addLoginAsync(
formLoginWithoutUsername
);
// Remember the GUID where we saved the generated password so we can update
// the login if the user later edits the generated password.
generatedPW.storageGUID = existingLogin.guid;