Commit 173c7d61 authored by Yuta Hijikata's avatar Yuta Hijikata Committed by Commit Bot

LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)

The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with is_ash
with some special cases (For those cases please refer to
http://go/lacros-macros).

The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.

Bug: 1052397
Change-Id: I34cfe1a8d474a2b146138ce2502c4cb1875c37cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494194Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825694}
parent 4736c3de
...@@ -417,6 +417,7 @@ cc_component("cc") { ...@@ -417,6 +417,7 @@ cc_component("cc") {
deps = [ deps = [
"//base", "//base",
"//base/third_party/dynamic_annotations", "//base/third_party/dynamic_annotations",
"//build:chromeos_buildflags",
"//components/viz/client", "//components/viz/client",
"//device/base/synchronization", "//device/base/synchronization",
"//gpu", "//gpu",
...@@ -800,6 +801,7 @@ cc_test("cc_unittests") { ...@@ -800,6 +801,7 @@ cc_test("cc_unittests") {
":cc", ":cc",
":test_support", ":test_support",
"//base/test:test_support", "//base/test:test_support",
"//build:chromeos_buildflags",
"//cc/mojo_embedder", "//cc/mojo_embedder",
"//cc/paint", "//cc/paint",
"//components/ukm:test_support", "//components/ukm:test_support",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/trace_event/process_memory_dump.h" #include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/chromeos_buildflags.h"
#include "cc/base/histograms.h" #include "cc/base/histograms.h"
#include "cc/paint/display_item_list.h" #include "cc/paint/display_item_list.h"
#include "cc/paint/paint_canvas.h" #include "cc/paint/paint_canvas.h"
...@@ -310,7 +311,7 @@ GpuRasterBufferProvider::RasterBufferImpl::RasterBufferImpl( ...@@ -310,7 +311,7 @@ GpuRasterBufferProvider::RasterBufferImpl::RasterBufferImpl(
texture_target_(backing->texture_target), texture_target_(backing->texture_target),
texture_is_overlay_candidate_(backing->overlay_candidate), texture_is_overlay_candidate_(backing->overlay_candidate),
mailbox_(backing->mailbox) { mailbox_(backing->mailbox) {
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Only do this in Chrome OS with OOP-R because: // Only do this in Chrome OS with OOP-R because:
// 1) We will use this timestamp to measure raster scheduling delay and we // 1) We will use this timestamp to measure raster scheduling delay and we
// only need to collect that data to assess the impact of hardware // only need to collect that data to assess the impact of hardware
...@@ -554,7 +555,7 @@ gpu::SyncToken GpuRasterBufferProvider::PlaybackOnWorkerThreadInternal( ...@@ -554,7 +555,7 @@ gpu::SyncToken GpuRasterBufferProvider::PlaybackOnWorkerThreadInternal(
<< "Why are we rastering a tile that's not dirty?"; << "Why are we rastering a tile that's not dirty?";
if (measure_raster_metric) { if (measure_raster_metric) {
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
// Use a query to detect when the GPU side is ready to start issuing raster // Use a query to detect when the GPU side is ready to start issuing raster
// work to the driver. We will use the resulting timestamp to measure raster // work to the driver. We will use the resulting timestamp to measure raster
// scheduling delay. We only care about this in Chrome OS and when OOP-R is // scheduling delay. We only care about this in Chrome OS and when OOP-R is
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/trace_event/process_memory_dump.h" #include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/base/histograms.h" #include "cc/base/histograms.h"
#include "cc/base/math_util.h" #include "cc/base/math_util.h"
#include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/gpu/context_provider.h"
...@@ -423,7 +425,7 @@ gpu::SyncToken OneCopyRasterBufferProvider::CopyOnWorkerThread( ...@@ -423,7 +425,7 @@ gpu::SyncToken OneCopyRasterBufferProvider::CopyOnWorkerThread(
query_target = GL_COMMANDS_COMPLETED_CHROMIUM; query_target = GL_COMMANDS_COMPLETED_CHROMIUM;
} }
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) #if BUILDFLAG(IS_CHROMEOS_ASH) && defined(ARCH_CPU_ARM_FAMILY)
// TODO(reveman): This avoids a performance problem on ARM ChromeOS devices. // TODO(reveman): This avoids a performance problem on ARM ChromeOS devices.
// https://crbug.com/580166 // https://crbug.com/580166
query_target = GL_COMMANDS_ISSUED_CHROMIUM; query_target = GL_COMMANDS_ISSUED_CHROMIUM;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/base/unique_notifier.h" #include "cc/base/unique_notifier.h"
#include "cc/paint/draw_image.h" #include "cc/paint/draw_image.h"
#include "cc/raster/bitmap_raster_buffer_provider.h" #include "cc/raster/bitmap_raster_buffer_provider.h"
...@@ -663,7 +664,7 @@ TEST_P(RasterBufferProviderTest, MeasureGpuRasterDuration) { ...@@ -663,7 +664,7 @@ TEST_P(RasterBufferProviderTest, MeasureGpuRasterDuration) {
base::HistogramBase::Count expected_delay_histogram_all_tiles_count = 0; base::HistogramBase::Count expected_delay_histogram_all_tiles_count = 0;
base::HistogramBase::Count expected_delay_histogram_jpeg_tiles_count = 0; base::HistogramBase::Count expected_delay_histogram_jpeg_tiles_count = 0;
base::HistogramBase::Count expected_delay_histogram_webp_tiles_count = 0; base::HistogramBase::Count expected_delay_histogram_webp_tiles_count = 0;
#if defined(OS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS_ASH)
if (GetParam() == RASTER_BUFFER_PROVIDER_TYPE_GPU_OOPR) { if (GetParam() == RASTER_BUFFER_PROVIDER_TYPE_GPU_OOPR) {
expected_delay_histogram_all_tiles_count = 5; expected_delay_histogram_all_tiles_count = 5;
expected_delay_histogram_jpeg_tiles_count = 3; expected_delay_histogram_jpeg_tiles_count = 3;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <stddef.h> #include <stddef.h>
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/layers/content_layer_client.h" #include "cc/layers/content_layer_client.h"
#include "cc/layers/picture_layer.h" #include "cc/layers/picture_layer.h"
#include "cc/paint/display_item_list.h" #include "cc/paint/display_item_list.h"
...@@ -239,7 +240,7 @@ INSTANTIATE_TEST_SUITE_P(All, ...@@ -239,7 +240,7 @@ INSTANTIATE_TEST_SUITE_P(All,
::testing::ValuesIn(kTestCases), ::testing::ValuesIn(kTestCases),
::testing::PrintToStringParamName()); ::testing::PrintToStringParamName());
#if defined(OS_CHROMEOS) || defined(MEMORY_SANITIZER) || \ #if BUILDFLAG(IS_CHROMEOS_ASH) || defined(MEMORY_SANITIZER) || \
defined(ADDRESS_SANITIZER) || defined(OS_FUCHSIA) defined(ADDRESS_SANITIZER) || defined(OS_FUCHSIA)
// TODO(crbug.com/1045521): Flakes on all slower bots. // TODO(crbug.com/1045521): Flakes on all slower bots.
#define MAYBE_PartialRaster DISABLED_PartialRaster #define MAYBE_PartialRaster DISABLED_PartialRaster
...@@ -286,7 +287,7 @@ INSTANTIATE_TEST_SUITE_P(All, ...@@ -286,7 +287,7 @@ INSTANTIATE_TEST_SUITE_P(All,
#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(THREAD_SANITIZER) #if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(THREAD_SANITIZER)
// Flaky on Linux TSAN. https://crbug.com/707711 // Flaky on Linux TSAN. https://crbug.com/707711
#define MAYBE_PartialRaster DISABLED_PartialRaster #define MAYBE_PartialRaster DISABLED_PartialRaster
#elif defined(OS_CHROMEOS) || defined(MEMORY_SANITIZER) || \ #elif BUILDFLAG(IS_CHROMEOS_ASH) || defined(MEMORY_SANITIZER) || \
defined(ADDRESS_SANITIZER) || defined(OS_FUCHSIA) defined(ADDRESS_SANITIZER) || defined(OS_FUCHSIA)
// TODO(crbug.com/1045521): Flakes on all slower bots. // TODO(crbug.com/1045521): Flakes on all slower bots.
#define MAYBE_PartialRaster DISABLED_PartialRaster #define MAYBE_PartialRaster DISABLED_PartialRaster
......
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