Index: components/password_manager/core/browser/login_database.cc |
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc |
index 4fbd3b2279808b2830ce08fe2a25c987f7337697..3450a41ed2b0fb1642580dc79a78b47ba9a3015d 100644 |
--- a/components/password_manager/core/browser/login_database.cc |
+++ b/components/password_manager/core/browser/login_database.cc |
@@ -8,6 +8,7 @@ |
#include <limits> |
#include "base/bind.h" |
+#include "base/debug/dump_without_crashing.h" |
#include "base/files/file_path.h" |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
@@ -109,6 +110,12 @@ void AddCallback(int err, sql::Statement* /*stmt*/) { |
DLOG(WARNING) << "LoginDatabase::AddLogin updated an existing form"; |
} |
+// http://crbug.com/404012. Let's see where the empty fields come from. |
+void CheckEmptyUsernameAndPassword(const PasswordForm& form) { |
Ilya Sherman
2014/08/22 03:54:29
nit: "Check" -> "CheckFor"
vasilii
2014/08/22 09:32:25
Done.
|
+ if (form.username_value.empty() && form.password_value.empty()) |
+ base::debug::DumpWithoutCrashing(); |
Ilya Sherman
2014/08/22 03:54:29
I don't really know how this code works. Accordin
vasilii
2014/08/22 09:32:25
This callback is a platform dependent Breakpad met
|
+} |
+ |
} // namespace |
LoginDatabase::LoginDatabase() { |
@@ -331,6 +338,7 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username) { |
} |
PasswordStoreChangeList LoginDatabase::AddLogin(const PasswordForm& form) { |
+ CheckEmptyUsernameAndPassword(form); |
PasswordStoreChangeList list; |
std::string encrypted_password; |
if (EncryptedString(form.password_value, &encrypted_password) != |
@@ -372,6 +380,7 @@ PasswordStoreChangeList LoginDatabase::AddLogin(const PasswordForm& form) { |
} |
PasswordStoreChangeList LoginDatabase::UpdateLogin(const PasswordForm& form) { |
+ CheckEmptyUsernameAndPassword(form); |
std::string encrypted_password; |
if (EncryptedString(form.password_value, &encrypted_password) != |
ENCRYPTION_RESULT_SUCCESS) |