0

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/+/2370296
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801194}
This commit is contained in:
Sean McAllister
2020-08-24 23:36:29 +00:00
committed by Commit Bot
parent 19767e5c6b
commit ecf5d67514
11 changed files with 22 additions and 21 deletions

@ -19,7 +19,7 @@
#if defined(OS_MAC)
#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 "mojo/public/cpp/bindings/pending_remote.h"
#endif
@ -34,7 +34,7 @@ typedef struct CGFont* CGFontRef;
namespace content {
PpapiBlinkPlatformImpl::PpapiBlinkPlatformImpl() {
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
mojo::PendingRemote<font_service::mojom::FontService> font_service;
ChildThread::Get()->BindHostReceiver(
font_service.InitWithNewPipeAndPassReceiver());
@ -52,7 +52,7 @@ PpapiBlinkPlatformImpl::~PpapiBlinkPlatformImpl() {
void PpapiBlinkPlatformImpl::Shutdown() {}
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();
#else
return nullptr;

@ -13,7 +13,7 @@
#include "build/build_config.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 "third_party/skia/include/core/SkRefCnt.h"
#endif
@ -36,11 +36,11 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl {
blink::WebThemeEngine* ThemeEngine() override;
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_;
#endif
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
sk_sp<font_service::FontLoader> font_loader_;
#endif

@ -42,7 +42,7 @@
#include "base/files/file_util.h"
#endif
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#include "content/public/common/sandbox_init.h"
#include "sandbox/policy/linux/sandbox_linux.h"
#endif
@ -120,7 +120,7 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
gin::V8Initializer::LoadV8Snapshot();
#endif
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
sandbox::policy::SandboxLinux::GetInstance()->InitializeSandbox(
sandbox::policy::SandboxTypeFromCommandLine(command_line),
sandbox::policy::SandboxLinux::PreSandboxHook(),

@ -80,7 +80,7 @@ class CONTENT_EXPORT ChildProcessHost : public IPC::Sender {
// No special behavior requested.
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
// /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.

@ -46,7 +46,7 @@ const int kDefaultDetachableCancelDelayMs = 30000;
const char kCorsExemptPurposeHeaderName[] = "Purpose";
const char kCorsExemptRequestedWithHeaderName[] = "X-Requested-With";
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
const int kLowestRendererOomScore = 300;
const int kHighestRendererOomScore = 1000;

@ -65,7 +65,7 @@ CONTENT_EXPORT extern const int kDefaultDetachableCancelDelayMs;
CONTENT_EXPORT extern const char kCorsExemptPurposeHeaderName[];
CONTENT_EXPORT extern const char kCorsExemptRequestedWithHeaderName[];
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
// The OOM score adj constants
// The highest and lowest assigned OOM score adjustment (oom_score_adj) for
// renderers and extensions used by the OomPriority Manager.

@ -761,7 +761,8 @@ const base::Feature kWebAssemblyThreads {
};
// 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)
const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
base::FEATURE_ENABLED_BY_DEFAULT};

@ -25,7 +25,7 @@ const base::Feature kUseZoomForDsfEnabledByDefault{
#endif
bool IsUseZoomForDSFEnabledByDefault() {
#if defined(OS_LINUX) || defined(OS_FUCHSIA)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_FUCHSIA)
return true;
#elif defined(OS_WIN) || defined(OS_ANDROID)
return base::FeatureList::IsEnabled(kUseZoomForDsfEnabledByDefault);

@ -9,7 +9,7 @@
#if defined(OS_MAC)
#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"
#endif
@ -17,7 +17,7 @@ namespace content {
UtilityBlinkPlatformWithSandboxSupportImpl::
UtilityBlinkPlatformWithSandboxSupportImpl() {
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
mojo::PendingRemote<font_service::mojom::FontService> font_service;
UtilityThread::Get()->BindHostReceiver(
font_service.InitWithNewPipeAndPassReceiver());
@ -34,7 +34,7 @@ UtilityBlinkPlatformWithSandboxSupportImpl::
blink::WebSandboxSupport*
UtilityBlinkPlatformWithSandboxSupportImpl::GetSandboxSupport() {
#if defined(OS_LINUX) || defined(OS_MAC)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC)
return sandbox_support_.get();
#else
return nullptr;

@ -11,7 +11,7 @@
#include "build/build_config.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 "third_party/skia/include/core/SkRefCnt.h" // nogncheck
#endif
@ -33,10 +33,10 @@ class UtilityBlinkPlatformWithSandboxSupportImpl : public blink::Platform {
blink::WebSandboxSupport* GetSandboxSupport() override;
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_;
#endif
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
sk_sp<font_service::FontLoader> font_loader_;
#endif

@ -24,7 +24,7 @@
#include "sandbox/policy/sandbox.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 "sandbox/policy/linux/sandbox_linux.h"
#include "services/audio/audio_sandbox_hook_linux.h"
@ -82,7 +82,7 @@ int UtilityMain(const MainFunctionParams& parameters) {
if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog))
WaitForDebugger("Utility");
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
// Initializes the sandbox before any threads are created.
// TODO(jorgelo): move this after GTK initialization when we enable a strict
// Seccomp-BPF policy.