#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "services/viz/privileged/mojom/compositing/frame_sink_manager.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 "services/viz/privileged/mojom/compositing/frame_sink_manager.mojom-params-data.h"
#include "services/viz/privileged/mojom/compositing/frame_sink_manager.mojom-shared-message-ids.h"
#include "services/viz/privileged/mojom/compositing/frame_sink_manager.mojom-import-headers.h"
#include "services/viz/privileged/mojom/compositing/frame_sink_manager.mojom-test-utils.h"
namespace viz::mojom {
RootCompositorFrameSinkParams::RootCompositorFrameSinkParams()
: … { … }
RootCompositorFrameSinkParams::RootCompositorFrameSinkParams(
const ::viz::FrameSinkId& frame_sink_id_in,
::gpu::SurfaceHandle widget_in,
bool gpu_compositing_in,
const ::viz::RendererSettings& renderer_settings_in,
bool send_swap_size_notifications_in,
bool disable_frame_rate_limit_in,
::mojo::PendingAssociatedReceiver<::viz::mojom::CompositorFrameSink> compositor_frame_sink_in,
::mojo::PendingRemote<::viz::mojom::CompositorFrameSinkClient> compositor_frame_sink_client_in,
::mojo::PendingAssociatedReceiver<::viz::mojom::DisplayPrivate> display_private_in,
::mojo::PendingRemote<::viz::mojom::DisplayClient> display_client_in,
::mojo::PendingAssociatedReceiver<::viz::mojom::ExternalBeginFrameController> external_begin_frame_controller_in)
: … { … }
RootCompositorFrameSinkParams::~RootCompositorFrameSinkParams() = default;
void RootCompositorFrameSinkParams::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool RootCompositorFrameSinkParams::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char FrameSinkManager::Name_[] = …;
FrameSinkManager::IPCStableHashFunction FrameSinkManager::MessageToMethodInfo_(mojo::Message& message) { … }
const char* FrameSinkManager::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t FrameSinkManager::RegisterFrameSinkId_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::InvalidateFrameSinkId_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::SetFrameSinkDebugLabel_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::CreateRootCompositorFrameSink_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::CreateFrameSinkBundle_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::CreateCompositorFrameSink_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::DestroyCompositorFrameSink_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::RegisterFrameSinkHierarchy_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::UnregisterFrameSinkHierarchy_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::AddVideoDetectorObserver_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::CreateVideoCapturer_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::EvictSurfaces_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::Throttle_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::StartThrottlingAllFrameSinks_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::StopThrottlingAllFrameSinks_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::RequestCopyOfOutput_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::UpdateDebugRendererSettings_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::ClearUnclaimedViewTransitionResources_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::CreateMetricsRecorderForTest_Sym::IPCStableHash() { … }
uint32_t FrameSinkManager::EnableFrameSinkManagerTestApi_Sym::IPCStableHash() { … }
# endif
bool FrameSinkManager::DestroyCompositorFrameSink(const ::viz::FrameSinkId& frame_sink_id) { … }
class FrameSinkManager_DestroyCompositorFrameSink_HandleSyncResponse
: public mojo::MessageReceiver { … };
class FrameSinkManager_DestroyCompositorFrameSink_ForwardToCallback
: public mojo::MessageReceiver { … };
FrameSinkManagerProxy::FrameSinkManagerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void FrameSinkManagerProxy::RegisterFrameSinkId(
const ::viz::FrameSinkId& in_frame_sink_id, bool in_report_activation) { … }
void FrameSinkManagerProxy::InvalidateFrameSinkId(
const ::viz::FrameSinkId& in_frame_sink_id) { … }
void FrameSinkManagerProxy::SetFrameSinkDebugLabel(
const ::viz::FrameSinkId& in_frame_sink_id, const std::string& in_debug_label) { … }
void FrameSinkManagerProxy::CreateRootCompositorFrameSink(
RootCompositorFrameSinkParamsPtr in_params) { … }
void FrameSinkManagerProxy::CreateFrameSinkBundle(
const ::viz::FrameSinkBundleId& in_bundle_id, ::mojo::PendingReceiver<::viz::mojom::FrameSinkBundle> in_receiver, ::mojo::PendingRemote<::viz::mojom::FrameSinkBundleClient> in_client) { … }
void FrameSinkManagerProxy::CreateCompositorFrameSink(
const ::viz::FrameSinkId& in_frame_sink_id, const std::optional<::viz::FrameSinkBundleId>& in_bundle_id, ::mojo::PendingReceiver<::viz::mojom::CompositorFrameSink> in_compositor_frame_sink, ::mojo::PendingRemote<::viz::mojom::CompositorFrameSinkClient> in_compositor_frame_sink_client, ::input::mojom::RenderInputRouterConfigPtr in_config) { … }
bool FrameSinkManagerProxy::DestroyCompositorFrameSink(
const ::viz::FrameSinkId& param_frame_sink_id) { … }
void FrameSinkManagerProxy::DestroyCompositorFrameSink(
const ::viz::FrameSinkId& in_frame_sink_id, DestroyCompositorFrameSinkCallback callback) { … }
void FrameSinkManagerProxy::RegisterFrameSinkHierarchy(
const ::viz::FrameSinkId& in_parent_frame_sink_id, const ::viz::FrameSinkId& in_child_frame_sink_id) { … }
void FrameSinkManagerProxy::UnregisterFrameSinkHierarchy(
const ::viz::FrameSinkId& in_parent_frame_sink_id, const ::viz::FrameSinkId& in_child_frame_sink_id) { … }
void FrameSinkManagerProxy::AddVideoDetectorObserver(
::mojo::PendingRemote<::viz::mojom::VideoDetectorObserver> in_observer) { … }
void FrameSinkManagerProxy::CreateVideoCapturer(
::mojo::PendingReceiver<::viz::mojom::FrameSinkVideoCapturer> in_receiver) { … }
void FrameSinkManagerProxy::EvictSurfaces(
const std::vector<::viz::SurfaceId>& in_surface_ids) { … }
void FrameSinkManagerProxy::Throttle(
const std::vector<::viz::FrameSinkId>& in_frame_sink_ids, ::base::TimeDelta in_interval) { … }
void FrameSinkManagerProxy::StartThrottlingAllFrameSinks(
::base::TimeDelta in_interval) { … }
void FrameSinkManagerProxy::StopThrottlingAllFrameSinks(
) { … }
void FrameSinkManagerProxy::RequestCopyOfOutput(
const ::viz::SurfaceId& in_surface_id, ::std::unique_ptr<::viz::CopyOutputRequest> in_request, bool in_capture_exact_surface_id) { … }
void FrameSinkManagerProxy::UpdateDebugRendererSettings(
const ::viz::DebugRendererSettings& in_debug_settings) { … }
void FrameSinkManagerProxy::ClearUnclaimedViewTransitionResources(
const ::blink::ViewTransitionToken& in_transition_token) { … }
void FrameSinkManagerProxy::CreateMetricsRecorderForTest(
::mojo::PendingReceiver<::viz::mojom::FrameSinksMetricsRecorder> in_receiver) { … }
void FrameSinkManagerProxy::EnableFrameSinkManagerTestApi(
::mojo::PendingReceiver<::viz::mojom::FrameSinkManagerTestApi> in_receiver) { … }
class FrameSinkManager_DestroyCompositorFrameSink_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FrameSinkManager_DestroyCompositorFrameSink_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FrameSinkManager_DestroyCompositorFrameSink_ProxyToResponder::Run(
) { … }
bool FrameSinkManager_DestroyCompositorFrameSink_HandleSyncResponse::Accept(
mojo::Message* message) { … }
bool FrameSinkManagerStubDispatch::Accept(
FrameSinkManager* impl,
mojo::Message* message) { … }
bool FrameSinkManagerStubDispatch::AcceptWithResponder(
FrameSinkManager* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
bool ValidateWithRuntimeFeature_FrameSinkManager_CreateMetricsRecorderForTest(
const void* data, mojo::internal::ValidationContext* validation_context) { … }
bool ValidateWithRuntimeFeature_FrameSinkManager_EnableFrameSinkManagerTestApi(
const void* data, mojo::internal::ValidationContext* validation_context) { … }
}
static const mojo::internal::GenericValidationInfo kFrameSinkManagerValidationInfo[] = …;
bool FrameSinkManagerRequestValidator::Accept(mojo::Message* message) { … }
bool FrameSinkManagerResponseValidator::Accept(mojo::Message* message) { … }
const char FrameSinkManagerClient::Name_[] = …;
FrameSinkManagerClient::IPCStableHashFunction FrameSinkManagerClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* FrameSinkManagerClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t FrameSinkManagerClient::OnFirstSurfaceActivation_Sym::IPCStableHash() { … }
uint32_t FrameSinkManagerClient::OnAggregatedHitTestRegionListUpdated_Sym::IPCStableHash() { … }
uint32_t FrameSinkManagerClient::OnFrameTokenChanged_Sym::IPCStableHash() { … }
uint32_t FrameSinkManagerClient::OnScreenshotCaptured_Sym::IPCStableHash() { … }
# endif
FrameSinkManagerClientProxy::FrameSinkManagerClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void FrameSinkManagerClientProxy::OnFirstSurfaceActivation(
const ::viz::SurfaceInfo& in_surface_info) { … }
void FrameSinkManagerClientProxy::OnAggregatedHitTestRegionListUpdated(
const ::viz::FrameSinkId& in_frame_sink_id, const std::vector<::viz::AggregatedHitTestRegion>& in_hit_test_data) { … }
void FrameSinkManagerClientProxy::OnFrameTokenChanged(
const ::viz::FrameSinkId& in_frame_sink_id, uint32_t in_frame_token, ::base::TimeTicks in_activation_time) { … }
void FrameSinkManagerClientProxy::OnScreenshotCaptured(
const ::blink::SameDocNavigationScreenshotDestinationToken& in_destination_token, ::std::unique_ptr<::viz::CopyOutputResult> in_copy_output_result) { … }
bool FrameSinkManagerClientStubDispatch::Accept(
FrameSinkManagerClient* impl,
mojo::Message* message) { … }
bool FrameSinkManagerClientStubDispatch::AcceptWithResponder(
FrameSinkManagerClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kFrameSinkManagerClientValidationInfo[] = …;
bool FrameSinkManagerClientRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::viz::mojom::RootCompositorFrameSinkParams::DataView, ::viz::mojom::RootCompositorFrameSinkParamsPtr>::Read(
::viz::mojom::RootCompositorFrameSinkParams::DataView input,
::viz::mojom::RootCompositorFrameSinkParamsPtr* output) { … }
}
namespace viz::mojom {
void FrameSinkManagerInterceptorForTesting::RegisterFrameSinkId(const ::viz::FrameSinkId& frame_sink_id, bool report_activation) { … }
void FrameSinkManagerInterceptorForTesting::InvalidateFrameSinkId(const ::viz::FrameSinkId& frame_sink_id) { … }
void FrameSinkManagerInterceptorForTesting::SetFrameSinkDebugLabel(const ::viz::FrameSinkId& frame_sink_id, const std::string& debug_label) { … }
void FrameSinkManagerInterceptorForTesting::CreateRootCompositorFrameSink(RootCompositorFrameSinkParamsPtr params) { … }
void FrameSinkManagerInterceptorForTesting::CreateFrameSinkBundle(const ::viz::FrameSinkBundleId& bundle_id, ::mojo::PendingReceiver<::viz::mojom::FrameSinkBundle> receiver, ::mojo::PendingRemote<::viz::mojom::FrameSinkBundleClient> client) { … }
void FrameSinkManagerInterceptorForTesting::CreateCompositorFrameSink(const ::viz::FrameSinkId& frame_sink_id, const std::optional<::viz::FrameSinkBundleId>& bundle_id, ::mojo::PendingReceiver<::viz::mojom::CompositorFrameSink> compositor_frame_sink, ::mojo::PendingRemote<::viz::mojom::CompositorFrameSinkClient> compositor_frame_sink_client, ::input::mojom::RenderInputRouterConfigPtr config) { … }
void FrameSinkManagerInterceptorForTesting::DestroyCompositorFrameSink(const ::viz::FrameSinkId& frame_sink_id, DestroyCompositorFrameSinkCallback callback) { … }
void FrameSinkManagerInterceptorForTesting::RegisterFrameSinkHierarchy(const ::viz::FrameSinkId& parent_frame_sink_id, const ::viz::FrameSinkId& child_frame_sink_id) { … }
void FrameSinkManagerInterceptorForTesting::UnregisterFrameSinkHierarchy(const ::viz::FrameSinkId& parent_frame_sink_id, const ::viz::FrameSinkId& child_frame_sink_id) { … }
void FrameSinkManagerInterceptorForTesting::AddVideoDetectorObserver(::mojo::PendingRemote<::viz::mojom::VideoDetectorObserver> observer) { … }
void FrameSinkManagerInterceptorForTesting::CreateVideoCapturer(::mojo::PendingReceiver<::viz::mojom::FrameSinkVideoCapturer> receiver) { … }
void FrameSinkManagerInterceptorForTesting::EvictSurfaces(const std::vector<::viz::SurfaceId>& surface_ids) { … }
void FrameSinkManagerInterceptorForTesting::Throttle(const std::vector<::viz::FrameSinkId>& frame_sink_ids, ::base::TimeDelta interval) { … }
void FrameSinkManagerInterceptorForTesting::StartThrottlingAllFrameSinks(::base::TimeDelta interval) { … }
void FrameSinkManagerInterceptorForTesting::StopThrottlingAllFrameSinks() { … }
void FrameSinkManagerInterceptorForTesting::RequestCopyOfOutput(const ::viz::SurfaceId& surface_id, ::std::unique_ptr<::viz::CopyOutputRequest> request, bool capture_exact_surface_id) { … }
void FrameSinkManagerInterceptorForTesting::UpdateDebugRendererSettings(const ::viz::DebugRendererSettings& debug_settings) { … }
void FrameSinkManagerInterceptorForTesting::ClearUnclaimedViewTransitionResources(const ::blink::ViewTransitionToken& transition_token) { … }
void FrameSinkManagerInterceptorForTesting::CreateMetricsRecorderForTest(::mojo::PendingReceiver<::viz::mojom::FrameSinksMetricsRecorder> receiver) { … }
void FrameSinkManagerInterceptorForTesting::EnableFrameSinkManagerTestApi(::mojo::PendingReceiver<::viz::mojom::FrameSinkManagerTestApi> receiver) { … }
FrameSinkManagerAsyncWaiter::FrameSinkManagerAsyncWaiter(
FrameSinkManager* proxy) : … { … }
FrameSinkManagerAsyncWaiter::~FrameSinkManagerAsyncWaiter() = default;
void FrameSinkManagerAsyncWaiter::DestroyCompositorFrameSink(
const ::viz::FrameSinkId& frame_sink_id) { … }
void FrameSinkManagerClientInterceptorForTesting::OnFirstSurfaceActivation(const ::viz::SurfaceInfo& surface_info) { … }
void FrameSinkManagerClientInterceptorForTesting::OnAggregatedHitTestRegionListUpdated(const ::viz::FrameSinkId& frame_sink_id, const std::vector<::viz::AggregatedHitTestRegion>& hit_test_data) { … }
void FrameSinkManagerClientInterceptorForTesting::OnFrameTokenChanged(const ::viz::FrameSinkId& frame_sink_id, uint32_t frame_token, ::base::TimeTicks activation_time) { … }
void FrameSinkManagerClientInterceptorForTesting::OnScreenshotCaptured(const ::blink::SameDocNavigationScreenshotDestinationToken& destination_token, ::std::unique_ptr<::viz::CopyOutputResult> copy_output_result) { … }
FrameSinkManagerClientAsyncWaiter::FrameSinkManagerClientAsyncWaiter(
FrameSinkManagerClient* proxy) : … { … }
FrameSinkManagerClientAsyncWaiter::~FrameSinkManagerClientAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif