Commit 4b42d071 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 /components/gwp_asan

This CL was uploaded by git cl split.

R=inferno@chromium.org

Bug: 1110266
Change-Id: I1d55608a65e101e9809d5691c1d6ff4dab2152fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2370290Reviewed-by: default avatarMatthew Denton <mpdenton@chromium.org>
Commit-Queue: Sean McAllister <smcallis@google.com>
Cr-Commit-Position: refs/heads/master@{#803997}
parent 275861f7
......@@ -36,7 +36,7 @@ static size_t GetAllocatedSize(void* mem) {
static size_t GetAllocatedSize(void* mem) {
return malloc_size(mem);
}
#elif defined(OS_LINUX)
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
#include <malloc.h>
static size_t GetAllocatedSize(void* mem) {
return malloc_usable_size(mem);
......
......@@ -26,7 +26,7 @@
#include "third_party/crashpad/crashpad/snapshot/process_snapshot.h"
#include "third_party/crashpad/crashpad/util/process/process_memory.h"
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
#include <signal.h>
#elif defined(OS_APPLE)
#include <mach/exception_types.h>
......@@ -81,7 +81,7 @@ bool CrashAnalyzer::GetExceptionInfo(
crashpad::VMAddress CrashAnalyzer::GetAccessAddress(
const crashpad::ExceptionSnapshot& exception) {
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
if (exception.Exception() == SIGSEGV || exception.Exception() == SIGBUS)
return exception.ExceptionAddress();
#elif defined(OS_APPLE)
......
......@@ -34,7 +34,7 @@
#include "third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.h"
#include "third_party/crashpad/crashpad/tools/tool_support.h"
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
#include "third_party/crashpad/crashpad/snapshot/sanitized/sanitization_information.h"
#endif
......@@ -122,7 +122,7 @@ MULTIPROCESS_TEST_MAIN(CrashingProcess) {
std::map<std::string, std::string> annotations;
std::vector<std::string> arguments;
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
static crashpad::SanitizationInformation sanitization_info = {};
static crashpad::SanitizationAllowedMemoryRanges allowed_memory_ranges;
if (cmd_line->HasSwitch("sanitize")) {
......@@ -150,7 +150,7 @@ MULTIPROCESS_TEST_MAIN(CrashingProcess) {
#endif
crashpad::CrashpadClient* client = new crashpad::CrashpadClient();
#if defined(OS_LINUX)
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
bool handler =
client->StartHandlerAtCrash(/* handler */ cmd_line->GetProgram(),
/* database */ directory,
......@@ -458,7 +458,7 @@ TEST_P(CrashHandlerTest, MAYBE_DISABLED(UnrelatedException)) {
INSTANTIATE_TEST_SUITE_P(VaryAllocator,
CrashHandlerTest,
testing::Values(
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
TestParams("malloc", true),
#endif
TestParams("malloc", false),
......
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