diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-29 10:46:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-02 12:02:10 +0000 |
commit | 99677208ff3b216fdfec551fbe548da5520cd6fb (patch) | |
tree | 476a4865c10320249360e859d8fdd3e01833b03a /chromium/content/browser/gpu | |
parent | c30a6232df03e1efbd9f3b226777b07e087a1122 (diff) | |
download | qtwebengine-chromium-99677208ff3b216fdfec551fbe548da5520cd6fb.tar.gz |
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/browser/gpu')
16 files changed, 142 insertions, 146 deletions
diff --git a/chromium/content/browser/gpu/DEPS b/chromium/content/browser/gpu/DEPS index a20e9f7a611..7b4aa9501d4 100644 --- a/chromium/content/browser/gpu/DEPS +++ b/chromium/content/browser/gpu/DEPS @@ -1,4 +1,5 @@ include_rules = [ + "+chromecast/chromecast_buildflags.h", "+components/metal_util", "+components/ui_devtools/buildflags.h", ] diff --git a/chromium/content/browser/gpu/browser_gpu_channel_host_factory.cc b/chromium/content/browser/gpu/browser_gpu_channel_host_factory.cc index 24eb8b83b7e..c28a6eb7ee3 100644 --- a/chromium/content/browser/gpu/browser_gpu_channel_host_factory.cc +++ b/chromium/content/browser/gpu/browser_gpu_channel_host_factory.cc @@ -37,7 +37,7 @@ #include "gpu/ipc/in_process_command_buffer.h" #include "services/resource_coordinator/public/mojom/memory_instrumentation/constants.mojom.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" #endif @@ -146,7 +146,7 @@ BrowserGpuChannelHostFactory::EstablishRequest::EstablishRequest( gpu_client_id_(gpu_client_id), gpu_client_tracing_id_(gpu_client_tracing_id), finished_(false), -#if defined(OS_MACOSX) +#if defined(OS_MAC) main_task_runner_(ui::WindowResizeHelperMac::Get()->task_runner()) #else main_task_runner_(base::ThreadTaskRunnerHandle::Get()) @@ -461,7 +461,7 @@ void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( const base::FilePath& cache_dir) { GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); GetShaderCacheFactorySingleton()->SetCacheInfo( - gpu::kInProcessCommandBufferClientId, cache_dir); + gpu::kDisplayCompositorClientId, cache_dir); } // static diff --git a/chromium/content/browser/gpu/compositor_util.cc b/chromium/content/browser/gpu/compositor_util.cc index 4cdcc399628..01dfeb93bde 100644 --- a/chromium/content/browser/gpu/compositor_util.cc +++ b/chromium/content/browser/gpu/compositor_util.cc @@ -99,18 +99,18 @@ const GpuFeatureData GetGpuFeatureData( command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), DisableInfo::Problem( "Accelerated 2D canvas is unavailable: either disabled " - "via blacklist or the command line."), + "via blocklist or the command line."), true}, {"gpu_compositing", // TODO(sgilhuly): Replace with a check to see which backend is used for // compositing; do the same for GPU rasterization if it's enabled. For now - // assume that if GL is blacklisted, then Vulkan is also. Check GL to see + // assume that if GL is blocklisted, then Vulkan is also. Check GL to see // if GPU compositing is disabled. SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_GL), GpuDataManagerImpl::GetInstance()->IsGpuCompositingDisabled(), DisableInfo::Problem( - "Gpu compositing has been disabled, either via blacklist, about:flags " + "Gpu compositing has been disabled, either via blocklist, about:flags " "or the command line. The browser will fall back to software " "compositing and hardware acceleration will be unavailable."), true}, @@ -119,43 +119,25 @@ const GpuFeatureData GetGpuFeatureData( gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL), command_line.HasSwitch(switches::kDisableWebGL), DisableInfo::Problem( - "WebGL has been disabled via blacklist or the command line."), + "WebGL has been disabled via blocklist or the command line."), false}, - {"flash_3d", - SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_FLASH3D), - command_line.HasSwitch(switches::kDisableFlash3d), - DisableInfo::Problem("Using 3d in flash has been disabled, either via " - "blacklist, about:flags or the command line."), - true}, - {"flash_stage3d", - SafeGetFeatureStatus(gpu_feature_info, - gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D), - command_line.HasSwitch(switches::kDisableFlashStage3d), - DisableInfo::Problem( - "Using Stage3d in Flash has been disabled, either via blacklist, " - "about:flags or the command line."), - true}, - {"flash_stage3d_baseline", - SafeGetFeatureStatus(gpu_feature_info, - gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE), - command_line.HasSwitch(switches::kDisableFlashStage3d), - DisableInfo::Problem( - "Using Stage3d Baseline profile in Flash has been disabled, either " - "via blacklist, about:flags or the command line."), - true}, {"protected_video_decode", SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE), false, DisableInfo::Problem( - "Protected video decode has been disabled, via blacklist."), + "Protected video decode has been disabled, via blocklist."), false}, {"video_decode", SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), +#if defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) + !command_line.HasSwitch(switches::kEnableAcceleratedVideoDecode), +#else command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), +#endif // defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) DisableInfo::Problem( - "Accelerated video decode has been disabled, either via blacklist, " + "Accelerated video decode has been disabled, either via blocklist, " "about:flags or the command line."), true}, {"rasterization", @@ -163,7 +145,7 @@ const GpuFeatureData GetGpuFeatureData( gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION), (command_line.HasSwitch(switches::kDisableGpuRasterization)), DisableInfo::Problem( - "Accelerated rasterization has been disabled, either via blacklist, " + "Accelerated rasterization has been disabled, either via blocklist, " "about:flags or the command line."), true}, {"oop_rasterization", @@ -176,7 +158,7 @@ const GpuFeatureData GetGpuFeatureData( gpu::GPU_FEATURE_TYPE_ACCELERATED_GL), false /* disabled */, DisableInfo::NotProblem(), false /* fallback_to_software */}, -#if defined(OS_MACOSX) +#if defined(OS_MAC) {"metal", SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_METAL), !base::FeatureList::IsEnabled(features::kMetal) /* disabled */, @@ -207,7 +189,7 @@ const GpuFeatureData GetGpuFeatureData( (command_line.HasSwitch(switches::kDisableWebGL) || command_line.HasSwitch(switches::kDisableWebGL2)), DisableInfo::Problem( - "WebGL2 has been disabled via blacklist or the command line."), + "WebGL2 has been disabled via blocklist or the command line."), false}, {"skia_renderer", gpu::kGpuFeatureStatusEnabled, !features::IsUsingSkiaRenderer(), DisableInfo::NotProblem(), false}, @@ -246,7 +228,7 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl( status += "_software"; else status += "_off"; - } else if (gpu_feature_data.status == gpu::kGpuFeatureStatusBlacklisted) { + } else if (gpu_feature_data.status == gpu::kGpuFeatureStatusBlocklisted) { status = "unavailable_off"; } else if (gpu_feature_data.status == gpu::kGpuFeatureStatusSoftware) { status = "unavailable_software"; @@ -292,10 +274,10 @@ std::unique_ptr<base::ListValue> GetProblemsImpl(GpuFeatureInfoType type) { : manager->GetGpuFeatureInfoForHardwareGpu(); auto problem_list = std::make_unique<base::ListValue>(); - if (!gpu_feature_info.applied_gpu_blacklist_entries.empty()) { - std::unique_ptr<gpu::GpuBlocklist> blacklist(gpu::GpuBlocklist::Create()); - blacklist->GetReasons(problem_list.get(), "disabledFeatures", - gpu_feature_info.applied_gpu_blacklist_entries); + if (!gpu_feature_info.applied_gpu_blocklist_entries.empty()) { + std::unique_ptr<gpu::GpuBlocklist> blocklist(gpu::GpuBlocklist::Create()); + blocklist->GetReasons(problem_list.get(), "disabledFeatures", + gpu_feature_info.applied_gpu_blocklist_entries); } if (!gpu_feature_info.applied_gpu_driver_bug_list_entries.empty()) { std::unique_ptr<gpu::GpuDriverBugList> bug_list( @@ -411,7 +393,7 @@ int NumberOfRendererRasterThreads() { bool IsZeroCopyUploadEnabled() { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); -#if defined(OS_MACOSX) +#if defined(OS_MAC) return !command_line.HasSwitch(blink::switches::kDisableZeroCopy); #else return command_line.HasSwitch(blink::switches::kEnableZeroCopy); @@ -435,7 +417,7 @@ bool IsGpuMemoryBufferCompositorResourcesEnabled() { return false; } -#if defined(OS_MACOSX) +#if defined(OS_MAC) return true; #else return false; diff --git a/chromium/content/browser/gpu/gpu_data_manager_impl.cc b/chromium/content/browser/gpu/gpu_data_manager_impl.cc index f266f1b45a4..694f63ecd2d 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_impl.cc +++ b/chromium/content/browser/gpu/gpu_data_manager_impl.cc @@ -75,9 +75,9 @@ bool GpuDataManagerImpl::Initialized() { return g_initialized; } -void GpuDataManagerImpl::BlacklistWebGLForTesting() { +void GpuDataManagerImpl::BlocklistWebGLForTesting() { base::AutoLock auto_lock(lock_); - private_->BlacklistWebGLForTesting(); + private_->BlocklistWebGLForTesting(); } gpu::GPUInfo GpuDataManagerImpl::GetGPUInfo() { diff --git a/chromium/content/browser/gpu/gpu_data_manager_impl.h b/chromium/content/browser/gpu/gpu_data_manager_impl.h index b1cb1060511..7030549c941 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_impl.h +++ b/chromium/content/browser/gpu/gpu_data_manager_impl.h @@ -53,7 +53,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager, static bool Initialized(); // GpuDataManager implementation. - void BlacklistWebGLForTesting() override; + void BlocklistWebGLForTesting() override; gpu::GPUInfo GetGPUInfo() override; gpu::GpuFeatureStatus GetFeatureStatus(gpu::GpuFeatureType feature) override; bool GpuAccessAllowed(std::string* reason) override; @@ -98,7 +98,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager, void OnBrowserThreadsStarted(); void TerminateInfoCollectionGpuProcess(); #endif - // Update the GPU feature info. This updates the blacklist and enabled status + // Update the GPU feature info. This updates the blocklist and enabled status // of GPU rasterization. In the future this will be used for more features. void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info, const base::Optional<gpu::GpuFeatureInfo>& @@ -119,7 +119,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager, // software compositing. void SetGpuCompositingDisabled(); - // Update GpuPreferences based on blacklisting decisions. + // Update GpuPreferences based on blocklisting decisions. void UpdateGpuPreferences(gpu::GpuPreferences* gpu_preferences, GpuProcessKind kind) const; diff --git a/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc b/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc index e88f18d51f0..879e233fa55 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -83,14 +83,17 @@ #if defined(USE_OZONE) #include "ui/ozone/public/ozone_platform.h" #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include <ApplicationServices/ApplicationServices.h> -#endif // OS_MACOSX +#endif // OS_MAC #if defined(OS_WIN) #include "base/base_paths_win.h" #include "base/win/windows_version.h" #include "ui/display/win/screen_win.h" #endif // OS_WIN +#if BUILDFLAG(IS_CHROMECAST) +#include "chromecast/chromecast_buildflags.h" +#endif namespace content { @@ -113,10 +116,10 @@ NOINLINE void FatalGpuProcessLaunchFailureOnBackground() { #endif #if defined(OS_WIN) -int GetGpuBlacklistHistogramValueWin(gpu::GpuFeatureStatus status) { +int GetGpuBlocklistHistogramValueWin(gpu::GpuFeatureStatus status) { // The enums are defined as: // Enabled VERSION_PRE_XP = 0, - // Blacklisted VERSION_PRE_XP = 1, + // Blocklisted VERSION_PRE_XP = 1, // Disabled VERSION_PRE_XP = 2, // Software VERSION_PRE_XP = 3, // Unknown VERSION_PRE_XP = 4, @@ -232,19 +235,19 @@ void EnableIntelShaderCache() { // Send UMA histograms about the enabled features and GPU properties. void UpdateFeatureStats(const gpu::GpuFeatureInfo& gpu_feature_info) { // Update applied entry stats. - std::unique_ptr<gpu::GpuBlocklist> blacklist(gpu::GpuBlocklist::Create()); - DCHECK(blacklist.get() && blacklist->max_entry_id() > 0); - uint32_t max_entry_id = blacklist->max_entry_id(); + std::unique_ptr<gpu::GpuBlocklist> blocklist(gpu::GpuBlocklist::Create()); + DCHECK(blocklist.get() && blocklist->max_entry_id() > 0); + uint32_t max_entry_id = blocklist->max_entry_id(); // Use entry 0 to capture the total number of times that data // was recorded in this histogram in order to have a convenient - // denominator to compute blacklist percentages for the rest of the + // denominator to compute blocklist percentages for the rest of the // entries. UMA_HISTOGRAM_EXACT_LINEAR("GPU.BlacklistTestResultsPerEntry", 0, max_entry_id + 1); - if (!gpu_feature_info.applied_gpu_blacklist_entries.empty()) { - std::vector<uint32_t> entry_ids = blacklist->GetEntryIDsFromIndices( - gpu_feature_info.applied_gpu_blacklist_entries); - DCHECK_EQ(gpu_feature_info.applied_gpu_blacklist_entries.size(), + if (!gpu_feature_info.applied_gpu_blocklist_entries.empty()) { + std::vector<uint32_t> entry_ids = blocklist->GetEntryIDsFromIndices( + gpu_feature_info.applied_gpu_blocklist_entries); + DCHECK_EQ(gpu_feature_info.applied_gpu_blocklist_entries.size(), entry_ids.size()); for (auto id : entry_ids) { DCHECK_GE(max_entry_id, id); @@ -263,7 +266,7 @@ void UpdateFeatureStats(const gpu::GpuFeatureInfo& gpu_feature_info) { gpu::GPU_FEATURE_TYPE_OOP_RASTERIZATION, gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL2}; - const std::string kGpuBlacklistFeatureHistogramNames[] = { + const std::string kGpuBlocklistFeatureHistogramNames[] = { "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", "GPU.BlacklistFeatureTestResults.GpuCompositing", "GPU.BlacklistFeatureTestResults.GpuRasterization", @@ -279,7 +282,7 @@ void UpdateFeatureStats(const gpu::GpuFeatureInfo& gpu_feature_info) { (command_line.HasSwitch(switches::kDisableWebGL) || command_line.HasSwitch(switches::kDisableWebGL2))}; #if defined(OS_WIN) - const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { + const std::string kGpuBlocklistFeatureHistogramNamesWin[] = { "GPU.BlacklistFeatureTestResultsWindows2.Accelerated2dCanvas", "GPU.BlacklistFeatureTestResultsWindows2.GpuCompositing", "GPU.BlacklistFeatureTestResultsWindows2.GpuRasterization", @@ -297,17 +300,17 @@ void UpdateFeatureStats(const gpu::GpuFeatureInfo& gpu_feature_info) { if (value == gpu::kGpuFeatureStatusEnabled && kGpuFeatureUserFlags[i]) value = gpu::kGpuFeatureStatusDisabled; base::HistogramBase* histogram_pointer = base::LinearHistogram::FactoryGet( - kGpuBlacklistFeatureHistogramNames[i], 1, gpu::kGpuFeatureStatusMax, + kGpuBlocklistFeatureHistogramNames[i], 1, gpu::kGpuFeatureStatusMax, gpu::kGpuFeatureStatusMax + 1, base::HistogramBase::kUmaTargetedHistogramFlag); histogram_pointer->Add(value); #if defined(OS_WIN) - int value_win = GetGpuBlacklistHistogramValueWin(value); + int value_win = GetGpuBlocklistHistogramValueWin(value); if (value_win >= 0) { int32_t max_sample = static_cast<int32_t>(base::win::Version::WIN_LAST) * gpu::kGpuFeatureStatusMax; histogram_pointer = base::LinearHistogram::FactoryGet( - kGpuBlacklistFeatureHistogramNamesWin[i], 1, max_sample, + kGpuBlocklistFeatureHistogramNamesWin[i], 1, max_sample, max_sample + 1, base::HistogramBase::kUmaTargetedHistogramFlag); histogram_pointer->Add(value_win); } @@ -336,7 +339,7 @@ void UpdateDriverBugListStats(const gpu::GpuFeatureInfo& gpu_feature_info) { } } -#if defined(OS_MACOSX) +#if defined(OS_MAC) void DisplayReconfigCallback(CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void* gpu_data_manager) { @@ -359,7 +362,7 @@ void DisplayReconfigCallback(CGDirectDisplayID display, if (gpu_changed) manager->HandleGpuSwitch(); } -#endif // OS_MACOSX +#endif // OS_MAC // Block all domains' use of 3D APIs for this many milliseconds if // approaching a threshold where system stability might be compromised. @@ -419,7 +422,7 @@ bool ALLOW_UNUSED_TYPE VulkanAllowed() { // Determines if Metal is available for the GPU process. bool ALLOW_UNUSED_TYPE MetalAllowed() { -#if defined(OS_MACOSX) +#if defined(OS_MAC) return base::FeatureList::IsEnabled(features::kMetal); #else return false; @@ -514,9 +517,9 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner) AppendGpuCommandLine(command_line, GPU_PROCESS_KIND_SANDBOXED); } -#if defined(OS_MACOSX) +#if defined(OS_MAC) CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_); -#endif // OS_MACOSX +#endif // OS_MAC // For testing only. if (command_line->HasSwitch(switches::kDisableDomainBlockingFor3DAPIs)) @@ -531,7 +534,7 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner) } GpuDataManagerImplPrivate::~GpuDataManagerImplPrivate() { -#if defined(OS_MACOSX) +#if defined(OS_MAC) CGDisplayRemoveReconfigurationCallback(DisplayReconfigCallback, owner_); #endif @@ -563,8 +566,10 @@ void GpuDataManagerImplPrivate::InitializeGpuModes() { // Chomecast audio-only builds run with the flag --disable-gpu. The GPU // process should not be started in this case. #if BUILDFLAG(IS_CHROMECAST) +#if BUILDFLAG(IS_CAST_AUDIO_ONLY) fallback_modes_.clear(); fallback_modes_.push_back(gpu::GpuMode::DISABLED); +#endif #elif defined(OS_ANDROID) || defined(OS_CHROMEOS) CHECK(false) << "GPU acceleration is required on certain platforms!"; #endif // IS_CHROMECAST @@ -587,14 +592,14 @@ void GpuDataManagerImplPrivate::InitializeGpuModes() { FallBackToNextGpuMode(); } -void GpuDataManagerImplPrivate::BlacklistWebGLForTesting() { +void GpuDataManagerImplPrivate::BlocklistWebGLForTesting() { // This function is for testing only, so disable histograms. update_histograms_ = false; gpu::GpuFeatureInfo gpu_feature_info; for (int ii = 0; ii < gpu::NUMBER_OF_GPU_FEATURE_TYPES; ++ii) { if (ii == static_cast<int>(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL)) - gpu_feature_info.status_values[ii] = gpu::kGpuFeatureStatusBlacklisted; + gpu_feature_info.status_values[ii] = gpu::kGpuFeatureStatusBlocklisted; else gpu_feature_info.status_values[ii] = gpu::kGpuFeatureStatusEnabled; } @@ -717,7 +722,7 @@ void GpuDataManagerImplPrivate::RequestGpuSupportedDx12Version(bool delayed) { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch( - switches::kDisableGpuProcessForDX12VulkanInfoCollection)) { + switches::kDisableGpuProcessForDX12InfoCollection)) { manager->UpdateDx12RequestStatus(false); return; } @@ -778,14 +783,6 @@ void GpuDataManagerImplPrivate::RequestGpuSupportedVulkanVersion(bool delayed) { if (manager->VulkanRequested()) return; - base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch( - switches::kDisableGpuProcessForDX12VulkanInfoCollection)) { - manager->UpdateVulkanRequestStatus(false); - return; - } - // No info collection for software GL implementation (id == 0xffff) or // abnormal situation (id == 0). There are a few crash reports on // exit_or_terminate_process() during process teardown. The GPU ID @@ -1170,7 +1167,7 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( command_line->AppendSwitchASCII(switches::kUseGL, use_gl); } -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) // MacOSX bots use real GPU in tests. if (browser_command_line->HasSwitch(switches::kHeadless)) { if (command_line->HasSwitch(switches::kUseGL)) { @@ -1181,7 +1178,7 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( command_line->AppendSwitch(switches::kOverrideUseSoftwareGLForTests); } } -#endif // !OS_MACOSX +#endif // !OS_MAC } void GpuDataManagerImplPrivate::UpdateGpuPreferences( @@ -1240,7 +1237,7 @@ void GpuDataManagerImplPrivate::UpdateGpuPreferences( } #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) if (gpu_mode_ != gpu::GpuMode::HARDWARE_METAL) gpu_preferences->enable_metal = false; #elif BUILDFLAG(ENABLE_VULKAN) @@ -1523,7 +1520,7 @@ GpuDataManagerImplPrivate::Are3DAPIsBlockedAtTime(const GURL& url, } // Look at the timestamps of the recent GPU resets to see if there are - // enough within the threshold which would cause us to blacklist all + // enough within the threshold which would cause us to blocklist all // domains. This doesn't need to be overly precise -- if time goes // backward due to a system clock adjustment, that's fine. // diff --git a/chromium/content/browser/gpu/gpu_data_manager_impl_private.h b/chromium/content/browser/gpu/gpu_data_manager_impl_private.h index 563472dcafa..27b517d56af 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/chromium/content/browser/gpu/gpu_data_manager_impl_private.h @@ -38,7 +38,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { explicit GpuDataManagerImplPrivate(GpuDataManagerImpl* owner); virtual ~GpuDataManagerImplPrivate(); - void BlacklistWebGLForTesting(); + void BlocklistWebGLForTesting(); gpu::GPUInfo GetGPUInfo() const; gpu::GPUInfo GetGPUInfoForHardwareGpu() const; bool GpuAccessAllowed(std::string* reason) const; @@ -146,7 +146,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { // Indicates the reason that access to a given client API (like // WebGL or Pepper 3D) was blocked or not. This state is distinct - // from blacklisting of an entire feature. + // from blocklisting of an entire feature. enum class DomainBlockStatus { kBlocked, kAllDomainsBlocked, diff --git a/chromium/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc b/chromium/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc index eb0735e9e6c..21aee956e22 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc +++ b/chromium/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc @@ -26,6 +26,13 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" +#if BUILDFLAG(IS_CHROMECAST) +#include "chromecast/chromecast_buildflags.h" +#if BUILDFLAG(IS_CAST_AUDIO_ONLY) +#define CAST_AUDIO_ONLY +#endif +#endif + namespace content { namespace { @@ -292,7 +299,7 @@ TEST_F(GpuDataManagerImplPrivateTest, FallbackWithSwiftShaderDisabled) { } #endif // !OS_FUCHSIA -#if !BUILDFLAG(IS_CHROMECAST) +#if !defined(CAST_AUDIO_ONLY) TEST_F(GpuDataManagerImplPrivateTest, GpuStartsWithGpuDisabled) { base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableGpu); ScopedGpuDataManagerImplPrivate manager; @@ -302,7 +309,7 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuStartsWithGpuDisabled) { #endif // !OS_ANDROID && !OS_CHROMEOS // Chromecast audio-only builds should not launch the GPU process. -#if BUILDFLAG(IS_CHROMECAST) +#if defined(CAST_AUDIO_ONLY) TEST_F(GpuDataManagerImplPrivateTest, ChromecastStartsWithGpuDisabled) { base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableGpu); ScopedGpuDataManagerImplPrivate manager; @@ -310,7 +317,7 @@ TEST_F(GpuDataManagerImplPrivateTest, ChromecastStartsWithGpuDisabled) { } #endif // IS_CHROMECAST -#if defined(OS_MACOSX) +#if defined(OS_MAC) TEST_F(GpuDataManagerImplPrivateTest, FallbackFromMetalToGL) { base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeature(features::kMetal); @@ -335,7 +342,7 @@ TEST_F(GpuDataManagerImplPrivateTest, FallbackFromMetalWithGLDisabled) { manager->FallBackToNextGpuMode(); EXPECT_EQ(gpu::GpuMode::SWIFTSHADER, manager->GetGpuMode()); } -#endif // OS_MACOSX +#endif // OS_MAC #if BUILDFLAG(ENABLE_VULKAN) TEST_F(GpuDataManagerImplPrivateTest, GpuStartsWithUseVulkanFlag) { diff --git a/chromium/content/browser/gpu/gpu_data_manager_testing.json b/chromium/content/browser/gpu/gpu_data_manager_testing.json index f5d871c0533..aff45e09726 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_testing.json +++ b/chromium/content/browser/gpu/gpu_data_manager_testing.json @@ -4,14 +4,14 @@ "entries": [ { "id": 1, - "description": "GpuDataManagerImplPrivateTest.GpuSideBlacklisting.0", + "description": "GpuDataManagerImplPrivateTest.GpuSideBlocklisting.0", "features": [ "accelerated_webgl" ] }, { "id": 2, - "description": "GpuDataManagerImplPrivateTest.GpuSideBlacklisting.1", + "description": "GpuDataManagerImplPrivateTest.GpuSideBlocklisting.1", "gl_renderer": ".*GeForce.*", "features": [ "accelerated_2d_canvas" @@ -19,14 +19,14 @@ }, { "id": 3, - "description": "GpuDataManagerImplPrivateTest.GpuSideBlacklistingWebGL.0", + "description": "GpuDataManagerImplPrivateTest.GpuSideBlocklistingWebGL.0", "features": [ "accelerated_2d_canvas" ] }, { "id": 4, - "description": "GpuDataManagerImplPrivateTest.GpuSideBlacklistingWebGL.1", + "description": "GpuDataManagerImplPrivateTest.GpuSideBlocklistingWebGL.1", "gl_renderer": ".*GeForce.*", "features": [ "accelerated_webgl", @@ -47,7 +47,7 @@ }, { "id": 6, - "description": "GpuDataManagerImplPrivateTest.BlacklistAllFeatures", + "description": "GpuDataManagerImplPrivateTest.BlocklistAllFeatures", "features": [ "all" ] diff --git a/chromium/content/browser/gpu/gpu_data_manager_testing_autogen.cc b/chromium/content/browser/gpu/gpu_data_manager_testing_autogen.cc index 7d2a264c142..d7f06792ce1 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_testing_autogen.cc +++ b/chromium/content/browser/gpu/gpu_data_manager_testing_autogen.cc @@ -18,7 +18,7 @@ namespace gpu { const GpuControlList::Entry kGpuDataManagerTestingEntries[] = { { 1, // id - "GpuDataManagerImplPrivateTest.GpuSideBlacklisting.0", + "GpuDataManagerImplPrivateTest.GpuSideBlocklisting.0", base::size(kFeatureListForGpuManagerTestingEntry1), // features size kFeatureListForGpuManagerTestingEntry1, // features 0, // DisabledExtensions size @@ -52,7 +52,7 @@ const GpuControlList::Entry kGpuDataManagerTestingEntries[] = { }, { 2, // id - "GpuDataManagerImplPrivateTest.GpuSideBlacklisting.1", + "GpuDataManagerImplPrivateTest.GpuSideBlocklisting.1", base::size(kFeatureListForGpuManagerTestingEntry2), // features size kFeatureListForGpuManagerTestingEntry2, // features 0, // DisabledExtensions size @@ -86,7 +86,7 @@ const GpuControlList::Entry kGpuDataManagerTestingEntries[] = { }, { 3, // id - "GpuDataManagerImplPrivateTest.GpuSideBlacklistingWebGL.0", + "GpuDataManagerImplPrivateTest.GpuSideBlocklistingWebGL.0", base::size(kFeatureListForGpuManagerTestingEntry3), // features size kFeatureListForGpuManagerTestingEntry3, // features 0, // DisabledExtensions size @@ -120,7 +120,7 @@ const GpuControlList::Entry kGpuDataManagerTestingEntries[] = { }, { 4, // id - "GpuDataManagerImplPrivateTest.GpuSideBlacklistingWebGL.1", + "GpuDataManagerImplPrivateTest.GpuSideBlocklistingWebGL.1", base::size(kFeatureListForGpuManagerTestingEntry4), // features size kFeatureListForGpuManagerTestingEntry4, // features 0, // DisabledExtensions size @@ -188,7 +188,7 @@ const GpuControlList::Entry kGpuDataManagerTestingEntries[] = { }, { 6, // id - "GpuDataManagerImplPrivateTest.BlacklistAllFeatures", + "GpuDataManagerImplPrivateTest.BlocklistAllFeatures", base::size(kFeatureListForGpuManagerTestingEntry6), // features size kFeatureListForGpuManagerTestingEntry6, // features 0, // DisabledExtensions size diff --git a/chromium/content/browser/gpu/gpu_data_manager_testing_entry_enums_autogen.h b/chromium/content/browser/gpu/gpu_data_manager_testing_entry_enums_autogen.h index 2b8c1ad3460..866b0260c76 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_testing_entry_enums_autogen.h +++ b/chromium/content/browser/gpu/gpu_data_manager_testing_entry_enums_autogen.h @@ -13,12 +13,12 @@ namespace gpu { enum GpuDataManagerTestingEntryEnum { - kGpuDataManagerImplPrivateTest_GpuSideBlacklisting_0 = 0, - kGpuDataManagerImplPrivateTest_GpuSideBlacklisting_1 = 1, - kGpuDataManagerImplPrivateTest_GpuSideBlacklistingWebGL_0 = 2, - kGpuDataManagerImplPrivateTest_GpuSideBlacklistingWebGL_1 = 3, + kGpuDataManagerImplPrivateTest_GpuSideBlocklisting_0 = 0, + kGpuDataManagerImplPrivateTest_GpuSideBlocklisting_1 = 1, + kGpuDataManagerImplPrivateTest_GpuSideBlocklistingWebGL_0 = 2, + kGpuDataManagerImplPrivateTest_GpuSideBlocklistingWebGL_1 = 3, kGpuDataManagerImplPrivateTest_GpuSideException = 4, - kGpuDataManagerImplPrivateTest_BlacklistAllFeatures = 5, + kGpuDataManagerImplPrivateTest_BlocklistAllFeatures = 5, kGpuDataManagerImplPrivateTest_UpdateActiveGpu = 6, }; } // namespace gpu diff --git a/chromium/content/browser/gpu/gpu_internals_ui.cc b/chromium/content/browser/gpu/gpu_internals_ui.cc index 3a61d1573d3..618abbcd773 100644 --- a/chromium/content/browser/gpu/gpu_internals_ui.cc +++ b/chromium/content/browser/gpu/gpu_internals_ui.cc @@ -76,6 +76,9 @@ WebUIDataSource* CreateGpuHTMLSource() { source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::ScriptSrc, "script-src chrome://resources 'self' 'unsafe-eval';"); + source->OverrideContentSecurityPolicy( + network::mojom::CSPDirectiveName::TrustedTypes, + "trusted-types jstemplate;"); source->UseStringsJs(); source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); @@ -379,7 +382,7 @@ std::unique_ptr<base::ListValue> GpuMemoryBufferInfo( gpu::GpuMemoryBufferConfigurationSet native_config; #if defined(USE_X11) - if (features::IsUsingOzonePlatform()) { + if (!features::IsUsingOzonePlatform()) { for (const auto& config : gpu_extra_info.gpu_memory_buffer_support_x11) { native_config.emplace(config); } @@ -821,7 +824,7 @@ void GpuMessageHandler::OnGpuInfoUpdate() { GpuDataManagerImpl::GetInstance()->GetGpuExtraInfo(); auto gpu_info_val = GpuInfoAsDictionaryValue(); - // Add in blacklisting features + // Add in blocklisting features auto feature_status = std::make_unique<base::DictionaryValue>(); feature_status->Set("featureStatus", GetFeatureStatus()); feature_status->Set("problems", GetProblems()); diff --git a/chromium/content/browser/gpu/gpu_ipc_browsertests.cc b/chromium/content/browser/gpu/gpu_ipc_browsertests.cc index e25560436b4..2a757f59cd6 100644 --- a/chromium/content/browser/gpu/gpu_ipc_browsertests.cc +++ b/chromium/content/browser/gpu/gpu_ipc_browsertests.cc @@ -24,7 +24,7 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/include/gpu/GrContext.h" +#include "third_party/skia/include/gpu/GrDirectContext.h" #include "ui/gl/gl_switches.h" namespace { @@ -205,7 +205,7 @@ IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest, content::GpuBrowsertestCreateContext(GetGpuChannel()); ASSERT_EQ(provider->BindToCurrentThread(), gpu::ContextResult::kSuccess); - sk_sp<GrContext> gr_context = sk_ref_sp(provider->GrContext()); + sk_sp<GrDirectContext> gr_context = sk_ref_sp(provider->GrContext()); SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget( diff --git a/chromium/content/browser/gpu/gpu_process_host.cc b/chromium/content/browser/gpu/gpu_process_host.cc index 9f9d3422ad1..aeae01a0958 100644 --- a/chromium/content/browser/gpu/gpu_process_host.cc +++ b/chromium/content/browser/gpu/gpu_process_host.cc @@ -30,6 +30,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" +#include "build/lacros_buildflags.h" #include "components/discardable_memory/service/discardable_shared_memory_manager.h" #include "components/tracing/common/tracing_switches.h" #include "components/viz/common/features.h" @@ -63,6 +64,7 @@ #include "gpu/config/gpu_preferences.h" #include "gpu/config/gpu_switches.h" #include "gpu/ipc/common/gpu_client_ids.h" +#include "gpu/ipc/common/result_codes.h" #include "gpu/ipc/host/shader_disk_cache.h" #include "gpu/ipc/in_process_command_buffer.h" #include "media/base/media_switches.h" @@ -70,8 +72,8 @@ #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/generic_pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h" -#include "services/service_manager/sandbox/sandbox_type.h" -#include "services/service_manager/sandbox/switches.h" +#include "sandbox/policy/sandbox_type.h" +#include "sandbox/policy/switches.h" #include "ui/base/ui_base_features.h" #include "ui/base/ui_base_switches.h" #include "ui/display/display_switches.h" @@ -81,9 +83,9 @@ #include "ui/latency/latency_info.h" #if defined(OS_WIN) +#include "sandbox/policy/win/sandbox_win.h" #include "sandbox/win/src/sandbox_policy.h" #include "sandbox/win/src/window.h" -#include "services/service_manager/sandbox/win/sandbox_win.h" #include "ui/gfx/win/rendering_window_manager.h" #endif @@ -101,11 +103,11 @@ #include "content/common/zygote/zygote_handle_impl_linux.h" #endif -#if defined(OS_MACOSX) || defined(OS_ANDROID) +#if defined(OS_MAC) || defined(OS_ANDROID) #include "gpu/ipc/common/gpu_surface_tracker.h" #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "components/metal_util/switches.h" #include "content/browser/gpu/ca_transaction_gpu_coordinator.h" #endif @@ -116,6 +118,10 @@ base::subtle::Atomic32 GpuProcessHost::gpu_crash_count_ = 0; bool GpuProcessHost::crashed_before_ = false; int GpuProcessHost::recent_crash_count_ = 0; gpu::GpuMode GpuProcessHost::last_crash_mode_ = gpu::GpuMode::UNKNOWN; +// RESULT_CODE_HUNG is expected to be the same in both +// content/public/common/result_codes.h and gpu/ipc/common/result_codes.h +static_assert(RESULT_CODE_HUNG == static_cast<int>(gpu::RESULT_CODE_HUNG), + "Please use the same enum value in both header files."); namespace { @@ -192,7 +198,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( return GpuTerminationStatus::PROCESS_CRASHED; case base::TERMINATION_STATUS_STILL_RUNNING: return GpuTerminationStatus::STILL_RUNNING; -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS) case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM: return GpuTerminationStatus::PROCESS_WAS_KILLED_BY_OOM; #endif @@ -215,12 +221,12 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( // Command-line switches to propagate to the GPU process. static const char* const kSwitchNames[] = { - service_manager::switches::kDisableSeccompFilterSandbox, - service_manager::switches::kGpuSandboxAllowSysVShm, - service_manager::switches::kGpuSandboxFailuresFatal, - service_manager::switches::kDisableGpuSandbox, - service_manager::switches::kNoSandbox, -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) + sandbox::policy::switches::kDisableSeccompFilterSandbox, + sandbox::policy::switches::kGpuSandboxAllowSysVShm, + sandbox::policy::switches::kGpuSandboxFailuresFatal, + sandbox::policy::switches::kDisableGpuSandbox, + sandbox::policy::switches::kNoSandbox, +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_LACROS) switches::kDisableDevShmUsage, #endif #if defined(OS_WIN) @@ -258,8 +264,8 @@ static const char* const kSwitchNames[] = { switches::kV, switches::kVModule, switches::kUseAdapterLuid, -#if defined(OS_MACOSX) - service_manager::switches::kEnableSandboxLogging, +#if defined(OS_MAC) + sandbox::policy::switches::kEnableSandboxLogging, switches::kDisableAVFoundationOverlays, switches::kDisableMacOverlays, switches::kDisableMetalTestShaders, @@ -276,7 +282,7 @@ static const char* const kSwitchNames[] = { switches::kX11Display, switches::kNoXshm, #endif - switches::kGpuBlacklistTestGroup, + switches::kGpuBlocklistTestGroup, switches::kGpuDriverBugListTestGroup, switches::kUseCmdDecoder, switches::kForceVideoOverlays, @@ -374,7 +380,7 @@ class GpuSandboxedProcessLauncherDelegate // Open GL path. policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, sandbox::USER_LIMITED); - service_manager::SandboxWin::SetJobLevel( + sandbox::policy::SandboxWin::SetJobLevel( cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy); } else { policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, @@ -386,7 +392,7 @@ class GpuSandboxedProcessLauncherDelegate // turn blocks on the browser UI thread. So, instead we forgo a window // message pump entirely and just add job restrictions to prevent child // processes. - service_manager::SandboxWin::SetJobLevel( + sandbox::policy::SandboxWin::SetJobLevel( cmd_line_, sandbox::JOB_LIMITED_USER, JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS | JOB_OBJECT_UILIMIT_DESKTOP | JOB_OBJECT_UILIMIT_EXITWINDOWS | @@ -429,7 +435,7 @@ class GpuSandboxedProcessLauncherDelegate #if BUILDFLAG(USE_ZYGOTE_HANDLE) ZygoteHandle GetZygote() override { - if (service_manager::IsUnsandboxedSandboxType(GetSandboxType())) + if (sandbox::policy::IsUnsandboxedSandboxType(GetSandboxType())) return nullptr; // The GPU process needs a specialized sandbox, so fork from the unsandboxed @@ -438,12 +444,12 @@ class GpuSandboxedProcessLauncherDelegate } #endif // BUILDFLAG(USE_ZYGOTE_HANDLE) - service_manager::SandboxType GetSandboxType() override { - if (cmd_line_.HasSwitch(service_manager::switches::kDisableGpuSandbox)) { + sandbox::policy::SandboxType GetSandboxType() override { + if (cmd_line_.HasSwitch(sandbox::policy::switches::kDisableGpuSandbox)) { DVLOG(1) << "GPU sandbox is disabled"; - return service_manager::SandboxType::kNoSandbox; + return sandbox::policy::SandboxType::kNoSandbox; } - return service_manager::SandboxType::kGpu; + return sandbox::policy::SandboxType::kGpu; } private: @@ -470,8 +476,8 @@ class GpuSandboxedProcessLauncherDelegate void RecordAppContainerStatus(int error_code, bool crashed_before) { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!crashed_before && - service_manager::SandboxWin::IsAppContainerEnabledForSandbox( - *command_line, service_manager::SandboxType::kGpu)) { + sandbox::policy::SandboxWin::IsAppContainerEnabledForSandbox( + *command_line, sandbox::policy::SandboxType::kGpu)) { base::UmaHistogramSparse("GPU.AppContainer.Status", error_code); } } @@ -501,7 +507,7 @@ void BindDiscardableMemoryReceiverOnUI( // static bool GpuProcessHost::ValidateHost(GpuProcessHost* host) { // The Gpu process is invalid if it's not using SwiftShader, the card is - // blacklisted, and we can kill it and start over. + // blocklisted, and we can kill it and start over. if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSingleProcess) || base::CommandLine::ForCurrentProcess()->HasSwitch( @@ -714,7 +720,7 @@ GpuProcessHost::~GpuProcessHost() { SendOutstandingReplies(); -#if defined(OS_MACOSX) +#if defined(OS_MAC) if (ca_transaction_gpu_coordinator_) { ca_transaction_gpu_coordinator_->HostWillBeDestroyed(); ca_transaction_gpu_coordinator_ = nullptr; @@ -784,11 +790,11 @@ GpuProcessHost::~GpuProcessHost() { case base::TERMINATION_STATUS_STILL_RUNNING: message += "hasn't exited yet."; break; -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS) case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM: message += "was killed due to out of memory."; break; -#endif // OS_CHROMEOS +#endif // OS_CHROMEOS || BUILDFLAG(IS_LACROS) #if defined(OS_ANDROID) case base::TERMINATION_STATUS_OOM_PROTECTED: message += "was protected from out of memory kill."; @@ -842,7 +848,7 @@ bool GpuProcessHost::Init() { process_->GetInProcessMojoInvitation()), gpu_preferences)); base::Thread::Options options; -#if defined(OS_WIN) || defined(OS_MACOSX) +#if defined(OS_WIN) || defined(OS_MAC) // WGL needs to create its own window and pump messages on it. options.message_pump_type = base::MessagePumpType::UI; #endif @@ -887,7 +893,7 @@ bool GpuProcessHost::Init() { } #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) ca_transaction_gpu_coordinator_ = CATransactionGPUCoordinator::Create(this); #endif @@ -1117,10 +1123,10 @@ bool GpuProcessHost::LaunchGpuProcess() { std::unique_ptr<base::CommandLine> cmd_line = std::make_unique<base::CommandLine>(base::CommandLine::NO_PROGRAM); #else -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) int child_flags = gpu_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : ChildProcessHost::CHILD_NORMAL; -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) int child_flags = ChildProcessHost::CHILD_GPU; #else int child_flags = ChildProcessHost::CHILD_NORMAL; @@ -1144,7 +1150,7 @@ bool GpuProcessHost::LaunchGpuProcess() { #endif // defined(OS_WIN) if (kind_ == GPU_PROCESS_KIND_INFO_COLLECTION) { - cmd_line->AppendSwitch(service_manager::switches::kDisableGpuSandbox); + cmd_line->AppendSwitch(sandbox::policy::switches::kDisableGpuSandbox); cmd_line->AppendSwitchASCII(switches::kUseGL, gl::kGLImplementationDisabledName); diff --git a/chromium/content/browser/gpu/gpu_process_host.h b/chromium/content/browser/gpu/gpu_process_host.h index b2aef2c770f..a0e82af587f 100644 --- a/chromium/content/browser/gpu/gpu_process_host.h +++ b/chromium/content/browser/gpu/gpu_process_host.h @@ -57,7 +57,7 @@ class Thread; namespace content { class BrowserChildProcessHostImpl; -#if defined(OS_MACOSX) +#if defined(OS_MAC) class CATransactionGPUCoordinator; #endif @@ -72,7 +72,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, // Returns null on failure. It is not safe to store the pointer once control // has returned to the message loop as it can be destroyed. Instead store the // associated GPU host ID. This could return NULL if GPU access is not - // allowed (blacklisted). + // allowed (blocklisted). CONTENT_EXPORT static GpuProcessHost* Get( GpuProcessKind kind = GPU_PROCESS_KIND_SANDBOXED, bool force_create = true); @@ -248,7 +248,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, std::unique_ptr<BrowserChildProcessHostImpl> process_; std::unique_ptr<base::Thread> in_process_gpu_thread_; -#if defined(OS_MACOSX) +#if defined(OS_MAC) scoped_refptr<CATransactionGPUCoordinator> ca_transaction_gpu_coordinator_; #endif diff --git a/chromium/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc b/chromium/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc index 3ae1eae938b..33f69a2d54b 100644 --- a/chromium/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc +++ b/chromium/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc @@ -115,7 +115,7 @@ class TestGpuService : public viz::mojom::GpuService { void OnMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel level) override {} #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) void BeginCATransaction() override {} void CommitCATransaction(CommitCATransactionCallback callback) override {} #endif |