#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/page_content_annotations/core/page_content_annotations_validator.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/rand_util.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/task/thread_pool.h"
#include "base/time/default_tick_clock.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/optimization_guide/core/optimization_guide_switches.h"
#include "components/page_content_annotations/core/page_content_annotations_common.h"
#include "components/page_content_annotations/core/page_content_annotations_features.h"
#include "components/page_content_annotations/core/page_content_annotations_switches.h"
#include "components/page_content_annotations/core/page_content_annotator.h"
namespace page_content_annotations {
namespace {
const char* kRandomNouns[] = …;
const size_t kCountRandomNouns = …;
void LogLinesToFileOnBackgroundSequence(const base::FilePath& path,
const std::vector<std::string>& lines) { … }
void MaybeLogAnnotationResultToFile(
const std::vector<BatchAnnotationResult>& results) { … }
bool PageContentAnnotationValidationEnabledForType(AnnotationType type) { … }
std::optional<std::vector<std::string>>
PageContentAnnotationsValidationInputForType(AnnotationType type) { … }
}
PageContentAnnotationsValidator::~PageContentAnnotationsValidator() = default;
PageContentAnnotationsValidator::PageContentAnnotationsValidator(
PageContentAnnotator* annotator)
: … { … }
std::unique_ptr<PageContentAnnotationsValidator>
PageContentAnnotationsValidator::MaybeCreateAndStartTimer(
PageContentAnnotator* annotator) { … }
void PageContentAnnotationsValidator::Run() { … }
std::vector<std::string> PageContentAnnotationsValidator::BuildInputsForType(
AnnotationType type) { … }
}