Chromium Code Reviews| 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; |
| } |