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

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: clean 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..2db18f50bf56e30b9216aa1aeb94c467874d5f16 100644
--- a/components/autofill/core/browser/autofill_download_manager.cc
+++ b/components/autofill/core/browser/autofill_download_manager.cc
@@ -91,6 +91,53 @@ GURL GetRequestUrl(AutofillDownloadManager::RequestType request_type) {
RequestTypeToString(request_type) + "?client=" + kClientName);
}
+std::ostream& operator<<(std::ostream& out,
+ const autofill::AutofillQueryContents& query) {
+ out << "client_version: " << query.client_version();
+ for (const auto& form : query.form()) {
+ out << "\nForm\n signature: " << form.signature();
+ for (const auto& field : form.field()) {
+ out << "\n Field\n signature: " << field.signature();
+ if (!field.name().empty())
+ out << "\n name: " << field.name();
+ if (!field.type().empty())
+ out << "\n type: " << field.type();
+ if (!field.label().empty())
+ out << "\n label: " << field.label();
+ }
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out,
+ const autofill::AutofillUploadContents& upload) {
+ out << "client_version: " << upload.client_version() << "\n";
+ out << "form_signature: " << upload.form_signature() << "\n";
+ out << "data_present: " << upload.data_present() << "\n";
+ out << "submission: " << upload.submission() << "\n";
+ if (!upload.action_signature())
+ out << "action_signature: " << upload.action_signature() << "\n";
+ if (!upload.login_form_signature())
+ out << "login_form_signature: " << upload.login_form_signature() << "\n";
+ if (!upload.form_name().empty())
+ out << "form_name: " << upload.form_name() << "\n";
+
+ for (const auto& field : upload.field()) {
+ out << "\n Field"
+ << "\n signature: " << field.signature()
+ << "\n autofill_type: " << field.autofill_type();
+ if (!field.name().empty())
+ out << "\n name: " << field.name();
+ if (!field.autocomplete().empty())
+ out << "\n autocomplete: " << field.autocomplete();
+ if (!field.type().empty())
+ out << "\n type: " << field.type();
+ if (!field.label().empty())
+ out << "\n label: " << field.label();
+ }
+ return out;
+}
+
} // namespace
struct AutofillDownloadManager::FormRequestData {
@@ -147,6 +194,8 @@ bool AutofillDownloadManager::StartQueryRequest(
return true;
}
+ VLOG(1) << "Sending Autofill Query Request:\n" << query;
+
return StartRequest(request_data);
}
@@ -177,6 +226,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 +271,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;
}
@@ -312,13 +359,12 @@ void AutofillDownloadManager::OnURLFetchComplete(
} else {
std::string response_body;
source->GetResponseAsString(&response_body);
- VLOG(1) << "AutofillDownloadManager: " << request_type
- << " request has succeeded.";
if (it->second.request_type == AutofillDownloadManager::REQUEST_QUERY) {
CacheQueryRequest(it->second.form_signatures, response_body);
observer_->OnLoadedServerPredictions(std::move(response_body),
it->second.form_signatures);
} else {
+ VLOG(1) << "AutofillDownloadManager: upload request has succeeded.";
observer_->OnUploadedPossibleFieldTypes();
}
}
« 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