| Index: components/autofill/content/renderer/form_autofill_util.h
|
| diff --git a/components/autofill/content/renderer/form_autofill_util.h b/components/autofill/content/renderer/form_autofill_util.h
|
| index d7cb557b05c8928406762778381efc677ca34af9..7f2391dcbf731582d143896e87c92f456e35e664 100644
|
| --- a/components/autofill/content/renderer/form_autofill_util.h
|
| +++ b/components/autofill/content/renderer/form_autofill_util.h
|
| @@ -9,6 +9,7 @@
|
|
|
| #include <vector>
|
|
|
| +#include "base/macros.h"
|
| #include "base/strings/string16.h"
|
| #include "components/autofill/core/common/autofill_constants.h"
|
| #include "components/autofill/core/common/password_form_field_prediction_map.h"
|
| @@ -57,6 +58,22 @@ enum ExtractMask {
|
| // Copied to components/autofill/ios/browser/resources/autofill_controller.js.
|
| extern const size_t kMaxParseableFields;
|
|
|
| +// Create an instance of ScopedLayoutPreventer to stop form_util code from
|
| +// triggering layout as a side-effect. For example, when creating a
|
| +// FormFieldData, a call to WebNode::isFocusable is normally made, which may
|
| +// trigger a layout computation. When an instance of ScopedLayoutPreventer is
|
| +// alive, that call will not be made. On destruction, this class allows
|
| +// layout-triggering calls again. It is not thread safe and multiple instances
|
| +// should not be created at the same time in the same process.
|
| +class ScopedLayoutPreventer {
|
| + public:
|
| + ScopedLayoutPreventer();
|
| + ~ScopedLayoutPreventer();
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedLayoutPreventer);
|
| +};
|
| +
|
| // Extract FormData from the form element and return whether the operation was
|
| // successful.
|
| bool ExtractFormData(const blink::WebFormElement& form_element, FormData* data);
|
|
|