Index: components/autofill/core/browser/password_generator.cc |
diff --git a/components/autofill/core/browser/password_generator.cc b/components/autofill/core/browser/password_generator.cc |
index 36964ad1ebd0931a291d8404c82dd06dbd664ed8..d66e062d53222b183c04335747ed65b003e057cf 100644 |
--- a/components/autofill/core/browser/password_generator.cc |
+++ b/components/autofill/core/browser/password_generator.cc |
@@ -88,21 +88,17 @@ std::string PasswordGenerator::Generate() const { |
unsigned int mode = S_NB | S_CL | S_SL; |
// gen_pron_pass() doesn't guarantee that it includes all of the type given |
- // in mode, so regenerate a few times if neccessary. |
- // TODO(gcasto): Is it worth regenerating at all? |
- for (int i = 0; i < 10; ++i) { |
- gen_pron_pass(password, unused_hypenated_password, |
- password_length_, password_length_, mode); |
- if (VerifyPassword(password)) |
- break; |
- } |
- |
- // If the password still isn't conforming after a few iterations, force it |
- // to be so. This may change a syllable in the password. |
+ // in mode, so if generated password is not proper we will force fix this by |
+ // |ForceFixPassword| as lowercase letters are default in generated password. |
AKV
2015/06/22 09:39:18
Can we reduce this password generation loop furthe
Deepak
2015/06/22 10:50:31
ok, I will raise the bug and discuss this.
|
+ gen_pron_pass(password, unused_hypenated_password, password_length_, |
+ password_length_, mode); |
+ if (VerifyPassword(password)) |
+ return std::string(password); |
AKV
2015/06/22 09:39:18
Looks legitimate.
Deepak
2015/06/22 10:50:31
Done.
|
+ |
+ // As the password isn't conforming force it to be so. This may change a |
+ // syllable in the password. |
std::string str_password(password); |
- if (!VerifyPassword(str_password)) { |
- ForceFixPassword(&str_password); |
- } |
+ ForceFixPassword(&str_password); |
return str_password; |
} |