blob: 478609f9b0405c0a3e8a7781bf96e7ae0ec48656 [file] [log] [blame]
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//base/allocator/allocator.gni")
import("//base/allocator/partition_allocator/partition_alloc.gni")
component("client") {
output_name = "gwp_asan_client"
sources = [
"export.h",
"guarded_page_allocator.cc",
"guarded_page_allocator.h",
"gwp_asan.cc",
"gwp_asan.h",
"sampling_state.h",
]
if (is_win) {
sources += [ "guarded_page_allocator_win.cc" ]
}
if (is_posix) {
sources += [ "guarded_page_allocator_posix.cc" ]
}
if (use_allocator_shim) {
sources += [
"sampling_malloc_shims.cc",
"sampling_malloc_shims.h",
]
}
if (use_partition_alloc) {
sources += [
"sampling_partitionalloc_shims.cc",
"sampling_partitionalloc_shims.h",
]
}
defines = [ "GWP_ASAN_IMPLEMENTATION" ]
deps = [
"//base",
"//base/allocator:buildflags",
"//components/crash/core/common:crash_key",
"//components/gwp_asan/common",
"//components/gwp_asan/common:crash_keys",
]
if (is_android) {
deps += [ "//components/crash/core/app" ]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"guarded_page_allocator_unittest.cc",
"gwp_asan_unittest.cc",
]
if (use_allocator_shim) {
sources += [ "sampling_malloc_shims_unittest.cc" ]
}
if (use_partition_alloc) {
sources += [ "sampling_partitionalloc_shims_unittest.cc" ]
}
deps = [
":client",
"//base/allocator:buildflags",
"//base/test:test_support",
"//components/crash/core/common:crash_key",
"//components/gwp_asan/common",
"//components/gwp_asan/common:crash_keys",
"//testing/gmock",
"//testing/gtest",
]
}