Commit af12f1ae authored by Vlad Tsyrklevich's avatar Vlad Tsyrklevich Committed by Commit Bot

GWP-ASan: Add plain "enable_gwp_asan" buildflag

Previously GWP-ASan only exposed separate flags for whether it was
enabled for a given allocator. Create a convenience buildflag for places
when we need to check whether GWP-ASan is enabled for any allocator and
use it where appropriate.

Bug: 973167
Change-Id: I76f8ee2c258279ebd07e3b6f72651498358a95da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671866
Auto-Submit: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: default avatarVitaly Buka <vitalybuka@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672200}
parent 5296f14e
...@@ -1487,7 +1487,7 @@ group("browser_dependencies") { ...@@ -1487,7 +1487,7 @@ group("browser_dependencies") {
} }
} }
if (enable_gwp_asan_malloc || enable_gwp_asan_partitionalloc) { if (enable_gwp_asan) {
public_deps += [ "//components/gwp_asan/client" ] public_deps += [ "//components/gwp_asan/client" ]
} }
...@@ -1532,7 +1532,7 @@ group("child_dependencies") { ...@@ -1532,7 +1532,7 @@ group("child_dependencies") {
public_deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ] public_deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
} }
if (enable_gwp_asan_malloc || enable_gwp_asan_partitionalloc) { if (enable_gwp_asan) {
public_deps += [ "//components/gwp_asan/client" ] public_deps += [ "//components/gwp_asan/client" ]
} }
...@@ -1886,7 +1886,7 @@ if (is_android) { ...@@ -1886,7 +1886,7 @@ if (is_android) {
deps += [ "//third_party/gvr-android-sdk:gvr_shim" ] deps += [ "//third_party/gvr-android-sdk:gvr_shim" ]
} }
if (enable_gwp_asan_malloc || enable_gwp_asan_partitionalloc) { if (enable_gwp_asan) {
deps += [ "//components/gwp_asan/client" ] deps += [ "//components/gwp_asan/client" ]
} }
} }
......
...@@ -395,7 +395,7 @@ static_library("test_support") { ...@@ -395,7 +395,7 @@ static_library("test_support") {
] ]
} }
if (enable_gwp_asan_malloc || enable_gwp_asan_partitionalloc) { if (enable_gwp_asan) {
deps += [ "//components/gwp_asan/client" ] deps += [ "//components/gwp_asan/client" ]
} }
} }
......
...@@ -167,8 +167,7 @@ ...@@ -167,8 +167,7 @@
#include "chrome/child/pdf_child_init.h" #include "chrome/child/pdf_child_init.h"
#endif #endif
#if BUILDFLAG(ENABLE_GWP_ASAN_MALLOC) || \ #if BUILDFLAG(ENABLE_GWP_ASAN)
BUILDFLAG(ENABLE_GWP_ASAN_PARTITIONALLOC)
#include "components/gwp_asan/client/gwp_asan.h" // nogncheck #include "components/gwp_asan/client/gwp_asan.h" // nogncheck
#endif #endif
......
...@@ -10,5 +10,6 @@ buildflag_header("buildflags") { ...@@ -10,5 +10,6 @@ buildflag_header("buildflags") {
flags = [ flags = [
"ENABLE_GWP_ASAN_MALLOC=$enable_gwp_asan_malloc", "ENABLE_GWP_ASAN_MALLOC=$enable_gwp_asan_malloc",
"ENABLE_GWP_ASAN_PARTITIONALLOC=$enable_gwp_asan_partitionalloc", "ENABLE_GWP_ASAN_PARTITIONALLOC=$enable_gwp_asan_partitionalloc",
"ENABLE_GWP_ASAN=$enable_gwp_asan",
] ]
} }
...@@ -10,3 +10,8 @@ declare_args() { ...@@ -10,3 +10,8 @@ declare_args() {
enable_gwp_asan_malloc = (is_win || is_mac) && use_allocator_shim enable_gwp_asan_malloc = (is_win || is_mac) && use_allocator_shim
enable_gwp_asan_partitionalloc = (is_win || is_mac) && use_partition_alloc enable_gwp_asan_partitionalloc = (is_win || is_mac) && use_partition_alloc
} }
declare_args() {
# Convenience definition
enable_gwp_asan = enable_gwp_asan_malloc || enable_gwp_asan_partitionalloc
}
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