From db03e04f4e02b208da755fc87770ee92c1ed0657 Mon Sep 17 00:00:00 2001 From: Hidehiko Abe Date: Thu, 22 Feb 2018 01:29:44 +0900 Subject: Use header files to proxy system headers. Instead of directly modifying include directives, use header files to proxy system headers. This reduces line-by-line modification from Chrome repository. Bug: 73270448 Test: Built locally. Treehugger. Change-Id: I8f7315fc21634d3c2fb46bb9a72a43974140b9dc --- base/base64.cc | 2 +- base/base64url.cc | 3 +-- base/debug/debugger_posix.cc | 2 +- base/debug/stack_trace_posix.cc | 2 +- base/memory/shared_memory_android.cc | 5 ----- base/memory/shared_memory_posix.cc | 4 ++-- base/third_party/symbolize/symbolize.h | 15 +++++++++++++++ third_party/ashmem/ashmem.h | 17 +++++++++++++++++ third_party/modp_b64/modp_b64.h | 16 ++++++++++++++++ 9 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 base/third_party/symbolize/symbolize.h create mode 100644 third_party/ashmem/ashmem.h create mode 100644 third_party/modp_b64/modp_b64.h diff --git a/base/base64.cc b/base/base64.cc index 61d853897b..ca8ee93907 100644 --- a/base/base64.cc +++ b/base/base64.cc @@ -6,7 +6,7 @@ #include -#include +#include "third_party/modp_b64/modp_b64.h" namespace base { diff --git a/base/base64url.cc b/base/base64url.cc index 942229e76a..0a2c04511f 100644 --- a/base/base64url.cc +++ b/base/base64url.cc @@ -10,8 +10,7 @@ #include "base/macros.h" #include "base/numerics/safe_math.h" #include "base/strings/string_util.h" - -#include +#include "third_party/modp_b64/modp_b64.h" namespace base { diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc index ebe9d611f7..3255552333 100644 --- a/base/debug/debugger_posix.cc +++ b/base/debug/debugger_posix.cc @@ -46,7 +46,7 @@ #include "base/strings/string_piece.h" #if defined(USE_SYMBOLIZE) -#error "symbolize support was removed from libchrome" +#include "base/third_party/symbolize/symbolize.h" #endif #if defined(OS_ANDROID) diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc index c134f494eb..ab4c34b021 100644 --- a/base/debug/stack_trace_posix.cc +++ b/base/debug/stack_trace_posix.cc @@ -49,7 +49,7 @@ #include "build/build_config.h" #if defined(USE_SYMBOLIZE) -#error "symbolize support was removed from libchrome" +#include "base/third_party/symbolize/symbolize.h" #endif namespace base { diff --git a/base/memory/shared_memory_android.cc b/base/memory/shared_memory_android.cc index dffd1e3712..6f1d9cb874 100644 --- a/base/memory/shared_memory_android.cc +++ b/base/memory/shared_memory_android.cc @@ -8,12 +8,7 @@ #include #include "base/logging.h" - -#if defined(__ANDROID__) -#include -#else #include "third_party/ashmem/ashmem.h" -#endif namespace base { diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc index e5f67bd1e6..287e55d823 100644 --- a/base/memory/shared_memory_posix.cc +++ b/base/memory/shared_memory_posix.cc @@ -27,9 +27,9 @@ #if defined(OS_ANDROID) #include "base/os_compat_android.h" +#endif +#if defined(OS_ANDROID) || defined(__ANDROID__) #include "third_party/ashmem/ashmem.h" -#elif defined(__ANDROID__) -#include #endif namespace base { diff --git a/base/third_party/symbolize/symbolize.h b/base/third_party/symbolize/symbolize.h new file mode 100644 index 0000000000..59beafb7cb --- /dev/null +++ b/base/third_party/symbolize/symbolize.h @@ -0,0 +1,15 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#error "symbolize support was removed from libchrome" diff --git a/third_party/ashmem/ashmem.h b/third_party/ashmem/ashmem.h new file mode 100644 index 0000000000..3ef9f73c80 --- /dev/null +++ b/third_party/ashmem/ashmem.h @@ -0,0 +1,17 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// third_party/ashmem is Android shared memory. Instead of clone it here, +// use cutils/ashmem.h directly. +#include diff --git a/third_party/modp_b64/modp_b64.h b/third_party/modp_b64/modp_b64.h new file mode 100644 index 0000000000..ed24ac8494 --- /dev/null +++ b/third_party/modp_b64/modp_b64.h @@ -0,0 +1,16 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Redirect to system header. +#include -- cgit v1.2.3