1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
source_set("memory_pressure") {
sources = [
"memory_pressure_level_reporter.cc",
"memory_pressure_level_reporter.h",
"memory_pressure_voter.cc",
"memory_pressure_voter.h",
"multi_source_memory_pressure_monitor.cc",
"multi_source_memory_pressure_monitor.h",
"reclaim_target.h",
"system_memory_pressure_evaluator.cc",
"system_memory_pressure_evaluator.h",
"unnecessary_discard_monitor.cc",
"unnecessary_discard_monitor.h",
]
deps = [
"//base",
"//build:chromeos_buildflags",
]
if (is_win) {
sources += [
"system_memory_pressure_evaluator_win.cc",
"system_memory_pressure_evaluator_win.h",
]
}
if (is_apple) {
sources += [
"system_memory_pressure_evaluator_mac.cc",
"system_memory_pressure_evaluator_mac.h",
]
}
if (is_fuchsia) {
deps += [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_hlcpp",
"//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
]
sources += [
"system_memory_pressure_evaluator_fuchsia.cc",
"system_memory_pressure_evaluator_fuchsia.h",
]
}
if (is_linux || is_chromeos_lacros) {
sources += [
"system_memory_pressure_evaluator_linux.cc",
"system_memory_pressure_evaluator_linux.h",
]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"memory_pressure_level_reporter_unittest.cc",
"memory_pressure_voter_unittest.cc",
"multi_source_memory_pressure_monitor_unittest.cc",
"unnecessary_discard_monitor_unittest.cc",
]
deps = [
":memory_pressure",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
if (is_win) {
sources += [ "system_memory_pressure_evaluator_win_unittest.cc" ]
}
if (is_mac) {
sources += [ "system_memory_pressure_evaluator_mac_unittest.cc" ]
}
if (is_fuchsia) {
deps += [ "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_hlcpp" ]
sources += [ "system_memory_pressure_evaluator_fuchsia_unittest.cc" ]
}
if (is_linux || is_chromeos_lacros) {
sources += [ "system_memory_pressure_evaluator_linux_unittest.cc" ]
}
}
static_library("test_support") {
testonly = true
sources = [
"fake_memory_pressure_monitor.cc",
"fake_memory_pressure_monitor.h",
]
public_deps = [
":memory_pressure",
"//base",
]
}
|