Commit ecf5d675 authored by Sean McAllister's avatar Sean McAllister Committed by Commit Bot

Refactor OS_LINUX preprocessor directive for LaCrOS effort.

Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS.  We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.

This is changes for /content

This CL was uploaded by git cl split.

R=jam@chromium.org

Bug: 1110266
Change-Id: I0c8a97e7a0014daab6528182f81072d71f0ee737
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2370296Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801194}
parent 19767e5c
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#if defined(OS_MAC) #if defined(OS_MAC)
#include "content/child/child_process_sandbox_support_impl_mac.h" #include "content/child/child_process_sandbox_support_impl_mac.h"
#elif defined(OS_LINUX) #elif defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "content/child/child_process_sandbox_support_impl_linux.h" #include "content/child/child_process_sandbox_support_impl_linux.h"
#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h"
#endif #endif
...@@ -34,7 +34,7 @@ typedef struct CGFont* CGFontRef; ...@@ -34,7 +34,7 @@ typedef struct CGFont* CGFontRef;
namespace content { namespace content {
PpapiBlinkPlatformImpl::PpapiBlinkPlatformImpl() { PpapiBlinkPlatformImpl::PpapiBlinkPlatformImpl() {
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
mojo::PendingRemote<font_service::mojom::FontService> font_service; mojo::PendingRemote<font_service::mojom::FontService> font_service;
ChildThread::Get()->BindHostReceiver( ChildThread::Get()->BindHostReceiver(
font_service.InitWithNewPipeAndPassReceiver()); font_service.InitWithNewPipeAndPassReceiver());
...@@ -52,7 +52,7 @@ PpapiBlinkPlatformImpl::~PpapiBlinkPlatformImpl() { ...@@ -52,7 +52,7 @@ PpapiBlinkPlatformImpl::~PpapiBlinkPlatformImpl() {
void PpapiBlinkPlatformImpl::Shutdown() {} void PpapiBlinkPlatformImpl::Shutdown() {}
blink::WebSandboxSupport* PpapiBlinkPlatformImpl::GetSandboxSupport() { blink::WebSandboxSupport* PpapiBlinkPlatformImpl::GetSandboxSupport() {
#if defined(OS_LINUX) || defined(OS_MAC) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC)
return sandbox_support_.get(); return sandbox_support_.get();
#else #else
return nullptr; return nullptr;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "content/child/blink_platform_impl.h" #include "content/child/blink_platform_impl.h"
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "components/services/font/public/cpp/font_loader.h" #include "components/services/font/public/cpp/font_loader.h"
#include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/core/SkRefCnt.h"
#endif #endif
...@@ -36,11 +36,11 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl { ...@@ -36,11 +36,11 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl {
blink::WebThemeEngine* ThemeEngine() override; blink::WebThemeEngine* ThemeEngine() override;
private: private:
#if defined(OS_LINUX) || defined(OS_MAC) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC)
std::unique_ptr<blink::WebSandboxSupport> sandbox_support_; std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
sk_sp<font_service::FontLoader> font_loader_; sk_sp<font_service::FontLoader> font_loader_;
#endif #endif
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "content/public/common/sandbox_init.h" #include "content/public/common/sandbox_init.h"
#include "sandbox/policy/linux/sandbox_linux.h" #include "sandbox/policy/linux/sandbox_linux.h"
#endif #endif
...@@ -120,7 +120,7 @@ int PpapiPluginMain(const MainFunctionParams& parameters) { ...@@ -120,7 +120,7 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
gin::V8Initializer::LoadV8Snapshot(); gin::V8Initializer::LoadV8Snapshot();
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox( sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox(
sandbox::policy::SandboxTypeFromCommandLine(command_line), sandbox::policy::SandboxTypeFromCommandLine(command_line),
sandbox::policy::SandboxLinux::PreSandboxHook(), sandbox::policy::SandboxLinux::PreSandboxHook(),
......
...@@ -80,7 +80,7 @@ class CONTENT_EXPORT ChildProcessHost : public IPC::Sender { ...@@ -80,7 +80,7 @@ class CONTENT_EXPORT ChildProcessHost : public IPC::Sender {
// No special behavior requested. // No special behavior requested.
CHILD_NORMAL = 0, CHILD_NORMAL = 0,
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
// Indicates that the child execed after forking may be execced from // Indicates that the child execed after forking may be execced from
// /proc/self/exe rather than using the "real" app path. This prevents // /proc/self/exe rather than using the "real" app path. This prevents
// autoupdate from confusing us if it changes the file out from under us. // autoupdate from confusing us if it changes the file out from under us.
......
...@@ -46,7 +46,7 @@ const int kDefaultDetachableCancelDelayMs = 30000; ...@@ -46,7 +46,7 @@ const int kDefaultDetachableCancelDelayMs = 30000;
const char kCorsExemptPurposeHeaderName[] = "Purpose"; const char kCorsExemptPurposeHeaderName[] = "Purpose";
const char kCorsExemptRequestedWithHeaderName[] = "X-Requested-With"; const char kCorsExemptRequestedWithHeaderName[] = "X-Requested-With";
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
const int kLowestRendererOomScore = 300; const int kLowestRendererOomScore = 300;
const int kHighestRendererOomScore = 1000; const int kHighestRendererOomScore = 1000;
......
...@@ -65,7 +65,7 @@ CONTENT_EXPORT extern const int kDefaultDetachableCancelDelayMs; ...@@ -65,7 +65,7 @@ CONTENT_EXPORT extern const int kDefaultDetachableCancelDelayMs;
CONTENT_EXPORT extern const char kCorsExemptPurposeHeaderName[]; CONTENT_EXPORT extern const char kCorsExemptPurposeHeaderName[];
CONTENT_EXPORT extern const char kCorsExemptRequestedWithHeaderName[]; CONTENT_EXPORT extern const char kCorsExemptRequestedWithHeaderName[];
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
// The OOM score adj constants // The OOM score adj constants
// The highest and lowest assigned OOM score adjustment (oom_score_adj) for // The highest and lowest assigned OOM score adjustment (oom_score_adj) for
// renderers and extensions used by the OomPriority Manager. // renderers and extensions used by the OomPriority Manager.
......
...@@ -761,7 +761,8 @@ const base::Feature kWebAssemblyThreads { ...@@ -761,7 +761,8 @@ const base::Feature kWebAssemblyThreads {
}; };
// Enable WebAssembly trap handler. // Enable WebAssembly trap handler.
#if (defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC)) && \ #if (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || \
defined(OS_MAC)) && \
defined(ARCH_CPU_X86_64) defined(ARCH_CPU_X86_64)
const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler", const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
......
...@@ -25,7 +25,7 @@ const base::Feature kUseZoomForDsfEnabledByDefault{ ...@@ -25,7 +25,7 @@ const base::Feature kUseZoomForDsfEnabledByDefault{
#endif #endif
bool IsUseZoomForDSFEnabledByDefault() { bool IsUseZoomForDSFEnabledByDefault() {
#if defined(OS_LINUX) || defined(OS_FUCHSIA) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_FUCHSIA)
return true; return true;
#elif defined(OS_WIN) || defined(OS_ANDROID) #elif defined(OS_WIN) || defined(OS_ANDROID)
return base::FeatureList::IsEnabled(kUseZoomForDsfEnabledByDefault); return base::FeatureList::IsEnabled(kUseZoomForDsfEnabledByDefault);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#if defined(OS_MAC) #if defined(OS_MAC)
#include "content/child/child_process_sandbox_support_impl_mac.h" #include "content/child/child_process_sandbox_support_impl_mac.h"
#elif defined(OS_LINUX) #elif defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "content/child/child_process_sandbox_support_impl_linux.h" #include "content/child/child_process_sandbox_support_impl_linux.h"
#endif #endif
...@@ -17,7 +17,7 @@ namespace content { ...@@ -17,7 +17,7 @@ namespace content {
UtilityBlinkPlatformWithSandboxSupportImpl:: UtilityBlinkPlatformWithSandboxSupportImpl::
UtilityBlinkPlatformWithSandboxSupportImpl() { UtilityBlinkPlatformWithSandboxSupportImpl() {
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
mojo::PendingRemote<font_service::mojom::FontService> font_service; mojo::PendingRemote<font_service::mojom::FontService> font_service;
UtilityThread::Get()->BindHostReceiver( UtilityThread::Get()->BindHostReceiver(
font_service.InitWithNewPipeAndPassReceiver()); font_service.InitWithNewPipeAndPassReceiver());
...@@ -34,7 +34,7 @@ UtilityBlinkPlatformWithSandboxSupportImpl:: ...@@ -34,7 +34,7 @@ UtilityBlinkPlatformWithSandboxSupportImpl::
blink::WebSandboxSupport* blink::WebSandboxSupport*
UtilityBlinkPlatformWithSandboxSupportImpl::GetSandboxSupport() { UtilityBlinkPlatformWithSandboxSupportImpl::GetSandboxSupport() {
#if defined(OS_LINUX) || defined(OS_MAC) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC)
return sandbox_support_.get(); return sandbox_support_.get();
#else #else
return nullptr; return nullptr;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "components/services/font/public/cpp/font_loader.h" // nogncheck #include "components/services/font/public/cpp/font_loader.h" // nogncheck
#include "third_party/skia/include/core/SkRefCnt.h" // nogncheck #include "third_party/skia/include/core/SkRefCnt.h" // nogncheck
#endif #endif
...@@ -33,10 +33,10 @@ class UtilityBlinkPlatformWithSandboxSupportImpl : public blink::Platform { ...@@ -33,10 +33,10 @@ class UtilityBlinkPlatformWithSandboxSupportImpl : public blink::Platform {
blink::WebSandboxSupport* GetSandboxSupport() override; blink::WebSandboxSupport* GetSandboxSupport() override;
private: private:
#if defined(OS_LINUX) || defined(OS_MAC) #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC)
std::unique_ptr<blink::WebSandboxSupport> sandbox_support_; std::unique_ptr<blink::WebSandboxSupport> sandbox_support_;
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
sk_sp<font_service::FontLoader> font_loader_; sk_sp<font_service::FontLoader> font_loader_;
#endif #endif
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "sandbox/policy/sandbox.h" #include "sandbox/policy/sandbox.h"
#include "services/tracing/public/cpp/trace_startup.h" #include "services/tracing/public/cpp/trace_startup.h"
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "content/utility/speech/speech_recognition_sandbox_hook_linux.h" #include "content/utility/speech/speech_recognition_sandbox_hook_linux.h"
#include "sandbox/policy/linux/sandbox_linux.h" #include "sandbox/policy/linux/sandbox_linux.h"
#include "services/audio/audio_sandbox_hook_linux.h" #include "services/audio/audio_sandbox_hook_linux.h"
...@@ -82,7 +82,7 @@ int UtilityMain(const MainFunctionParams& parameters) { ...@@ -82,7 +82,7 @@ int UtilityMain(const MainFunctionParams& parameters) {
if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog)) if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog))
WaitForDebugger("Utility"); WaitForDebugger("Utility");
#if defined(OS_LINUX) #if defined(OS_LINUX) || defined(OS_CHROMEOS)
// Initializes the sandbox before any threads are created. // Initializes the sandbox before any threads are created.
// TODO(jorgelo): move this after GTK initialization when we enable a strict // TODO(jorgelo): move this after GTK initialization when we enable a strict
// Seccomp-BPF policy. // Seccomp-BPF policy.
......
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