Commit 0ae57a53 authored by vasilii's avatar vasilii Committed by Commit bot

Track empty username and password in PasswordStore.

Having both username and password empty is incorrect. We should find out where they come from.

BUG=404012

Review URL: https://codereview.chromium.org/514573002

Cr-Commit-Position: refs/heads/master@{#292135}
parent 7b9995c5
......@@ -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)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment