Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: components/password_manager/core/browser/password_store.cc

Issue 514573002: Track empty username and password in PasswordStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_store.cc
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc
index b5a2b734ae05fbf7ee92bf045c84eac97b9c6f15..b431dafcc95370d2b5214fd85f9239879afe42a4 100644
--- a/components/password_manager/core/browser/password_store.cc
+++ b/components/password_manager/core/browser/password_store.cc
@@ -5,6 +5,7 @@
#include "components/password_manager/core/browser/password_store.h"
#include "base/bind.h"
+#include "base/debug/dump_without_crashing.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
@@ -35,6 +36,12 @@ void MaybeCallConsumerCallback(base::WeakPtr<PasswordStoreConsumer> consumer,
STLDeleteElements(result.get());
}
+// http://crbug.com/404012. Let's see where the empty fields come from.
+void CheckForEmptyUsernameAndPassword(const PasswordForm& form) {
+ if (form.username_value.empty() && form.password_value.empty())
+ base::debug::DumpWithoutCrashing();
+}
+
} // namespace
PasswordStore::GetLoginsRequest::GetLoginsRequest(
@@ -88,12 +95,14 @@ bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare,
}
void PasswordStore::AddLogin(const PasswordForm& form) {
+ CheckForEmptyUsernameAndPassword(form);
ScheduleTask(
base::Bind(&PasswordStore::WrapModificationTask, this,
base::Bind(&PasswordStore::AddLoginImpl, this, form)));
}
void PasswordStore::UpdateLogin(const PasswordForm& form) {
+ CheckForEmptyUsernameAndPassword(form);
ScheduleTask(
base::Bind(&PasswordStore::WrapModificationTask, this,
base::Bind(&PasswordStore::UpdateLoginImpl, this, form)));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698