Commit 3bd6e4b3 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

mac: Force InitializeVideoToolbox() in the GPU's PreSandboxStartup().

Under the V2 sandbox architecture, there is technically nothing that
runs "pre-sandbox startup". But we hypothesize that deferring the
initialization of VideoToolbox to the first use is leading to hangs,
which the watchdog turns into crashes. By forcing initialization at this
call site, the GPU watchdog thread is not running, which is what happens
under the V1 sandbox architecture.

Bug: 871280
Change-Id: I7c1173ecf7752307c19ac15f81e9b1c699d4523b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1932166Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719164}
parent 2f8e608a
...@@ -92,6 +92,8 @@ ...@@ -92,6 +92,8 @@
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "base/message_loop/message_pump_mac.h" #include "base/message_loop/message_pump_mac.h"
#include "components/metal_util/test_shader.h" #include "components/metal_util/test_shader.h"
#include "content/public/common/content_features.h"
#include "media/gpu/mac/vt_video_decode_accelerator_mac.h"
#include "sandbox/mac/seatbelt.h" #include "sandbox/mac/seatbelt.h"
#include "services/service_manager/sandbox/mac/sandbox_mac.h" #include "services/service_manager/sandbox/mac/sandbox_mac.h"
#endif #endif
...@@ -157,6 +159,13 @@ class ContentSandboxHelper : public gpu::GpuSandboxHelper { ...@@ -157,6 +159,13 @@ class ContentSandboxHelper : public gpu::GpuSandboxHelper {
media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization(); media::MediaFoundationVideoEncodeAccelerator::PreSandboxInitialization();
#endif #endif
#if defined(OS_MACOSX)
if (base::FeatureList::IsEnabled(features::kMacV2GPUSandbox)) {
TRACE_EVENT0("gpu", "Initialize VideoToolbox");
media::InitializeVideoToolbox();
}
#endif
// On Linux, reading system memory doesn't work through the GPU sandbox. // On Linux, reading system memory doesn't work through the GPU sandbox.
// This value is cached, so access it here to populate the cache. // This value is cached, so access it here to populate the cache.
base::SysInfo::AmountOfPhysicalMemory(); base::SysInfo::AmountOfPhysicalMemory();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment