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

Unified Diff: components/autofill/core/browser/autofill_download_manager.cc

Issue 1622703002: [Autofill] Re-introduce some debug logs for Autofill queries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | components/autofill/core/browser/form_structure.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_download_manager.cc
diff --git a/components/autofill/core/browser/autofill_download_manager.cc b/components/autofill/core/browser/autofill_download_manager.cc
index 91bcdf4ea156978494a47d7b6fab9b328088cc6c..3e31a9d3a343a823d11a6e466bffaa18cea7901f 100644
--- a/components/autofill/core/browser/autofill_download_manager.cc
+++ b/components/autofill/core/browser/autofill_download_manager.cc
@@ -91,6 +91,54 @@ GURL GetRequestUrl(AutofillDownloadManager::RequestType request_type) {
RequestTypeToString(request_type) + "?client=" + kClientName);
}
+std::ostream& operator<<(std::ostream& s,
Roger McFarlane (Chromium) 2016/01/22 21:52:30 maybe rename s to out or stream
Mathieu 2016/01/22 22:15:12 Done.
+ const autofill::AutofillQueryContents& query) {
+ s << "client_version: " << query.client_version();
+ for (const auto& form : query.form()) {
+ s << "\nForm\n signature: " << form.signature();
+ for (const auto& field : form.field()) {
+ s << "\n Field"
+ << "\n signature: " << field.signature();
Roger McFarlane (Chromium) 2016/01/22 21:52:30 nit: will this fit merged with the previous line?
Mathieu 2016/01/22 22:15:12 Done.
+ if (!field.name().empty())
+ s << "\n name: " << field.name();
+ if (!field.type().empty())
+ s << "\n type: " << field.type();
+ if (!field.label().empty())
+ s << "\n label: " << field.label();
+ }
+ }
+ return s;
+}
+
+std::ostream& operator<<(std::ostream& s,
+ const autofill::AutofillUploadContents& upload) {
+ s << "client_version: " << upload.client_version() << "\n";
+ s << "form_signature: " << upload.form_signature() << "\n";
+ s << "data_present: " << upload.data_present() << "\n";
+ s << "submission: " << upload.submission() << "\n";
+ if (!upload.action_signature())
+ s << "action_signature: " << upload.action_signature() << "\n";
+ if (!upload.login_form_signature())
+ s << "login_form_signature: " << upload.login_form_signature() << "\n";
+ if (!upload.form_name().empty())
+ s << "form_name: " << upload.form_name() << "\n";
+
+ for (const auto& field : upload.field()) {
+ s << "\n Field"
+ << "\n signature: " << field.signature()
+ << "\n autofill_type: " << field.autofill_type();
Roger McFarlane (Chromium) 2016/01/22 21:52:30 this is a number or a string? FieldType_Name(fiel
Mathieu 2016/01/22 22:15:12 Unfortunately it's not a proto in Chromium, it's a
+ if (!field.name().empty())
+ s << "\n name: " << field.name();
+ if (!field.autocomplete().empty())
+ s << "\n autocomplete: " << field.autocomplete();
+ if (!field.type().empty())
+ s << "\n type: " << field.type();
+ if (!field.label().empty())
+ s << "\n label: " << field.label();
+ }
+ return s;
+}
+
} // namespace
struct AutofillDownloadManager::FormRequestData {
@@ -147,6 +195,8 @@ bool AutofillDownloadManager::StartQueryRequest(
return true;
}
+ VLOG(1) << "Sending Autofill Query Request:\n" << query;
+
return StartRequest(request_data);
}
@@ -177,6 +227,8 @@ bool AutofillDownloadManager::StartUploadRequest(
request_data.request_type = AutofillDownloadManager::REQUEST_UPLOAD;
request_data.payload = payload;
+ VLOG(1) << "Sending Autofill Upload Request:\n" << upload;
+
return StartRequest(request_data);
}
@@ -220,10 +272,6 @@ bool AutofillDownloadManager::StartRequest(
fetcher->SetExtraRequestHeaders(headers.ToString());
fetcher->Start();
- VLOG(1) << "Sending AutofillDownloadManager "
- << RequestTypeToString(request_data.request_type)
- << " request (compressed to " << compression_ratio << "%)";
-
return true;
}
« no previous file with comments | « no previous file | components/autofill/core/browser/form_structure.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698