blob: 8145cf741fa2937c8bc18cdaec4fb1d90bfea59f [file] [log] [blame]
# Copyright 2018 The Chromium Authors. All rights reserved.
# 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("//build/config/allocator.gni")
component("client") {
output_name = "gwp_asan_client"
sources = [
"export.h",
"guarded_page_allocator.cc",
"guarded_page_allocator.h",
"guarded_page_allocator_win.cc",
"gwp_asan.cc",
"gwp_asan.h",
"sampling_helpers.cc",
"sampling_helpers.h",
"sampling_state.h",
]
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",
]
if (is_android) {
deps += [ "//components/crash/content/app" ]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"guarded_page_allocator_unittest.cc",
"gwp_asan_unittest.cc",
"sampling_helpers_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",
"//testing/gmock",
"//testing/gtest",
]
}