#include "components/autofill/core/browser/form_forest.h"
#include <limits>
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/containers/stack.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "components/autofill/core/browser/form_forest_util_inl.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
namespace autofill::internal {
FormForest::FrameData::FrameData(LocalFrameToken frame_token)
: … { … }
FormForest::FrameData::~FrameData() = default;
FormForest::FormForest() = default;
FormForest::~FormForest() = default;
FormForest::FrameData* FormForest::GetOrCreateFrameData(LocalFrameToken frame) { … }
FormForest::FrameData* FormForest::GetFrameData(LocalFrameToken frame) { … }
FormData* FormForest::GetFormData(FormGlobalId form, FrameData* frame_data) { … }
FormForest::FrameAndForm FormForest::GetRoot(FormGlobalId form) { … }
void FormForest::EraseReferencesTo(
absl::variant<LocalFrameToken, FormGlobalId> frame_or_form,
base::flat_set<FormGlobalId>* forms_with_removed_fields) { … }
base::flat_set<FormGlobalId> FormForest::EraseForms(
base::span<const FormGlobalId> renderer_forms) { … }
void FormForest::EraseFormsOfFrame(LocalFrameToken frame, bool keep_frame) { … }
void FormForest::UpdateTreeOfRendererForm(FormData* form,
AutofillDriver& driver) { … }
const FormData& FormForest::GetBrowserForm(FormGlobalId renderer_form) const { … }
FormForest::SecurityOptions::SecurityOptions(
const url::Origin* main_origin,
const url::Origin* triggered_origin,
const base::flat_map<FieldGlobalId, FieldType>* field_type_map)
: … { … }
FieldType FormForest::SecurityOptions::GetFieldType(
const FieldGlobalId& field) const { … }
FormForest::RendererForms::RendererForms() = default;
FormForest::RendererForms::RendererForms(RendererForms&&) = default;
FormForest::RendererForms& FormForest::RendererForms::operator=(
RendererForms&&) = default;
FormForest::RendererForms::~RendererForms() = default;
FormForest::RendererForms FormForest::GetRendererFormsOfBrowserFields(
base::span<const FormFieldData> browser_fields,
const SecurityOptions& security_options) const { … }
}