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. Bug: 1110266 Change-Id: Ibf45218c1ba6a609714ba80ee2d7bae28e929f36 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352689 Reviewed-by: Yuri Wiitala <miu@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org> Reviewed-by: Jonathan Backer <backer@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Trent Apted <tapted@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Commit-Queue: Sean McAllister <smcallis@google.com> Cr-Commit-Position: refs/heads/master@{#799767}
This commit is contained in:

committed by
Commit Bot

parent
57884e91ea
commit
82700410f1
apps
chrome/browser
apps
ui
global_media_controls
startup
views
accelerator_table.ccfind_bar_views_interactive_uitest.ccfirst_run_dialog.cc
media_router
sync
tabs
toolbar
webui
print_preview
chromecast/app
content
browser
media
renderer
extensions/browser/api/app_window
ipc
ipc_channel.hipc_channel_common.ccipc_channel_mojo.ccipc_channel_mojo_unittest.ccipc_message_utils.ccipc_message_utils.hipc_perftest_util.ccipc_perftest_util.h
third_party/blink/renderer/core
ui
@ -148,7 +148,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsSavedToPrefs) {
|
||||
}
|
||||
|
||||
// Flaky: crbug.com/269613
|
||||
#if defined(OS_LINUX) || defined(OS_WIN)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
|
||||
#define MAYBE_FileAccessIsRestored DISABLED_FileAccessIsRestored
|
||||
#else
|
||||
#define MAYBE_FileAccessIsRestored FileAccessIsRestored
|
||||
|
@ -473,7 +473,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
|
||||
}
|
||||
|
||||
// Failing on some Win and Linux buildbots. See crbug.com/354425.
|
||||
#if defined(OS_WIN) || defined(OS_LINUX)
|
||||
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_Iframes DISABLED_Iframes
|
||||
#else
|
||||
#define MAYBE_Iframes Iframes
|
||||
|
@ -172,7 +172,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowAPITest, DISABLED_TestRestoreAfterClose) {
|
||||
}
|
||||
|
||||
// These tests will be flaky in Linux as window bounds change asynchronously.
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_TestDeprecatedBounds DISABLED_TestDeprecatedBounds
|
||||
#define MAYBE_TestInitialBounds DISABLED_TestInitialBounds
|
||||
#define MAYBE_TestInitialConstraints DISABLED_TestInitialConstraints
|
||||
|
@ -342,8 +342,8 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest,
|
||||
// Those tests should be disabled on Linux GTK when they are enabled on the
|
||||
// other platforms, see http://crbug.com/328829.
|
||||
// Flaky failures on Windows; see https://crbug.com/788283.
|
||||
#if (defined(OS_LINUX) && defined(USE_AURA)) || defined(OS_MAC) || \
|
||||
defined(OS_WIN)
|
||||
#if ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_AURA)) || \
|
||||
defined(OS_MAC) || defined(OS_WIN)
|
||||
#define MAYBE_TestCreate DISABLED_TestCreate
|
||||
#else
|
||||
#define MAYBE_TestCreate TestCreate
|
||||
@ -361,8 +361,8 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, MAYBE_TestCreate) {
|
||||
// ::Show() because of Cocoa conventions. See http://crbug.com/326987
|
||||
// Those tests should be disabled on Linux GTK when they are enabled on the
|
||||
// other platforms, see http://crbug.com/328829
|
||||
#if (defined(OS_LINUX) && defined(USE_AURA)) || defined(OS_WIN) || \
|
||||
defined(OS_MAC)
|
||||
#if ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_AURA)) || \
|
||||
defined(OS_WIN) || defined(OS_MAC)
|
||||
#define MAYBE_TestShow DISABLED_TestShow
|
||||
#else
|
||||
#define MAYBE_TestShow TestShow
|
||||
@ -423,7 +423,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, MAYBE_TestFullscreen) {
|
||||
}
|
||||
|
||||
// Only Linux and Windows use keep-alive to determine when to shut down.
|
||||
#if defined(OS_LINUX) || defined(OS_WIN)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
|
||||
|
||||
// In general, hidden windows should not keep Chrome alive. The exception is
|
||||
// when windows are created hidden, we allow the app some time to show the
|
||||
|
@ -648,7 +648,8 @@ TEST_F(MediaNotificationServiceTest, DismissesMediaSession) {
|
||||
}
|
||||
|
||||
// TODO(https://crbug.com/1034406) Flaky on Mac10.12, Linux and Win10.
|
||||
#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_WIN)
|
||||
#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
defined(OS_WIN)
|
||||
#define MAYBE_CountCastSessionsAsActive DISABLED_CountCastSessionsAsActive
|
||||
#else
|
||||
#define MAYBE_CountCastSessionsAsActive CountCastSessionsAsActive
|
||||
|
@ -308,7 +308,8 @@ bool IsSilentLaunchEnabled(const base::CommandLine& command_line,
|
||||
// true, send a warning if guest mode is requested but not allowed by policy.
|
||||
bool IsGuestModeEnforced(const base::CommandLine& command_line,
|
||||
bool show_warning) {
|
||||
#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || \
|
||||
defined(OS_MAC)
|
||||
PrefService* service = g_browser_process->local_state();
|
||||
DCHECK(service);
|
||||
|
||||
|
@ -1336,13 +1336,15 @@ void StartupBrowserCreatorFirstRunTest::SetUpCommandLine(
|
||||
}
|
||||
|
||||
void StartupBrowserCreatorFirstRunTest::SetUpInProcessBrowserTestFixture() {
|
||||
#if defined(OS_LINUX) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && \
|
||||
BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
// Set a policy that prevents the first-run dialog from being shown.
|
||||
policy_map_.Set(policy::key::kMetricsReportingEnabled,
|
||||
policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
|
||||
policy::POLICY_SOURCE_CLOUD, base::Value(false), nullptr);
|
||||
provider_.UpdateChromePolicy(policy_map_);
|
||||
#endif // defined(OS_LINUX) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
#endif // (defined(OS_LINUX) || defined(OS_CHROMEOS)) &&
|
||||
// BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
|
||||
EXPECT_CALL(provider_, IsInitializationComplete(_))
|
||||
.WillRepeatedly(Return(true));
|
||||
|
@ -131,14 +131,14 @@ const AcceleratorMapping kAcceleratorMap[] = {
|
||||
IDC_SHOW_AVATAR_MENU},
|
||||
|
||||
// Platform-specific key maps.
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
{ui::VKEY_BROWSER_BACK, ui::EF_NONE, IDC_BACK},
|
||||
{ui::VKEY_BROWSER_FORWARD, ui::EF_NONE, IDC_FORWARD},
|
||||
{ui::VKEY_BROWSER_HOME, ui::EF_NONE, IDC_HOME},
|
||||
{ui::VKEY_BROWSER_REFRESH, ui::EF_NONE, IDC_RELOAD},
|
||||
{ui::VKEY_BROWSER_REFRESH, ui::EF_CONTROL_DOWN, IDC_RELOAD_BYPASSING_CACHE},
|
||||
{ui::VKEY_BROWSER_REFRESH, ui::EF_SHIFT_DOWN, IDC_RELOAD_BYPASSING_CACHE},
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
// On Chrome OS, VKEY_BROWSER_SEARCH is handled in Ash.
|
||||
|
@ -581,7 +581,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, DISABLED_PasteWithoutTextChange) {
|
||||
}
|
||||
|
||||
// Slow flakiness on Linux. crbug.com/803743
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_CtrlEnter DISABLED_CtrlEnter
|
||||
#else
|
||||
#define MAYBE_CtrlEnter CtrlEnter
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "components/crash/content/app/breakpad_win.h"
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#include "components/crash/core/app/breakpad_linux.h"
|
||||
#endif
|
||||
|
||||
@ -41,7 +41,7 @@ void InitCrashReporterIfEnabled(bool enabled) {
|
||||
#if defined(OS_WIN)
|
||||
if (enabled)
|
||||
breakpad::InitCrashReporter(std::string());
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
if (!crash_reporter::IsCrashpadEnabled() && enabled)
|
||||
breakpad::InitCrashReporter(std::string());
|
||||
#endif
|
||||
|
@ -139,7 +139,7 @@ IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest, OpenDialogFromAppMenu) {
|
||||
}
|
||||
|
||||
// TODO(crbug.com/1004635) Disabled due to flake on Windows and Linux
|
||||
#if defined(OS_WIN) || defined(OS_LINUX)
|
||||
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_EphemeralToolbarIconForDialog EphemeralToolbarIconForDialog
|
||||
#else
|
||||
#define MAYBE_EphemeralToolbarIconForDialog \
|
||||
|
@ -287,7 +287,7 @@ void InlineLoginUIBrowserTest::SetAllowedUsernamePattern(
|
||||
local_state->SetString(prefs::kGoogleServicesUsernamePattern, pattern);
|
||||
}
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_WIN)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN)
|
||||
// crbug.com/422868
|
||||
#define MAYBE_DifferentStorageId DISABLED_DifferentStorageId
|
||||
#else
|
||||
|
@ -598,7 +598,7 @@ void Tab::MaybeUpdateHoverStatus(const ui::MouseEvent& event) {
|
||||
if (mouse_hovered_ || !GetWidget()->IsMouseEventsEnabled())
|
||||
return;
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// Move the hit test area for hovering up so that it is not overlapped by tab
|
||||
// hover cards when they are shown.
|
||||
// TODO(crbug/978134): Once Linux/CrOS widget transparency is solved, remove
|
||||
|
@ -445,7 +445,7 @@ void TabDragController::Init(TabDragContext* source_context,
|
||||
// synchronous on desktop Linux, so use that.
|
||||
// - Chrome OS
|
||||
// Releasing capture on Ash cancels gestures so avoid it.
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
can_release_capture_ = false;
|
||||
#endif
|
||||
start_point_in_screen_ = gfx::Point(source_view_offset, mouse_offset.y());
|
||||
|
@ -123,7 +123,7 @@ IN_PROC_BROWSER_TEST_F(TabHoverCardBubbleViewBrowserTest,
|
||||
|
||||
// Verify hover card is visible when tab is focused.
|
||||
// TODO(crbug.com/1050765): the test is flaky.
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_WidgetVisibleOnTabFocus DISABLED_WidgetVisibleOnTabFocus
|
||||
#else
|
||||
#define MAYBE_WidgetVisibleOnTabFocus WidgetVisibleOnTabFocus
|
||||
@ -141,7 +141,7 @@ IN_PROC_BROWSER_TEST_F(TabHoverCardBubbleViewBrowserTest,
|
||||
// Verify hover card is visible when focus moves from the tab to tab close
|
||||
// button.
|
||||
// TODO(crbug.com/1050765): the test is flaky.
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_WidgetVisibleOnTabCloseButtonFocusAfterTabFocus \
|
||||
DISABLED_WidgetVisibleOnTabCloseButtonFocusAfterTabFocus
|
||||
#else
|
||||
@ -194,7 +194,7 @@ IN_PROC_BROWSER_TEST_F(TabHoverCardBubbleViewBrowserTest,
|
||||
// Verify hover card is visible after navigating to the tab strip using keyboard
|
||||
// accelerators.
|
||||
// TODO(crbug.com/1050765): the test is flaky.
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_WidgetVisibleOnTabFocusFromKeyboardAccelerator \
|
||||
DISABLED_WidgetVisibleOnTabFocusFromKeyboardAccelerator
|
||||
#else
|
||||
|
@ -153,7 +153,7 @@ void ToolbarViewInteractiveUITest::SetUpOnMainThread() {
|
||||
|
||||
// TODO(pkasting): https://crbug.com/939621 Fails on Mac.
|
||||
// Also flaky on linux-chromeos-chrome crbug.com/1076875.
|
||||
#if defined(OS_MAC) || defined(OS_LINUX)
|
||||
#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_TestAppMenuOpensOnDrag DISABLED_TestAppMenuOpensOnDrag
|
||||
#else
|
||||
#define MAYBE_TestAppMenuOpensOnDrag TestAppMenuOpensOnDrag
|
||||
|
@ -89,7 +89,7 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewBrowserTest, PrintCommands) {
|
||||
}
|
||||
|
||||
// Disable the test for mac, see http://crbug/367665.
|
||||
#if defined(OS_MAC) || defined(OS_LINUX)
|
||||
#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#define MAYBE_TaskManagerNewPrintPreview DISABLED_TaskManagerNewPrintPreview
|
||||
#else
|
||||
#define MAYBE_TaskManagerNewPrintPreview TaskManagerNewPrintPreview
|
||||
|
@ -40,20 +40,20 @@
|
||||
#include "chromecast/app/android/cast_crash_reporter_client_android.h"
|
||||
#include "chromecast/app/android/crash_handler.h"
|
||||
#include "ui/base/resource/resource_bundle_android.h"
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#include "chromecast/app/linux/cast_crash_reporter_client.h"
|
||||
#include "sandbox/policy/switches.h"
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
namespace {
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
chromecast::CastCrashReporterClient* GetCastCrashReporter() {
|
||||
static base::NoDestructor<chromecast::CastCrashReporterClient>
|
||||
crash_reporter_client;
|
||||
return crash_reporter_client.get();
|
||||
}
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
const int kMaxCrashFiles = 10;
|
||||
@ -135,7 +135,8 @@ bool CastMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||
}
|
||||
|
||||
void CastMainDelegate::PreSandboxStartup() {
|
||||
#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
|
||||
#if defined(ARCH_CPU_ARM_FAMILY) && \
|
||||
(defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS))
|
||||
// Create an instance of the CPU class to parse /proc/cpuinfo and cache the
|
||||
// results. This data needs to be cached when file-reading is still allowed,
|
||||
// since base::CPU expects to be callable later, when file-reading is no
|
||||
@ -155,13 +156,13 @@ void CastMainDelegate::PreSandboxStartup() {
|
||||
base::FilePath log_file;
|
||||
base::PathService::Get(FILE_CAST_ANDROID_LOG, &log_file);
|
||||
chromecast::CrashHandler::Initialize(process_type, log_file);
|
||||
#elif defined(OS_LINUX)
|
||||
crash_reporter::SetCrashReporterClient(GetCastCrashReporter());
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
crash_reporter::SetCrashReporterClient(GetCastCrashReporter());
|
||||
|
||||
if (process_type != service_manager::switches::kZygoteProcess) {
|
||||
CastCrashReporterClient::InitCrashReporter(process_type);
|
||||
}
|
||||
#endif // defined(OS_LINUX)
|
||||
if (process_type != service_manager::switches::kZygoteProcess) {
|
||||
CastCrashReporterClient::InitCrashReporter(process_type);
|
||||
}
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
crash_reporter::InitializeCrashKeys();
|
||||
}
|
||||
@ -191,7 +192,7 @@ int CastMainDelegate::RunProcess(
|
||||
#endif // defined(OS_ANDROID)
|
||||
}
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
void CastMainDelegate::ZygoteForked() {
|
||||
const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess());
|
||||
bool enable_crash_reporter = !command_line->HasSwitch(
|
||||
@ -202,7 +203,7 @@ void CastMainDelegate::ZygoteForked() {
|
||||
CastCrashReporterClient::InitCrashReporter(process_type);
|
||||
}
|
||||
}
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
bool CastMainDelegate::ShouldCreateFeatureList() {
|
||||
return false;
|
||||
|
@ -43,9 +43,9 @@ class CastMainDelegate : public content::ContentMainDelegate {
|
||||
int RunProcess(
|
||||
const std::string& process_type,
|
||||
const content::MainFunctionParams& main_function_params) override;
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
void ZygoteForked() override;
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
bool ShouldCreateFeatureList() override;
|
||||
void PostEarlyInitialization(bool is_running_tests) override;
|
||||
content::ContentClient* CreateContentClient() override;
|
||||
|
@ -31,7 +31,7 @@ class MidiBrowserTest : public ContentBrowserTest {
|
||||
EXPECT_TRUE(NavigateToURL(shell(), https_test_server_->GetURL(path)));
|
||||
|
||||
const base::string16 result = watcher.WaitAndGetTitle();
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// Try does not allow accessing /dev/snd/seq, and it results in a platform
|
||||
// specific initialization error. See http://crbug.com/371230.
|
||||
// Also, Chromecast does not support the feature and results in
|
||||
|
@ -44,7 +44,7 @@
|
||||
#if defined(OS_WIN)
|
||||
#include "base/win/win_util.h"
|
||||
#endif
|
||||
#if defined(OS_LINUX) && defined(ARCH_CPU_X86_64)
|
||||
#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
|
||||
#include "v8/include/v8-wasm-trap-handler-posix.h"
|
||||
#endif
|
||||
namespace {
|
||||
@ -161,7 +161,7 @@ RenderProcessImpl::RenderProcessImpl()
|
||||
|
||||
SetV8FlagIfNotFeature(features::kWebAssemblyTrapHandler,
|
||||
"--no-wasm-trap-handler");
|
||||
#if defined(OS_LINUX) && defined(ARCH_CPU_X86_64)
|
||||
#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
|
||||
if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
if (!command_line->HasSwitch(
|
||||
|
@ -713,7 +713,7 @@ void RenderThreadImpl::Init() {
|
||||
DCHECK(parsed_num_raster_threads) << string_value;
|
||||
DCHECK_GT(num_raster_threads, 0);
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
categorized_worker_pool_->SetBackgroundingCallback(
|
||||
main_thread_scheduler_->DefaultTaskRunner(),
|
||||
base::BindOnce(
|
||||
@ -736,7 +736,7 @@ void RenderThreadImpl::Init() {
|
||||
base::DiscardableMemoryAllocator::SetInstance(
|
||||
discardable_memory_allocator_.get());
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
if (base::FeatureList::IsEnabled(
|
||||
blink::features::kBlinkCompositorUseDisplayThreadPriority)) {
|
||||
render_message_filter()->SetThreadPriority(
|
||||
@ -1121,7 +1121,8 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl::GetGpuFactories() {
|
||||
!cmd_line->HasSwitch(switches::kDisableGpuMemoryBufferVideoFrames);
|
||||
#else
|
||||
cmd_line->HasSwitch(switches::kEnableGpuMemoryBufferVideoFrames);
|
||||
#endif // defined(OS_MAC) || defined(OS_LINUX) || defined(OS_WIN)
|
||||
#endif // defined(OS_MAC) || defined(OS_LINUX) || defined(OS_CHROMEOS) ||
|
||||
// defined(OS_WIN)
|
||||
const bool enable_media_stream_gpu_memory_buffers =
|
||||
enable_gpu_memory_buffers &&
|
||||
base::FeatureList::IsEnabled(
|
||||
|
@ -97,7 +97,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
|
||||
|
||||
@ -168,7 +168,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
|
||||
main_thread_scheduler_(main_thread_scheduler) {
|
||||
// RenderThread may not exist in some tests.
|
||||
if (RenderThreadImpl::current()) {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
mojo::PendingRemote<font_service::mojom::FontService> font_service;
|
||||
RenderThreadImpl::current()->BindHostReceiver(
|
||||
font_service.InitWithNewPipeAndPassReceiver());
|
||||
@ -178,7 +178,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_MAC)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC)
|
||||
if (sandboxEnabled()) {
|
||||
#if defined(OS_MAC)
|
||||
sandbox_support_ = std::make_unique<WebSandboxSupportMac>();
|
||||
@ -231,7 +231,7 @@ RendererBlinkPlatformImpl::WrapSharedURLLoaderFactory(
|
||||
|
||||
void RendererBlinkPlatformImpl::SetDisplayThreadPriority(
|
||||
base::PlatformThreadId thread_id) {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
if (RenderThreadImpl* render_thread = RenderThreadImpl::current()) {
|
||||
render_thread->render_message_filter()->SetThreadPriority(
|
||||
thread_id, base::ThreadPriority::DISPLAY);
|
||||
@ -244,7 +244,7 @@ blink::BlameContext* RendererBlinkPlatformImpl::GetTopLevelBlameContext() {
|
||||
}
|
||||
|
||||
blink::WebSandboxSupport* RendererBlinkPlatformImpl::GetSandboxSupport() {
|
||||
#if defined(OS_LINUX) || defined(OS_MAC)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC)
|
||||
return sandbox_support_.get();
|
||||
#else
|
||||
// These platforms do not require sandbox support.
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom.h"
|
||||
#include "third_party/blink/public/mojom/loader/code_cache.mojom.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
|
||||
@ -220,7 +220,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
// Return the mojo interface for making CodeCache calls.
|
||||
blink::mojom::CodeCacheHost& GetCodeCacheHost();
|
||||
|
||||
#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
|
||||
|
||||
@ -241,7 +241,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
mojo::PendingRemote<blink::mojom::CodeCacheHost> code_cache_host_remote_;
|
||||
mojo::SharedRemote<blink::mojom::CodeCacheHost> code_cache_host_;
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
sk_sp<font_service::FontLoader> font_loader_;
|
||||
#endif
|
||||
|
||||
|
@ -64,7 +64,7 @@ IN_PROC_BROWSER_TEST_F(ExperimentalAppWindowApiTest, SetIcon) {
|
||||
#define MAYBE_OnMinimizedEvent OnMinimizedEvent
|
||||
#define MAYBE_OnMaximizedEvent OnMaximizedEvent
|
||||
#define MAYBE_OnRestoredEvent OnRestoredEvent
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
|
||||
IN_PROC_BROWSER_TEST_F(AppWindowApiTest, MAYBE_OnMinimizedEvent) {
|
||||
#if defined(OS_MAC)
|
||||
|
@ -244,7 +244,7 @@ class COMPONENT_EXPORT(IPC) Channel : public Sender {
|
||||
static std::string GenerateUniqueRandomChannelID();
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// Sandboxed processes live in a PID namespace, so when sending the IPC hello
|
||||
// message from client to server we need to send the PID from the global
|
||||
// PID namespace.
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace IPC {
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
namespace {
|
||||
int g_global_pid = 0;
|
||||
@ -26,7 +26,7 @@ int Channel::GetGlobalPid() {
|
||||
return g_global_pid;
|
||||
}
|
||||
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
// static
|
||||
std::unique_ptr<Channel> Channel::CreateClient(
|
||||
|
@ -74,10 +74,10 @@ class MojoChannelFactory : public ChannelFactory {
|
||||
};
|
||||
|
||||
base::ProcessId GetSelfPID() {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
if (int global_pid = Channel::GetGlobalPid())
|
||||
return global_pid;
|
||||
#endif // OS_LINUX
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#if defined(OS_NACL)
|
||||
return -1;
|
||||
#else
|
||||
|
@ -1701,7 +1701,7 @@ DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT(
|
||||
|
||||
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
const base::ProcessId kMagicChildId = 54321;
|
||||
|
||||
@ -1748,6 +1748,6 @@ DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT(IPCChannelMojoTestVerifyGlobalPidClient) {
|
||||
Close();
|
||||
}
|
||||
|
||||
#endif // OS_LINUX
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
} // namespace
|
||||
|
@ -356,8 +356,8 @@ void ParamTraits<unsigned int>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::NumberToString(p));
|
||||
}
|
||||
|
||||
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FUCHSIA) || \
|
||||
(defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
|
||||
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
defined(OS_FUCHSIA) || (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
|
||||
void ParamTraits<long>::Log(const param_type& p, std::string* l) {
|
||||
l->append(base::NumberToString(p));
|
||||
}
|
||||
|
@ -209,8 +209,8 @@ struct ParamTraits<unsigned int> {
|
||||
// 3) Android 64 bit and Fuchsia also have int64_t typedef'd to long.
|
||||
// Since we want to support Android 32<>64 bit IPC, as long as we don't have
|
||||
// these traits for 32 bit ARM then that'll catch any errors.
|
||||
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FUCHSIA) || \
|
||||
(defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
|
||||
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||
defined(OS_FUCHSIA) || (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS))
|
||||
template <>
|
||||
struct ParamTraits<long> {
|
||||
typedef long param_type;
|
||||
|
@ -74,7 +74,7 @@ LockThreadAffinity::LockThreadAffinity(int cpu_number)
|
||||
const DWORD_PTR thread_mask = static_cast<DWORD_PTR>(1) << cpu_number;
|
||||
old_affinity_ = SetThreadAffinityMask(GetCurrentThread(), thread_mask);
|
||||
affinity_set_ok_ = old_affinity_ != 0;
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
CPU_SET(cpu_number, &cpuset);
|
||||
@ -94,7 +94,7 @@ LockThreadAffinity::~LockThreadAffinity() {
|
||||
#if defined(OS_WIN)
|
||||
auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_);
|
||||
DCHECK_NE(0u, set_result);
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_);
|
||||
DCHECK_EQ(0, set_result);
|
||||
#endif
|
||||
|
@ -77,7 +77,7 @@ class LockThreadAffinity {
|
||||
bool affinity_set_ok_;
|
||||
#if defined(OS_WIN)
|
||||
DWORD_PTR old_affinity_;
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
cpu_set_t old_cpuset_;
|
||||
#endif
|
||||
|
||||
|
@ -111,7 +111,7 @@ class InternalPopupMenu::ItemIterationContext {
|
||||
is_in_group_(false),
|
||||
buffer_(buffer) {
|
||||
DCHECK(buffer_);
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// On other platforms, the <option> background color is the same as the
|
||||
// <select> background color. On Linux, that makes the <option>
|
||||
// background color very dark, so by default, try to use a lighter
|
||||
|
@ -110,7 +110,7 @@ namespace {
|
||||
static CompositingQueryMode g_compositing_query_mode =
|
||||
kCompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases;
|
||||
|
||||
#ifdef OS_LINUX
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
struct SameSizeAsPaintLayer : DisplayItemClient {
|
||||
// The bit fields may fit into the machine word of DisplayItemClient which
|
||||
// has only 8-bit data.
|
||||
|
@ -29,7 +29,7 @@ bool KeyboardHookOzone::RegisterHook() {
|
||||
return true;
|
||||
}
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
#if !defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
// static
|
||||
std::unique_ptr<KeyboardHook> KeyboardHook::CreateModifierKeyboardHook(
|
||||
base::Optional<base::flat_set<DomCode>> dom_codes,
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#include <drm_fourcc.h>
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#endif
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
namespace gfx {
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
static_assert(NativePixmapHandle::kNoModifier == DRM_FORMAT_MOD_INVALID,
|
||||
"gfx::NativePixmapHandle::kNoModifier should be an alias for"
|
||||
"DRM_FORMAT_MOD_INVALID");
|
||||
@ -32,7 +32,7 @@ NativePixmapPlane::NativePixmapPlane() : stride(0), offset(0), size(0) {}
|
||||
NativePixmapPlane::NativePixmapPlane(int stride,
|
||||
int offset,
|
||||
uint64_t size
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
,
|
||||
base::ScopedFD fd
|
||||
#elif defined(OS_FUCHSIA)
|
||||
@ -43,7 +43,7 @@ NativePixmapPlane::NativePixmapPlane(int stride,
|
||||
: stride(stride),
|
||||
offset(offset),
|
||||
size(size)
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
,
|
||||
fd(std::move(fd))
|
||||
#elif defined(OS_FUCHSIA)
|
||||
@ -71,7 +71,7 @@ NativePixmapHandle& NativePixmapHandle::operator=(NativePixmapHandle&& other) =
|
||||
NativePixmapHandle CloneHandleForIPC(const NativePixmapHandle& handle) {
|
||||
NativePixmapHandle clone;
|
||||
for (auto& plane : handle.planes) {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
DCHECK(plane.fd.is_valid());
|
||||
base::ScopedFD fd_dup(HANDLE_EINTR(dup(plane.fd.get())));
|
||||
if (!fd_dup.is_valid()) {
|
||||
@ -97,7 +97,7 @@ NativePixmapHandle CloneHandleForIPC(const NativePixmapHandle& handle) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
clone.modifier = handle.modifier;
|
||||
#endif
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "ui/gfx/gfx_export.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#include "base/files/scoped_file.h"
|
||||
#endif
|
||||
|
||||
@ -32,7 +32,7 @@ struct GFX_EXPORT NativePixmapPlane {
|
||||
NativePixmapPlane(int stride,
|
||||
int offset,
|
||||
uint64_t size
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
,
|
||||
base::ScopedFD fd
|
||||
#elif defined(OS_FUCHSIA)
|
||||
@ -53,7 +53,7 @@ struct GFX_EXPORT NativePixmapPlane {
|
||||
// This is necessary to map the buffers.
|
||||
uint64_t size;
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// File descriptor for the underlying memory object (usually dmabuf).
|
||||
base::ScopedFD fd;
|
||||
#elif defined(OS_FUCHSIA)
|
||||
@ -82,7 +82,7 @@ struct GFX_EXPORT NativePixmapHandle {
|
||||
|
||||
std::vector<NativePixmapPlane> planes;
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// The modifier is retrieved from GBM library and passed to EGL driver.
|
||||
// Generally it's platform specific, and we don't need to modify it in
|
||||
// Chromium code. Also one per plane per entry.
|
||||
|
@ -13,7 +13,8 @@ namespace features {
|
||||
// Launched on Windows, still experimental on other platforms.
|
||||
const base::Feature kDefaultPassthroughCommandDecoder{
|
||||
"DefaultPassthroughCommandDecoder",
|
||||
#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(CHROMECAST_BUILD))
|
||||
#if defined(OS_WIN) || ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && \
|
||||
!defined(CHROMECAST_BUILD))
|
||||
base::FEATURE_ENABLED_BY_DEFAULT
|
||||
#else
|
||||
base::FEATURE_DISABLED_BY_DEFAULT
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// These constants define a reasonable range for a calculated refresh interval.
|
||||
// Calculating refreshes out of this range will be considered a fatal error.
|
||||
const int64_t kMinVsyncIntervalUs = base::Time::kMicrosecondsPerSecond / 400;
|
||||
@ -26,7 +26,7 @@ const double kRelativeIntervalDifferenceThreshold = 0.05;
|
||||
namespace gl {
|
||||
|
||||
SyncControlVSyncProvider::SyncControlVSyncProvider() : gfx::VSyncProvider() {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// On platforms where we can't get an accurate reading on the refresh
|
||||
// rate we fall back to the assumption that we're displaying 60 frames
|
||||
// per second.
|
||||
@ -48,7 +48,7 @@ bool SyncControlVSyncProvider::GetVSyncParametersIfAvailable(
|
||||
base::TimeTicks* timebase_out,
|
||||
base::TimeDelta* interval_out) {
|
||||
TRACE_EVENT0("gpu", "SyncControlVSyncProvider::GetVSyncParameters");
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
// The actual clock used for the system time returned by glXGetSyncValuesOML
|
||||
// is unspecified. In practice, the clock used is likely to be either
|
||||
// CLOCK_REALTIME or CLOCK_MONOTONIC, so we compare the returned time to the
|
||||
@ -156,11 +156,11 @@ bool SyncControlVSyncProvider::GetVSyncParametersIfAvailable(
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
}
|
||||
|
||||
bool SyncControlVSyncProvider::SupportGetVSyncParametersIfAvailable() const {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
@ -26,11 +26,11 @@ class SyncControlVSyncProvider : public gfx::VSyncProvider {
|
||||
bool SupportGetVSyncParametersIfAvailable() const override;
|
||||
|
||||
static constexpr bool IsSupported() {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -41,7 +41,7 @@ class SyncControlVSyncProvider : public gfx::VSyncProvider {
|
||||
virtual bool GetMscRate(int32_t* numerator, int32_t* denominator) = 0;
|
||||
|
||||
private:
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
base::TimeTicks last_timebase_;
|
||||
uint64_t last_media_stream_counter_ = 0;
|
||||
base::TimeDelta last_good_interval_;
|
||||
@ -52,7 +52,7 @@ class SyncControlVSyncProvider : public gfx::VSyncProvider {
|
||||
// from configuration change (monitor reconfiguration, moving windows
|
||||
// between monitors, suspend and resume, etc.).
|
||||
base::queue<base::TimeDelta> last_computed_intervals_;
|
||||
#endif // defined(OS_LINUX)
|
||||
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(SyncControlVSyncProvider);
|
||||
};
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "ui/gl/init/gl_factory.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#include "ui/platform_window/common/platform_window_defaults.h" // nogncheck
|
||||
#endif
|
||||
|
||||
@ -52,7 +52,7 @@ void InitializeOneOffHelper(bool init_extensions) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
ui::test::EnableTestConfigForPlatformWindows();
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user