| // gpu/ipc/common/gpu_preferences.mojom-send-validation.h is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2025 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef GPU_IPC_COMMON_GPU_PREFERENCES_MOJOM_SEND_VALIDATION_H_ |
| #define GPU_IPC_COMMON_GPU_PREFERENCES_MOJOM_SEND_VALIDATION_H_ |
| |
| #include "gpu/ipc/common/gpu_preferences.mojom-shared-internal.h" |
| #include "ui/gfx/mojom/buffer_types.mojom-shared.h" |
| |
| #include "gpu/ipc/common/gpu_preferences.mojom-data-view.h" |
| |
| #include "mojo/public/cpp/bindings/lib/send_validation_type.h" |
| #include "mojo/public/cpp/bindings/lib/send_validation.h" |
| #include "mojo/public/cpp/bindings/lib/has_send_validation_helper.h" |
| |
| namespace mojo::internal { |
| template <typename MaybeConstUserType> |
| struct HasSendValidationSerialize<::gpu::mojom::VulkanImplementationName, MaybeConstUserType> |
| : std::false_type {}; |
| template <typename MaybeConstUserType> |
| struct HasSendValidationSerialize<::gpu::mojom::WebGPUAdapterName, MaybeConstUserType> |
| : std::false_type {}; |
| template <typename MaybeConstUserType> |
| struct HasSendValidationSerialize<::gpu::mojom::WebGPUPowerPreference, MaybeConstUserType> |
| : std::false_type {}; |
| template <typename MaybeConstUserType> |
| struct HasSendValidationSerialize<::gpu::mojom::GrContextType, MaybeConstUserType> |
| : std::false_type {}; |
| template <typename MaybeConstUserType> |
| struct HasSendValidationSerialize<::gpu::mojom::DawnBackendValidationLevel, MaybeConstUserType> |
| : std::false_type {}; |
| |
| template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation> |
| struct SendValidationSerializer<::gpu::mojom::GpuPreferencesDataView, MaybeConstUserType, send_validation> { |
| using UserType = typename std::remove_const<MaybeConstUserType>::type; |
| using Traits = StructTraits<::gpu::mojom::GpuPreferencesDataView, UserType>; |
| static void Serialize( |
| MaybeConstUserType& input, |
| mojo::internal::MessageFragment<::gpu::mojom::internal::GpuPreferences_Data>& fragment) { |
| if (CallIsNullIfExists<Traits>(input)) |
| return; |
| fragment.Allocate(); |
| |
| fragment->disable_accelerated_video_decode = Traits::disable_accelerated_video_decode(input); |
| |
| fragment->disable_accelerated_video_encode = Traits::disable_accelerated_video_encode(input); |
| |
| fragment->gpu_startup_dialog = Traits::gpu_startup_dialog(input); |
| |
| fragment->disable_gpu_watchdog = Traits::disable_gpu_watchdog(input); |
| |
| fragment->gpu_sandbox_start_early = Traits::gpu_sandbox_start_early(input); |
| |
| fragment->enable_low_latency_dxva = Traits::enable_low_latency_dxva(input); |
| |
| fragment->enable_zero_copy_dxgi_video = Traits::enable_zero_copy_dxgi_video(input); |
| |
| fragment->enable_nv12_dxgi_video = Traits::enable_nv12_dxgi_video(input); |
| |
| fragment->disable_software_rasterizer = Traits::disable_software_rasterizer(input); |
| |
| fragment->log_gpu_control_list_decisions = Traits::log_gpu_control_list_decisions(input); |
| |
| fragment->compile_shader_always_succeeds = Traits::compile_shader_always_succeeds(input); |
| |
| fragment->disable_gl_error_limit = Traits::disable_gl_error_limit(input); |
| |
| fragment->disable_glsl_translator = Traits::disable_glsl_translator(input); |
| |
| fragment->disable_shader_name_hashing = Traits::disable_shader_name_hashing(input); |
| |
| fragment->enable_gpu_command_logging = Traits::enable_gpu_command_logging(input); |
| |
| fragment->enable_gpu_debugging = Traits::enable_gpu_debugging(input); |
| |
| fragment->enable_gpu_service_logging_gpu = Traits::enable_gpu_service_logging_gpu(input); |
| |
| fragment->enable_gpu_driver_debug_logging = Traits::enable_gpu_driver_debug_logging(input); |
| |
| fragment->disable_gpu_program_cache = Traits::disable_gpu_program_cache(input); |
| |
| fragment->enforce_gl_minimums = Traits::enforce_gl_minimums(input); |
| |
| fragment->force_gpu_mem_discardable_limit_bytes = Traits::force_gpu_mem_discardable_limit_bytes(input); |
| |
| fragment->force_max_texture_size = Traits::force_max_texture_size(input); |
| |
| fragment->gpu_program_cache_size = Traits::gpu_program_cache_size(input); |
| |
| fragment->disable_gpu_shader_disk_cache = Traits::disable_gpu_shader_disk_cache(input); |
| |
| fragment->enable_threaded_texture_mailboxes = Traits::enable_threaded_texture_mailboxes(input); |
| |
| fragment->gl_shader_interm_output = Traits::gl_shader_interm_output(input); |
| |
| fragment->perform_graphite_precompilation = Traits::perform_graphite_precompilation(input); |
| |
| fragment->enable_gpu_service_logging = Traits::enable_gpu_service_logging(input); |
| |
| fragment->enable_gpu_service_tracing = Traits::enable_gpu_service_tracing(input); |
| |
| fragment->use_passthrough_cmd_decoder = Traits::use_passthrough_cmd_decoder(input); |
| |
| fragment->ignore_gpu_blocklist = Traits::ignore_gpu_blocklist(input); |
| |
| fragment->watchdog_starts_backgrounded = Traits::watchdog_starts_backgrounded(input); |
| |
| |
| mojo::internal::Serialize<::gpu::mojom::GrContextType>( |
| Traits::gr_context_type(input), |
| &fragment->gr_context_type); |
| |
| |
| mojo::internal::Serialize<::gpu::mojom::VulkanImplementationName>( |
| Traits::use_vulkan(input), |
| &fragment->use_vulkan); |
| |
| fragment->enable_vulkan_protected_memory = Traits::enable_vulkan_protected_memory(input); |
| |
| fragment->disable_vulkan_surface = Traits::disable_vulkan_surface(input); |
| |
| fragment->disable_vulkan_fallback_to_gl_for_testing = Traits::disable_vulkan_fallback_to_gl_for_testing(input); |
| |
| fragment->vulkan_heap_memory_limit = Traits::vulkan_heap_memory_limit(input); |
| |
| fragment->vulkan_sync_cpu_memory_limit = Traits::vulkan_sync_cpu_memory_limit(input); |
| |
| fragment->enable_gpu_benchmarking_extension = Traits::enable_gpu_benchmarking_extension(input); |
| |
| fragment->enable_webgpu = Traits::enable_webgpu(input); |
| |
| fragment->enable_unsafe_webgpu = Traits::enable_unsafe_webgpu(input); |
| |
| fragment->enable_webgpu_developer_features = Traits::enable_webgpu_developer_features(input); |
| |
| fragment->enable_webgpu_experimental_features = Traits::enable_webgpu_experimental_features(input); |
| |
| |
| mojo::internal::Serialize<::gpu::mojom::WebGPUAdapterName>( |
| Traits::use_webgpu_adapter(input), |
| &fragment->use_webgpu_adapter); |
| |
| |
| mojo::internal::Serialize<::gpu::mojom::WebGPUPowerPreference>( |
| Traits::use_webgpu_power_preference(input), |
| &fragment->use_webgpu_power_preference); |
| |
| fragment->force_webgpu_compat = Traits::force_webgpu_compat(input); |
| |
| |
| mojo::internal::Serialize<::gpu::mojom::DawnBackendValidationLevel>( |
| Traits::enable_dawn_backend_validation(input), |
| &fragment->enable_dawn_backend_validation); |
| |
| decltype(Traits::enabled_dawn_features_list(input)) in_enabled_dawn_features_list = Traits::enabled_dawn_features_list(input); |
| mojo::internal::MessageFragment< |
| typename decltype(fragment->enabled_dawn_features_list)::BaseType> |
| enabled_dawn_features_list_fragment(fragment.message()); |
| constexpr const mojo::internal::ContainerValidateParams& enabled_dawn_features_list_validate_params = |
| mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>(); |
| |
| mojo::internal::Serialize<mojo::ArrayDataView<mojo::StringDataView>, send_validation>( |
| in_enabled_dawn_features_list, |
| enabled_dawn_features_list_fragment, |
| &enabled_dawn_features_list_validate_params); |
| |
| fragment->enabled_dawn_features_list.Set( |
| enabled_dawn_features_list_fragment.is_null() ? nullptr : enabled_dawn_features_list_fragment.data()); |
| |
| |
| MOJO_INTERNAL_CHECK_SERIALIZATION( |
| send_validation, |
| !(fragment->enabled_dawn_features_list.is_null()), |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER, |
| "null enabled_dawn_features_list in GpuPreferences struct"); |
| |
| decltype(Traits::disabled_dawn_features_list(input)) in_disabled_dawn_features_list = Traits::disabled_dawn_features_list(input); |
| mojo::internal::MessageFragment< |
| typename decltype(fragment->disabled_dawn_features_list)::BaseType> |
| disabled_dawn_features_list_fragment(fragment.message()); |
| constexpr const mojo::internal::ContainerValidateParams& disabled_dawn_features_list_validate_params = |
| mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>(); |
| |
| mojo::internal::Serialize<mojo::ArrayDataView<mojo::StringDataView>, send_validation>( |
| in_disabled_dawn_features_list, |
| disabled_dawn_features_list_fragment, |
| &disabled_dawn_features_list_validate_params); |
| |
| fragment->disabled_dawn_features_list.Set( |
| disabled_dawn_features_list_fragment.is_null() ? nullptr : disabled_dawn_features_list_fragment.data()); |
| |
| |
| MOJO_INTERNAL_CHECK_SERIALIZATION( |
| send_validation, |
| !(fragment->disabled_dawn_features_list.is_null()), |
| mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER, |
| "null disabled_dawn_features_list in GpuPreferences struct"); |
| |
| fragment->enable_perf_data_collection = Traits::enable_perf_data_collection(input); |
| |
| fragment->enable_native_gpu_memory_buffers = Traits::enable_native_gpu_memory_buffers(input); |
| |
| fragment->force_separate_egl_display_for_webgl_testing = Traits::force_separate_egl_display_for_webgl_testing(input); |
| } |
| }; |
| |
| } // namespace mojo::internal |
| |
| #endif // GPU_IPC_COMMON_GPU_PREFERENCES_MOJOM_SEND_VALIDATION_H_ |