Commit f5a8352d authored by Yuta Hijikata's avatar Yuta Hijikata Committed by Chromium LUCI CQ

Lacros: Preparation for lacros target_os switch.

This is a mechanical change replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and adding BUILDFLAG(IS_CHROMEOS_LACROS) to
defined(OS_LINUX) to ensure switching lacros' target_os from linux to
chromeos does not affect the lacros binary.

It also renames chromeos_is_browser_only with is_chromeos_lacros which
was a gn var introduced to be used in place of chromeos_is_browser_only.

More detail on http://go/lacros-macros.

Bug: 1052397
Change-Id: Ic26b3db620b45e27e4f28e35a4015e08f4f2c6fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2631389Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844437}
parent a5d13f96
......@@ -813,7 +813,7 @@ const base::Feature kWebAppEnableProtocolHandlers{
// without conversion to I420.
const base::Feature kWebRtcLibvpxEncodeNV12 {
"WebRtcLibvpxEncodeNV12",
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
......
......@@ -83,6 +83,7 @@ blink_core_sources("exported") {
}
deps = [
"//build:chromeos_buildflags",
"//third_party/blink/renderer/core:core_generated",
"//third_party/blink/renderer/core/probe",
"//third_party/blink/renderer/core/typed_arrays:typed_arrays",
......
......@@ -189,6 +189,8 @@
#undef pow
#include <cmath> // for std::pow
#include "build/chromeos_buildflags.h"
// The following constants control parameters for automated scaling of webpages
// (such as due to a double tap gesture or find in page etc.). These are
// experimentally determined.
......@@ -410,7 +412,9 @@ ui::mojom::blink::WindowOpenDisposition NavigationPolicyToDisposition(
#if !defined(OS_MAC) && !defined(OS_WIN)
SkFontHinting RendererPreferencesToSkiaHinting(
const blink::RendererPreferences& prefs) {
#if defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
if (!prefs.should_antialias_text) {
// When anti-aliasing is off, GTK maps all non-zero hinting settings to
// 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight'
......@@ -3067,12 +3071,15 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs() {
gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
WebFontRenderStyle::SetSubpixelPositioning(
renderer_preferences_.use_subpixel_positioning);
#if defined(OS_LINUX) && !defined(OS_ANDROID)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && !defined(OS_ANDROID)
if (!renderer_preferences_.system_font_family_name.empty()) {
WebFontRenderStyle::SetSystemFontFamily(blink::WebString::FromUTF8(
renderer_preferences_.system_font_family_name));
}
#endif // defined(OS_LINUX) && !defined(OS_ANDROID)
#endif // (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) &&
// !defined(OS_ANDROID)
#endif // defined(OS_WIN)
#endif // !defined(OS_MAC)
}
......
......@@ -31,6 +31,7 @@
#include "third_party/blink/renderer/core/scroll/scrollbar_theme_aura.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/input/scrollbar.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/platform/platform.h"
......@@ -137,7 +138,9 @@ bool ScrollbarThemeAura::SupportsDragSnapBack() const {
// Disable snapback on desktop Linux to better integrate with the desktop
// behavior. Typically, Linux apps do not implement scrollbar snapback (this
// is true for at least GTK and QT apps).
#if defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
return false;
#else
return true;
......@@ -303,7 +306,9 @@ ScrollbarPart ScrollbarThemeAura::PartsToInvalidateOnThumbPositionChange(
bool ScrollbarThemeAura::ShouldCenterOnThumb(const Scrollbar& scrollbar,
const WebMouseEvent& event) {
#if defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
if (event.button == WebPointerProperties::Button::kMiddle)
return true;
#endif
......
......@@ -166,7 +166,10 @@ blink_modules_sources("webgl") {
configs += [ "//third_party/blink/renderer/core:blink_core_pch" ]
public_deps = [ "//device/vr/public/mojom:vr_service_blink" ]
deps = [ "//third_party/blink/renderer/modules/xr:xr" ]
deps = [
"//build:chromeos_buildflags",
"//third_party/blink/renderer/modules/xr:xr"
]
deps += [ "//third_party/blink/renderer/modules/webcodecs:webcodecs" ]
allow_circular_includes_from = deps
}
......@@ -5,6 +5,7 @@
#include "third_party/blink/renderer/modules/webgl/webgl_webcodecs_video_frame.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "media/base/wait_and_replace_sync_token_client.h"
#include "media/video/gpu_memory_buffer_video_frame_pool.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_video_color_space.h"
......@@ -26,7 +27,7 @@ namespace {
const char kRequiredExtension[] = "GL_NV_EGL_stream_consumer_external";
#elif defined(OS_MAC)
const char kRequiredExtension[] = "GL_ANGLE_texture_rectangle";
#elif defined(OS_ANDROID) || defined(OS_CHROMEOS)
#elif defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
const char kRequiredExtension[] = "GL_OES_EGL_image_external";
#else
const char kRequiredExtension[] = "";
......@@ -216,7 +217,7 @@ WebGLWebCodecsVideoFrame::WebGLWebCodecsVideoFrame(
auto& components_nv12 = format_to_components_map_[media::PIXEL_FORMAT_NV12];
components_nv12[media::VideoFrame::kYPlane] = "r";
components_nv12[media::VideoFrame::kUPlane] = "rg";
#elif defined(OS_CHROMEOS)
#elif BUILDFLAG(IS_CHROMEOS_ASH)
formats_supported[media::PIXEL_FORMAT_ABGR] = true;
auto& components_abgr = format_to_components_map_[media::PIXEL_FORMAT_ABGR];
components_abgr[media::VideoFrame::kYPlane] = "rgb";
......@@ -235,7 +236,9 @@ WebGLExtensionName WebGLWebCodecsVideoFrame::GetName() const {
}
bool WebGLWebCodecsVideoFrame::Supported(WebGLRenderingContextBase* context) {
#if defined(OS_LINUX) || defined(OS_FUCHSIA)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_FUCHSIA)
// TODO(jie.a.chen@intel.com): Add Linux support.
return false;
#else
......@@ -270,7 +273,7 @@ WebGLWebCodecsVideoFrameHandle* WebGLWebCodecsVideoFrame::importVideoFrame(
sampler_type = "sampler2DRect";
sampler_func = "texture2DRect";
pixel_format = media::PIXEL_FORMAT_XRGB;
#elif defined(OS_ANDROID) || defined(OS_CHROMEOS)
#elif defined(OS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH)
sampler_type = "samplerExternalOES";
pixel_format = media::PIXEL_FORMAT_ABGR;
src_color_space = gfx::ColorSpace::CreateSRGB();
......
......@@ -213,6 +213,7 @@ component("wtf") {
deps = [
":buildflags",
"//build:chromeos_buildflags",
# TODO(tkent): WTF should not depend on it.
"//third_party/blink/public/common:headers",
......
......@@ -6,6 +6,7 @@
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_CONTAINER_ANNOTATIONS_H_
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "third_party/blink/renderer/platform/wtf/sanitizers.h"
// TODO(ochang): Remove the ARCH_CPU_X86_64 condition to enable this for X86
......@@ -36,13 +37,15 @@
ANNOTATE_NEW_BUFFER(buffer, newCapacity, bufferSize);
// Annotations require buffers to begin on an 8-byte boundary.
#else // ADDRESS_SANITIZER && (OS_LINUX || OS_CHROMEOS) && ARCH_CPU_X86_64
#else // ADDRESS_SANITIZER && (OS_LINUX || IS_CHROMEOS_ASH) &&
// ARCH_CPU_X86_64
#define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize)
#define ANNOTATE_DELETE_BUFFER(buffer, capacity, oldSize)
#define ANNOTATE_CHANGE_SIZE(buffer, capacity, oldSize, newSize)
#define ANNOTATE_CHANGE_CAPACITY(buffer, oldCapacity, bufferSize, newCapacity)
#endif // ADDRESS_SANITIZER && (OS_LINUX || OS_CHROMEOS) && ARCH_CPU_X86_64
#endif // ADDRESS_SANITIZER && (OS_LINUX || IS_CHROMEOS_ASH) &&
// ARCH_CPU_X86_64
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_CONTAINER_ANNOTATIONS_H_
......@@ -379,7 +379,7 @@ crashpad_static_library("util") {
]
}
deps = []
deps = [ "//build:chromeos_buildflags" ]
if (crashpad_is_linux || crashpad_is_fuchsia || crashpad_is_android) {
sources += [ "net/http_transport_socket.cc" ]
......
......@@ -24,14 +24,19 @@
#include "base/numerics/safe_math.h"
#include "base/process/process_metrics.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#if defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "third_party/lss/lss.h"
#endif
namespace {
#if defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
void* CallMmap(void* addr,
size_t len,
int prot,
......
......@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/linux/pkg_config.gni")
assert(is_linux || is_chromeos)
......@@ -11,7 +12,7 @@ declare_args() {
# Controls whether the build should use the version of minigbm library shipped
# with the system. In release builds of desktop Linux and Chrome OS we use the
# system version.
use_system_minigbm = is_linux && !is_chromecast
use_system_minigbm = (is_linux || is_chromeos_lacros) && !is_chromecast
use_amdgpu_minigbm = false
use_exynos_minigbm = false
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
generate_grd("build_grdp") {
......@@ -76,7 +77,7 @@ generate_grd("build_grdp") {
"polymer2/polymer.html",
]
if (is_chromeos) {
if (is_chromeos_ash) {
input_files += [
"html-imports/html-imports.min.js",
"iron-dropdown/iron-dropdown-extracted.js",
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
generate_grd("build_grdp") {
......@@ -49,7 +50,7 @@ generate_grd("build_grdp") {
"polymer/polymer_bundled.min.js",
]
if (is_chromeos) {
if (is_chromeos_ash) {
input_files += [
"iron-dropdown/iron-dropdown.js",
"iron-dropdown/iron-dropdown-scroll-manager.js",
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/sanitizers/sanitizers.gni")
config("tflite_config") {
......@@ -33,7 +34,7 @@ config("tflite_flags") {
defines += [ "TFLITE_WITH_RUY" ]
}
if (is_linux) {
if (is_linux || is_chromeos_lacros) {
defines += [ "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK" ]
}
}
......
......@@ -5,6 +5,7 @@
import("//build/buildflag_header.gni")
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//media/cdm/library_cdm/cdm_paths.gni")
import("//media/media_options.gni")
......@@ -35,7 +36,7 @@ if (bundle_widevine_cdm) {
widevine_cdm_version_h_file =
"chromeos/$widevine_arch/widevine_cdm_version.h"
widevine_cdm_binary_files = [ "chromeos/$widevine_arch/libwidevinecdm.so" ]
} else if (is_linux) {
} else if (is_linux || is_chromeos_lacros) {
widevine_cdm_version_h_file = "linux/$widevine_arch/widevine_cdm_version.h"
widevine_cdm_binary_files = [ "linux/$widevine_arch/libwidevinecdm.so" ]
widevine_cdm_manifest_and_license_files = [
......
......@@ -4,6 +4,7 @@
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//media/media_options.gni")
declare_args() {
......@@ -23,8 +24,9 @@ if (is_chromeos_ash && !is_chromeos_device) {
# architectures. Notably on Android library CDM is not used and Widevine is
# supported via Android MediaDrm API.
library_widevine_cdm_available =
(is_chromeos && (target_cpu == "x64" || target_cpu == "arm")) ||
(is_linux && (target_cpu == "x86" || target_cpu == "x64")) ||
(is_chromeos_ash && (target_cpu == "x64" || target_cpu == "arm")) ||
((is_linux || is_chromeos_lacros) &&
(target_cpu == "x86" || target_cpu == "x64")) ||
(is_mac && (target_cpu == "x64" || target_cpu == "arm64")) ||
(is_win && (target_cpu == "x86" || target_cpu == "x64"))
......@@ -39,7 +41,8 @@ enable_library_widevine_cdm =
# it's a component. See below.
# Note: Not enabled on ChromeOS. See https://crbug.com/971433
enable_widevine_cdm_component =
enable_library_widevine_cdm && (is_win || is_mac || is_linux)
enable_library_widevine_cdm &&
(is_win || is_mac || is_linux || is_chromeos_lacros)
# Widevine CDM is bundled as part of Google Chrome builds.
bundle_widevine_cdm = enable_library_widevine_cdm && is_chrome_branded
......
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