Skip to content

Commit

Permalink
Password manager internals page: Add logging for parsed forms
Browse files Browse the repository at this point in the history
The PasswordAutofillAgent::SendPasswordForms method is called
both when HTML forms are just parsed, and also when they are rendered.
The former is the moment when the password manager first hears about
forms, and notes their presence not only for autofill, but also
for matching against credentials submitted later.

However, I missed the second use-case (matching submitted credentials)
when I put logging there for the internals page, and so currently
the progress is only logged when the forms are rendered.

This CL should change this: logs are now also sent when the forms have just been parsed.

I already saw issues (e.g., http://crbug.com/367768) where such additional logging would have sped up the investigation.

There are no tests, because we don't which logs are generated when.

BUG=347927

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276848 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
vabr@chromium.org committed Jun 12, 2014
1 parent a427cd1 commit 722bc27
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,10 @@ void PasswordAutofillAgent::FirstUserGestureObserved() {
void PasswordAutofillAgent::SendPasswordForms(blink::WebFrame* frame,
bool only_visible) {
scoped_ptr<RendererSavePasswordProgressLogger> logger;
// From the perspective of saving passwords, only calls with |only_visible|
// being true are important -- the decision whether to save the password is
// only made after visible forms are known, for failed login detection. Calls
// with |only_visible| false are important for password form autofill, which
// is currently not part of the logging.
if (only_visible && logging_state_active_) {
if (logging_state_active_) {
logger.reset(new RendererSavePasswordProgressLogger(this, routing_id()));
logger->LogMessage(Logger::STRING_SEND_PASSWORD_FORMS_METHOD);
logger->LogBoolean(Logger::STRING_ONLY_VISIBLE, only_visible);
}

// Make sure that this security origin is allowed to use password manager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ std::string GetStringFromID(SavePasswordProgressLogger::StringID id) {
return "No matching form";
case SavePasswordProgressLogger::STRING_SSL_ERRORS_PRESENT:
return "SSL errors present";
case SavePasswordProgressLogger::STRING_ONLY_VISIBLE:
return "only_visible";
case SavePasswordProgressLogger::STRING_INVALID:
return "INVALID";
// Intentionally no default: clause here -- all IDs need to get covered.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class SavePasswordProgressLogger {
STRING_SAVING_DISABLED,
STRING_NO_MATCHING_FORM,
STRING_SSL_ERRORS_PRESENT,
STRING_ONLY_VISIBLE,
STRING_INVALID, // Represents a string returned in a case of an error.
STRING_MAX = STRING_INVALID
};
Expand Down

0 comments on commit 722bc27

Please sign in to comment.