From 98e343ab369e4262511b5fce547728e3e5eefba8 Mon Sep 17 00:00:00 2001 From: Hidehiko Abe Date: Fri, 31 Jan 2020 21:27:40 +0000 Subject: [PATCH] Use same condition for field declaration and its use. cros_supported_configs_ is defined iff OS_CHROMEOS is defined. However, it is used iff USE_CHROMEOS_MEDIA_ACCELERATION regardless of OS_CHROMEOS. This CL aligns the conditions. BUG=1047719 TEST=Build locally. Change-Id: I08fe8532c1778ff8c77c7a9d9cdd96ff2a83272f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2030924 Reviewed-by: Xiaohan Wang Reviewed-by: Miguel Casas Commit-Queue: Miguel Casas Cr-Commit-Position: refs/heads/master@{#737459} --- --- a/media/mojo/services/gpu_mojo_media_client.cc +++ b/media/mojo/services/gpu_mojo_media_client.cc @@ -157,7 +157,7 @@ GpuMojoMediaClient::GetSupportedVideoDec supported_config_map[VideoDecoderImplementation::kAlternate] = *d3d11_supported_configs_; -#elif BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) +#elif defined(OS_CHROMEOS) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) if (base::FeatureList::IsEnabled(kChromeosVideoDecoder)) { if (!cros_supported_configs_) { cros_supported_configs_ = --- a/media/mojo/services/gpu_mojo_media_client.h +++ b/media/mojo/services/gpu_mojo_media_client.h @@ -74,16 +74,13 @@ class GpuMojoMediaClient : public MojoMe #if defined(OS_CHROMEOS) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) // Indirectly owned by GpuChildThread. gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; + base::Optional cros_supported_configs_; #endif // defined(OS_CHROMEOS) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) CdmProxyFactoryCB cdm_proxy_factory_cb_; #if defined(OS_WIN) base::Optional d3d11_supported_configs_; #endif // defined(OS_WIN) -#if defined(OS_CHROMEOS) - base::Optional cros_supported_configs_; -#endif // defined(OS_CHROMEOS) - DISALLOW_COPY_AND_ASSIGN(GpuMojoMediaClient); };