Commit 3e966cac authored by vabr's avatar vabr Committed by Commit bot

[Password manager] Temporarily add some CHECKs to investigate a crash

Add some CHECKs to see if some of the hypotheses in http://crbug.com/486931#c3 (however unlikely they seem) could be right.
This is in line with https://www.chromium.org/developers/coding-style#TOC-CHECK-DCHECK-and-NOTREACHED-.

BUG=486931

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

Cr-Commit-Position: refs/heads/master@{#329393}
parent 989d8fb9
......@@ -149,7 +149,8 @@ void ManagePasswordsState::OnAutomaticPasswordSave(
void ManagePasswordsState::OnPasswordAutofilled(
const PasswordFormMap& password_form_map) {
DCHECK(!password_form_map.empty());
// TODO(vabr): Revert back to DCHECK once http://crbug.com/486931 is fixed.
CHECK(!password_form_map.empty());
ClearData();
if (password_form_map.begin()->second->IsPublicSuffixMatch()) {
// Don't show the UI for PSL matched passwords. They are not stored for this
......
......@@ -76,13 +76,17 @@ PasswordForm::PasswordForm()
generation_upload_status(NO_SIGNAL_SENT),
skip_zero_click(false),
layout(Layout::LAYOUT_OTHER),
was_parsed_using_autofill_predictions(false) {
was_parsed_using_autofill_predictions(false),
is_alive(true) {
}
PasswordForm::~PasswordForm() {
CHECK(is_alive);
is_alive = false;
}
bool PasswordForm::IsPublicSuffixMatch() const {
CHECK(is_alive);
return !original_signon_realm.empty();
}
......
......@@ -265,6 +265,9 @@ struct PasswordForm {
// If true, this form was parsed using Autofill predictions.
bool was_parsed_using_autofill_predictions;
// TODO(vabr): Remove |is_alive| once http://crbug.com/486931 is fixed.
bool is_alive; // Set on construction, reset on destruction.
// Returns true if this match was found using public suffix matching.
bool IsPublicSuffixMatch() const;
......
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