0
Files
src/content/gpu/browser_exposed_gpu_interfaces.cc
kylechar 3da52ff912 Switch define(USE_OZONE) to BUILDFLAG(IS_OZONE)
Right now ozone platform usage is checked via #if defined(USE_OZONE).
This is error prone as a typo, eg. defined(USE_OZOEN), will compile but
the #if will always be false. BUILDFLAG(IS_OZONE) improves this by
making the typo into a compile error.

Update remaining files that needed a security reviewer.

Bug: 1377327
Change-Id: I3cc0ac3ffb33831d4bc0d0ce9d0edef8a4f6558b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4009342
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1068543}
2022-11-08 14:08:57 +00:00

33 lines
947 B
C++

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/gpu/browser_exposed_gpu_interfaces.h"
#include "build/build_config.h"
#include "content/public/common/content_client.h"
#include "content/public/gpu/content_gpu_client.h"
#include "mojo/public/cpp/bindings/binder_map.h"
#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif
namespace content {
void ExposeGpuInterfacesToBrowser(
const gpu::GpuPreferences& gpu_preferences,
const gpu::GpuDriverBugWorkarounds& gpu_workarounds,
mojo::BinderMap* binders) {
if (GetContentClient()->gpu()) { // May be null in tests.
GetContentClient()->gpu()->ExposeInterfacesToBrowser(
gpu_preferences, gpu_workarounds, binders);
}
#if BUILDFLAG(IS_OZONE)
ui::OzonePlatform::GetInstance()->AddInterfaces(binders);
#endif
}
} // namespace content