Commit feac87df 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 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.

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

Bug: 1052397
Change-Id: Ia047bcc761acac4773b8d62930771e89cb6d8c09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628870
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843948}
parent b7af27f9
......@@ -363,6 +363,7 @@ source_set("weblayer_lib_base") {
"//base",
"//base:base_static",
"//base/third_party/dynamic_annotations",
"//build:chromeos_buildflags",
"//cc",
"//components/autofill/content/browser",
"//components/autofill/content/renderer",
......
......@@ -14,6 +14,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/startup_metric_utils/browser/startup_metric_utils.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_features.h"
......@@ -218,7 +219,11 @@ bool ContentMainDelegateImpl::ShouldCreateFeatureList() {
}
void ContentMainDelegateImpl::PreSandboxStartup() {
#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(ARCH_CPU_ARM_FAMILY) && \
(defined(OS_ANDROID) || defined(OS_LINUX) || \
BUILDFLAG(IS_CHROMEOS_LACROS))
// Create an instance of the CPU class to parse /proc/cpuinfo and cache
// cpu_brand info.
base::CPU cpu_info;
......
......@@ -12,6 +12,7 @@
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/base/switches.h"
#include "components/captive_portal/core/buildflags.h"
#include "components/prefs/pref_service.h"
......@@ -69,7 +70,9 @@
#include "ui/base/ui_base_features.h"
#include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck
#endif
#if defined(USE_AURA) && defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#include "ui/base/ime/init/input_method_initializer.h"
#endif
......@@ -184,7 +187,9 @@ void BrowserMainPartsImpl::PreMainMessageLoopStart() {
int BrowserMainPartsImpl::PreEarlyInitialization() {
browser_process_ = std::make_unique<BrowserProcess>(std::move(local_state_));
#if defined(USE_AURA) && defined(OS_LINUX)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
ui::InitializeInputMethodForTesting();
#endif
#if defined(OS_ANDROID)
......
......@@ -16,6 +16,7 @@
#include "base/strings/string_piece.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/autofill/content/browser/content_autofill_driver_factory.h"
#include "components/blocked_content/popup_blocker.h"
#include "components/captive_portal/core/buildflags.h"
......@@ -135,7 +136,9 @@
#include "weblayer/browser/weblayer_factory_impl_android.h"
#endif
#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)
#include "content/public/common/content_descriptors.h"
#endif
......@@ -387,7 +390,9 @@ void ContentBrowserClientImpl::ConfigureNetworkContextParams(
void ContentBrowserClientImpl::OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) {
#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)
network::mojom::CryptConfigPtr config = network::mojom::CryptConfig::New();
content::GetNetworkService()->SetCryptConfig(std::move(config));
#endif
......@@ -847,7 +852,9 @@ SafeBrowsingService* ContentBrowserClientImpl::GetSafeBrowsingService() {
}
#endif
#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)
void ContentBrowserClientImpl::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
......
......@@ -12,6 +12,7 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/content_browser_client.h"
#include "services/service_manager/public/cpp/binder_registry.h"
......@@ -116,12 +117,15 @@ class ContentBrowserClientImpl : public content::ContentBrowserClient {
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
scoped_refptr<content::QuotaPermissionContext> CreateQuotaPermissionContext()
override;
#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)
void GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
content::PosixFileDescriptorInfo* mappings) override;
#endif // defined(OS_LINUX) || defined(OS_ANDROID)
#endif // defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ||
// defined(OS_ANDROID)
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
#if defined(OS_ANDROID)
......
......@@ -5,6 +5,7 @@
#include "weblayer/browser/system_network_context_manager.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/variations/net/variations_http_headers.h"
#include "content/public/browser/network_service_instance.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
......@@ -64,10 +65,13 @@ void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(
network::mojom::NetworkContextParams* network_context_params,
const std::string& user_agent) {
network_context_params->user_agent = user_agent;
#if defined(OS_LINUX) || defined(OS_WIN)
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is
// complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || defined(OS_WIN)
// We're not configuring the cookie encryption on these platforms yet.
network_context_params->enable_encrypted_cookies = false;
#endif // defined(OS_LINUX) || defined(OS_WIN)
#endif // (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) ||
// defined(OS_WIN)
}
SystemNetworkContextManager::SystemNetworkContextManager(
......
......@@ -9,6 +9,7 @@
#include "base/path_service.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#if defined(OS_ANDROID)
#include "base/android/path_utils.h"
......@@ -17,7 +18,7 @@
#if defined(OS_WIN)
#include "base/base_paths_win.h"
#elif defined(OS_LINUX)
#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "base/nix/xdg_util.h"
#endif
......@@ -35,7 +36,7 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) {
return false;
*result = result->AppendASCII("weblayer");
return true;
#elif defined(OS_LINUX)
#elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
std::unique_ptr<base::Environment> env(base::Environment::Create());
base::FilePath config_dir(base::nix::GetXDGDirectory(
env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir));
......
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