Commit aef12ccf 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: Ibe63a58f20c536f639c7d5af640df4f37ce460c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494280
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatarEric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828629}
parent 3c229a60
...@@ -403,6 +403,7 @@ component("headless_non_renderer") { ...@@ -403,6 +403,7 @@ component("headless_non_renderer") {
":headless_shared_sources", ":headless_shared_sources",
":version_header", ":version_header",
"//base:base_static", "//base:base_static",
"//build:chromeos_buildflags",
"//components/cookie_config", "//components/cookie_config",
"//components/security_state/core", "//components/security_state/core",
"//content/public/common", "//content/public/common",
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
#include "headless/lib/browser/headless_browser_main_parts.h" #include "headless/lib/browser/headless_browser_main_parts.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h" #include "device/bluetooth/dbus/bluez_dbus_manager.h"
namespace headless { namespace headless {
void HeadlessBrowserMainParts::PostMainMessageLoopStart() { void HeadlessBrowserMainParts::PostMainMessageLoopStart() {
#if defined(USE_DBUS) && !defined(OS_CHROMEOS) #if defined(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS_ASH)
bluez::BluezDBusManager::Initialize(/*system_bus=*/nullptr); bluez::BluezDBusManager::Initialize(/*system_bus=*/nullptr);
#endif #endif
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/network_service_instance.h" #include "content/public/browser/network_service_instance.h"
#include "content/public/browser/resource_context.h" #include "content/public/browser/resource_context.h"
...@@ -26,7 +27,9 @@ namespace headless { ...@@ -26,7 +27,9 @@ namespace headless {
namespace { namespace {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
constexpr char kProductName[] = "HeadlessChrome"; constexpr char kProductName[] = "HeadlessChrome";
#endif #endif
...@@ -56,7 +59,9 @@ net::NetworkTrafficAnnotationTag GetProxyConfigTrafficAnnotationTag() { ...@@ -56,7 +59,9 @@ net::NetworkTrafficAnnotationTag GetProxyConfigTrafficAnnotationTag() {
return traffic_annotation; return traffic_annotation;
} }
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
::network::mojom::CryptConfigPtr BuildCryptConfigOnce( ::network::mojom::CryptConfigPtr BuildCryptConfigOnce(
const base::FilePath& user_data_path) { const base::FilePath& user_data_path) {
static bool done_once = false; static bool done_once = false;
...@@ -218,7 +223,9 @@ HeadlessRequestContextManager::HeadlessRequestContextManager( ...@@ -218,7 +223,9 @@ HeadlessRequestContextManager::HeadlessRequestContextManager(
base::ThreadTaskRunnerHandle::Get()); base::ThreadTaskRunnerHandle::Get());
} }
} }
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
auto crypt_config = BuildCryptConfigOnce(user_data_path_); auto crypt_config = BuildCryptConfigOnce(user_data_path_);
if (crypt_config) if (crypt_config)
content::GetNetworkService()->SetCryptConfig(std::move(crypt_config)); content::GetNetworkService()->SetCryptConfig(std::move(crypt_config));
......
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