#include "third_party/blink/renderer/modules/document_metadata/document_metadata_extractor.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "components/schema_org/common/metadata.mojom-blink.h"
#include "third_party/blink/public/mojom/document_metadata/document_metadata.mojom-blink.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/json/json_parser.h"
#include "third_party/blink/renderer/platform/json/json_values.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
namespace {
WebPage;
WebPagePtr;
Entity;
EntityPtr;
Property;
PropertyPtr;
Values;
ValuesPtr;
constexpr int kMaxDepth = …;
constexpr wtf_size_t kMaxStringLength = …;
constexpr wtf_size_t kMaxNumFields = …;
constexpr wtf_size_t kMaxRepeatedSize = …;
constexpr char kJSONLDKeyType[] = …;
constexpr char kJSONLDKeyGraph[] = …;
bool IsSupportedType(AtomicString type) { … }
void ExtractEntity(const JSONObject&, int recursion_level, Entity&);
bool ParseRepeatedValue(const JSONArray& arr,
int recursion_level,
ValuesPtr& values) { … }
void ExtractEntity(const JSONObject& val, int recursion_level, Entity& entity) { … }
void ExtractTopLevelEntity(const JSONObject& val, Vector<EntityPtr>& entities) { … }
void ExtractEntitiesFromArray(const JSONArray& arr,
Vector<EntityPtr>& entities) { … }
void ExtractEntityFromTopLevelObject(const JSONObject& val,
Vector<EntityPtr>& entities) { … }
enum ExtractionStatus { … };
ExtractionStatus ExtractMetadata(const Element& root,
Vector<EntityPtr>& entities) { … }
}
WebPagePtr DocumentMetadataExtractor::Extract(const Document& document) { … }
}