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