#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom-params-data.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom-import-headers.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom-test-utils.h"
namespace blink::mojom {
AnchorElementMetrics::AnchorElementMetrics()
: … { … }
AnchorElementMetrics::AnchorElementMetrics(
uint32_t anchor_id_in,
float ratio_area_in,
float ratio_distance_top_to_visible_top_in,
float ratio_distance_root_top_in,
bool is_in_iframe_in,
bool contains_image_in,
bool is_same_host_in,
bool is_url_incremented_by_one_in,
bool has_text_sibling_in,
uint32_t font_size_px_in,
uint32_t font_weight_in,
const ::GURL& target_url_in,
const ::gfx::Size& viewport_size_in)
: … { … }
AnchorElementMetrics::~AnchorElementMetrics() = default;
void AnchorElementMetrics::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementMetrics::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementClick::AnchorElementClick()
: … { … }
AnchorElementClick::AnchorElementClick(
uint32_t anchor_id_in,
const ::GURL& target_url_in,
::base::TimeDelta navigation_start_to_click_in)
: … { … }
AnchorElementClick::~AnchorElementClick() = default;
void AnchorElementClick::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementClick::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementPointerDataOnHoverTimerFired::AnchorElementPointerDataOnHoverTimerFired()
: … { … }
AnchorElementPointerDataOnHoverTimerFired::AnchorElementPointerDataOnHoverTimerFired(
uint32_t anchor_id_in,
::blink::mojom::AnchorElementPointerDataPtr pointer_data_in)
: … { … }
AnchorElementPointerDataOnHoverTimerFired::~AnchorElementPointerDataOnHoverTimerFired() = default;
size_t AnchorElementPointerDataOnHoverTimerFired::Hash(size_t seed) const { … }
void AnchorElementPointerDataOnHoverTimerFired::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementPointerDataOnHoverTimerFired::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementEnteredViewport::AnchorElementEnteredViewport()
: … { … }
AnchorElementEnteredViewport::AnchorElementEnteredViewport(
uint32_t anchor_id_in,
::base::TimeDelta navigation_start_to_entered_viewport_in)
: … { … }
AnchorElementEnteredViewport::~AnchorElementEnteredViewport() = default;
void AnchorElementEnteredViewport::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementEnteredViewport::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementLeftViewport::AnchorElementLeftViewport()
: … { … }
AnchorElementLeftViewport::AnchorElementLeftViewport(
uint32_t anchor_id_in,
::base::TimeDelta time_in_viewport_in)
: … { … }
AnchorElementLeftViewport::~AnchorElementLeftViewport() = default;
void AnchorElementLeftViewport::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementLeftViewport::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementPointerOver::AnchorElementPointerOver()
: … { … }
AnchorElementPointerOver::AnchorElementPointerOver(
uint32_t anchor_id_in,
::base::TimeDelta navigation_start_to_pointer_over_in)
: … { … }
AnchorElementPointerOver::~AnchorElementPointerOver() = default;
void AnchorElementPointerOver::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementPointerOver::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementPointerOut::AnchorElementPointerOut()
: … { … }
AnchorElementPointerOut::AnchorElementPointerOut(
uint32_t anchor_id_in,
::base::TimeDelta hover_dwell_time_in)
: … { … }
AnchorElementPointerOut::~AnchorElementPointerOut() = default;
void AnchorElementPointerOut::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementPointerOut::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementPointerEventForMLModel::AnchorElementPointerEventForMLModel()
: … { … }
AnchorElementPointerEventForMLModel::AnchorElementPointerEventForMLModel(
uint32_t anchor_id_in,
bool is_mouse_in,
AnchorElementUserInteractionEventForMLModelType user_interaction_event_type_in)
: … { … }
AnchorElementPointerEventForMLModel::~AnchorElementPointerEventForMLModel() = default;
size_t AnchorElementPointerEventForMLModel::Hash(size_t seed) const { … }
void AnchorElementPointerEventForMLModel::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementPointerEventForMLModel::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementPointerDown::AnchorElementPointerDown()
: … { … }
AnchorElementPointerDown::AnchorElementPointerDown(
uint32_t anchor_id_in,
::base::TimeDelta navigation_start_to_pointer_down_in)
: … { … }
AnchorElementPointerDown::~AnchorElementPointerDown() = default;
void AnchorElementPointerDown::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementPointerDown::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AnchorElementPositionUpdate::AnchorElementPositionUpdate()
: … { … }
AnchorElementPositionUpdate::AnchorElementPositionUpdate(
uint32_t anchor_id_in,
float vertical_position_ratio_in,
std::optional<float> distance_from_pointer_down_ratio_in)
: … { … }
AnchorElementPositionUpdate::~AnchorElementPositionUpdate() = default;
void AnchorElementPositionUpdate::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AnchorElementPositionUpdate::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char AnchorElementMetricsHost::Name_[] = …;
AnchorElementMetricsHost::IPCStableHashFunction AnchorElementMetricsHost::MessageToMethodInfo_(mojo::Message& message) { … }
const char* AnchorElementMetricsHost::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t AnchorElementMetricsHost::ReportAnchorElementClick_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportNewAnchorElements_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportAnchorElementsEnteredViewport_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportAnchorElementsLeftViewport_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportAnchorElementsPositionUpdate_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportAnchorElementPointerOver_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportAnchorElementPointerOut_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportAnchorElementPointerDown_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ReportAnchorElementPointerDataOnHoverTimerFired_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ProcessPointerEventUsingMLModel_Sym::IPCStableHash() { … }
uint32_t AnchorElementMetricsHost::ShouldSkipUpdateDelays_Sym::IPCStableHash() { … }
# endif
class AnchorElementMetricsHost_ShouldSkipUpdateDelays_ForwardToCallback
: public mojo::MessageReceiver { … };
AnchorElementMetricsHostProxy::AnchorElementMetricsHostProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementClick(
AnchorElementClickPtr in_clicked) { … }
void AnchorElementMetricsHostProxy::ReportNewAnchorElements(
std::vector<AnchorElementMetricsPtr> in_metrics, const std::vector<uint32_t>& in_removed_elements) { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementsEnteredViewport(
std::vector<AnchorElementEnteredViewportPtr> in_elements) { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementsLeftViewport(
std::vector<AnchorElementLeftViewportPtr> in_elements) { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementsPositionUpdate(
std::vector<AnchorElementPositionUpdatePtr> in_elements) { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementPointerOver(
AnchorElementPointerOverPtr in_pointer_over_event) { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementPointerOut(
AnchorElementPointerOutPtr in_hover_event) { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementPointerDown(
AnchorElementPointerDownPtr in_pointer_down_event) { … }
void AnchorElementMetricsHostProxy::ReportAnchorElementPointerDataOnHoverTimerFired(
AnchorElementPointerDataOnHoverTimerFiredPtr in_pointer_data) { … }
void AnchorElementMetricsHostProxy::ProcessPointerEventUsingMLModel(
AnchorElementPointerEventForMLModelPtr in_pointer_event) { … }
void AnchorElementMetricsHostProxy::ShouldSkipUpdateDelays(
ShouldSkipUpdateDelaysCallback callback) { … }
class AnchorElementMetricsHost_ShouldSkipUpdateDelays_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool AnchorElementMetricsHost_ShouldSkipUpdateDelays_ForwardToCallback::Accept(
mojo::Message* message) { … }
void AnchorElementMetricsHost_ShouldSkipUpdateDelays_ProxyToResponder::Run(
bool in_should_skip_for_testing) { … }
bool AnchorElementMetricsHostStubDispatch::Accept(
AnchorElementMetricsHost* impl,
mojo::Message* message) { … }
bool AnchorElementMetricsHostStubDispatch::AcceptWithResponder(
AnchorElementMetricsHost* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kAnchorElementMetricsHostValidationInfo[] = …;
bool AnchorElementMetricsHostRequestValidator::Accept(mojo::Message* message) { … }
bool AnchorElementMetricsHostResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::AnchorElementMetrics::DataView, ::blink::mojom::AnchorElementMetricsPtr>::Read(
::blink::mojom::AnchorElementMetrics::DataView input,
::blink::mojom::AnchorElementMetricsPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementClick::DataView, ::blink::mojom::AnchorElementClickPtr>::Read(
::blink::mojom::AnchorElementClick::DataView input,
::blink::mojom::AnchorElementClickPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementPointerDataOnHoverTimerFired::DataView, ::blink::mojom::AnchorElementPointerDataOnHoverTimerFiredPtr>::Read(
::blink::mojom::AnchorElementPointerDataOnHoverTimerFired::DataView input,
::blink::mojom::AnchorElementPointerDataOnHoverTimerFiredPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementEnteredViewport::DataView, ::blink::mojom::AnchorElementEnteredViewportPtr>::Read(
::blink::mojom::AnchorElementEnteredViewport::DataView input,
::blink::mojom::AnchorElementEnteredViewportPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementLeftViewport::DataView, ::blink::mojom::AnchorElementLeftViewportPtr>::Read(
::blink::mojom::AnchorElementLeftViewport::DataView input,
::blink::mojom::AnchorElementLeftViewportPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementPointerOver::DataView, ::blink::mojom::AnchorElementPointerOverPtr>::Read(
::blink::mojom::AnchorElementPointerOver::DataView input,
::blink::mojom::AnchorElementPointerOverPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementPointerOut::DataView, ::blink::mojom::AnchorElementPointerOutPtr>::Read(
::blink::mojom::AnchorElementPointerOut::DataView input,
::blink::mojom::AnchorElementPointerOutPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementPointerEventForMLModel::DataView, ::blink::mojom::AnchorElementPointerEventForMLModelPtr>::Read(
::blink::mojom::AnchorElementPointerEventForMLModel::DataView input,
::blink::mojom::AnchorElementPointerEventForMLModelPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementPointerDown::DataView, ::blink::mojom::AnchorElementPointerDownPtr>::Read(
::blink::mojom::AnchorElementPointerDown::DataView input,
::blink::mojom::AnchorElementPointerDownPtr* output) { … }
bool StructTraits<::blink::mojom::AnchorElementPositionUpdate::DataView, ::blink::mojom::AnchorElementPositionUpdatePtr>::Read(
::blink::mojom::AnchorElementPositionUpdate::DataView input,
::blink::mojom::AnchorElementPositionUpdatePtr* output) { … }
}
namespace blink::mojom {
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementClick(AnchorElementClickPtr clicked) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportNewAnchorElements(std::vector<AnchorElementMetricsPtr> metrics, const std::vector<uint32_t>& removed_elements) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementsEnteredViewport(std::vector<AnchorElementEnteredViewportPtr> elements) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementsLeftViewport(std::vector<AnchorElementLeftViewportPtr> elements) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementsPositionUpdate(std::vector<AnchorElementPositionUpdatePtr> elements) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementPointerOver(AnchorElementPointerOverPtr pointer_over_event) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementPointerOut(AnchorElementPointerOutPtr hover_event) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementPointerDown(AnchorElementPointerDownPtr pointer_down_event) { … }
void AnchorElementMetricsHostInterceptorForTesting::ReportAnchorElementPointerDataOnHoverTimerFired(AnchorElementPointerDataOnHoverTimerFiredPtr pointer_data) { … }
void AnchorElementMetricsHostInterceptorForTesting::ProcessPointerEventUsingMLModel(AnchorElementPointerEventForMLModelPtr pointer_event) { … }
void AnchorElementMetricsHostInterceptorForTesting::ShouldSkipUpdateDelays(ShouldSkipUpdateDelaysCallback callback) { … }
AnchorElementMetricsHostAsyncWaiter::AnchorElementMetricsHostAsyncWaiter(
AnchorElementMetricsHost* proxy) : … { … }
AnchorElementMetricsHostAsyncWaiter::~AnchorElementMetricsHostAsyncWaiter() = default;
void AnchorElementMetricsHostAsyncWaiter::ShouldSkipUpdateDelays(
bool* out_should_skip_for_testing) { … }
bool AnchorElementMetricsHostAsyncWaiter::ShouldSkipUpdateDelays(
) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif