Commit 46f38352 authored by Vaclav Brozek's avatar Vaclav Brozek Committed by Commit Bot

Remove SyntheticForm::fieldsets

SyntheticForm's data member fieldsets is only set and used once, in
the same function.

Therefore this CL reduces the size of SyntheticForm and extracts the
fieldsets data member as a local variable in said function.

Bug: 833838
Change-Id: Ie5970adf3b0a2c52c783e599b658d1d0f27473eb
Reviewed-on: https://chromium-review.googlesource.com/1014043
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551431}
parent 67c5b715
...@@ -68,7 +68,6 @@ struct SyntheticForm { ...@@ -68,7 +68,6 @@ struct SyntheticForm {
SyntheticForm(SyntheticForm&& other); SyntheticForm(SyntheticForm&& other);
~SyntheticForm(); ~SyntheticForm();
std::vector<blink::WebElement> fieldsets;
// Contains control elements of the represented form, including not fillable // Contains control elements of the represented form, including not fillable
// ones. // ones.
std::vector<blink::WebFormControlElement> control_elements; std::vector<blink::WebFormControlElement> control_elements;
...@@ -918,8 +917,9 @@ std::unique_ptr<PasswordForm> CreatePasswordFormFromUnownedInputElements( ...@@ -918,8 +917,9 @@ std::unique_ptr<PasswordForm> CreatePasswordFormFromUnownedInputElements(
const FormsPredictionsMap* form_predictions, const FormsPredictionsMap* form_predictions,
UsernameDetectorCache* username_detector_cache) { UsernameDetectorCache* username_detector_cache) {
SyntheticForm synthetic_form; SyntheticForm synthetic_form;
std::vector<blink::WebElement> fieldsets;
synthetic_form.control_elements = form_util::GetUnownedFormFieldElements( synthetic_form.control_elements = form_util::GetUnownedFormFieldElements(
frame.GetDocument().All(), &synthetic_form.fieldsets); frame.GetDocument().All(), &fieldsets);
synthetic_form.origin = synthetic_form.origin =
form_util::GetCanonicalOriginForDocument(frame.GetDocument()); form_util::GetCanonicalOriginForDocument(frame.GetDocument());
...@@ -928,7 +928,7 @@ std::unique_ptr<PasswordForm> CreatePasswordFormFromUnownedInputElements( ...@@ -928,7 +928,7 @@ std::unique_ptr<PasswordForm> CreatePasswordFormFromUnownedInputElements(
std::unique_ptr<PasswordForm> password_form(new PasswordForm()); std::unique_ptr<PasswordForm> password_form(new PasswordForm());
if (!UnownedPasswordFormElementsAndFieldSetsToFormData( if (!UnownedPasswordFormElementsAndFieldSetsToFormData(
synthetic_form.fieldsets, synthetic_form.control_elements, nullptr, fieldsets, synthetic_form.control_elements, nullptr,
frame.GetDocument(), field_value_and_properties_map, frame.GetDocument(), field_value_and_properties_map,
form_util::EXTRACT_NONE, &password_form->form_data, form_util::EXTRACT_NONE, &password_form->form_data,
nullptr /* FormFieldData */)) { nullptr /* FormFieldData */)) {
......
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