blob: 4d515d7e7a229d1dba95d7b1036a05f3230eb850 [file] [log] [blame]
[email protected]7603bbd12013-08-13 17:33:371# Copyright (c) 2012 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
phosek636bceb32015-10-27 03:36:485import("//build/config/nacl/config.gni")
qsrfb5251d12015-01-21 15:57:226import("//testing/test.gni")
ochangcc11d0e2016-04-26 19:58:267import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
qsrfb5251d12015-01-21 15:57:228
[email protected]7603bbd12013-08-13 17:33:379component("ipc") {
10 sources = [
erikchende9412b82015-07-27 18:26:1411 "attachment_broker.cc",
erikchen151b2f92015-06-16 20:20:5112 "attachment_broker.h",
erikcheneece6c32015-07-07 22:13:1113 "attachment_broker_messages.h",
erikchen484c00842015-07-28 23:25:4414 "attachment_broker_privileged.cc",
15 "attachment_broker_privileged.h",
erikchenb3481e22015-10-06 19:59:3916 "attachment_broker_privileged_mac.cc",
17 "attachment_broker_privileged_mac.h",
erikchenc04ab34c2015-07-27 20:28:2018 "attachment_broker_privileged_win.cc",
19 "attachment_broker_privileged_win.h",
erikchen484c00842015-07-28 23:25:4420 "attachment_broker_unprivileged.cc",
21 "attachment_broker_unprivileged.h",
erikchenb3481e22015-10-06 19:59:3922 "attachment_broker_unprivileged_mac.cc",
23 "attachment_broker_unprivileged_mac.h",
erikchen484c00842015-07-28 23:25:4424 "attachment_broker_unprivileged_win.cc",
25 "attachment_broker_unprivileged_win.h",
erikchen151b2f92015-06-16 20:20:5126 "brokerable_attachment.cc",
27 "brokerable_attachment.h",
erikchen3ee5d55e32015-10-09 23:20:4928 "brokerable_attachment_mac.cc",
erikchena5085cda2015-09-15 17:26:2729 "brokerable_attachment_win.cc",
mdempsky8a519042016-02-09 05:41:4730 "export_template.h",
erikcheneece6c32015-07-07 22:13:1131 "handle_attachment_win.cc",
erikchen151b2f92015-06-16 20:20:5132 "handle_attachment_win.h",
erikchen959039d2015-08-11 21:17:4733 "handle_win.cc",
34 "handle_win.h",
[email protected]7603bbd12013-08-13 17:33:3735 "ipc_channel.cc",
36 "ipc_channel.h",
scottmg7c7296f42015-02-28 02:23:0937 "ipc_channel_common.cc",
[email protected]64860882014-08-04 23:44:1738 "ipc_channel_factory.cc",
39 "ipc_channel_factory.h",
[email protected]7603bbd12013-08-13 17:33:3740 "ipc_channel_handle.h",
41 "ipc_channel_nacl.cc",
42 "ipc_channel_nacl.h",
43 "ipc_channel_posix.cc",
44 "ipc_channel_posix.h",
45 "ipc_channel_proxy.cc",
46 "ipc_channel_proxy.h",
47 "ipc_channel_reader.cc",
48 "ipc_channel_reader.h",
49 "ipc_channel_win.cc",
50 "ipc_channel_win.h",
51 "ipc_descriptors.h",
erikchena09b9be72015-08-10 19:22:3352 "ipc_endpoint.cc",
53 "ipc_endpoint.h",
[email protected]7603bbd12013-08-13 17:33:3754 "ipc_export.h",
erikcheneece6c32015-07-07 22:13:1155 "ipc_handle_win.cc",
56 "ipc_handle_win.h",
[email protected]7603bbd12013-08-13 17:33:3757 "ipc_listener.h",
58 "ipc_logging.cc",
59 "ipc_logging.h",
60 "ipc_message.cc",
61 "ipc_message.h",
morrita98b7aaa2015-01-26 22:42:5462 "ipc_message_attachment.cc",
63 "ipc_message_attachment.h",
morrita4b5c28e22015-01-14 21:17:0664 "ipc_message_attachment_set.cc",
65 "ipc_message_attachment_set.h",
erikcheneece6c32015-07-07 22:13:1166 "ipc_message_generator.cc",
67 "ipc_message_generator.h",
[email protected]7603bbd12013-08-13 17:33:3768 "ipc_message_macros.h",
69 "ipc_message_start.h",
mdempsky8a519042016-02-09 05:41:4770 "ipc_message_templates.h",
71 "ipc_message_templates_impl.h",
[email protected]7603bbd12013-08-13 17:33:3772 "ipc_message_utils.cc",
73 "ipc_message_utils.h",
[email protected]7603bbd12013-08-13 17:33:3774 "ipc_platform_file.cc",
75 "ipc_platform_file.h",
morrita1aa788c2015-01-31 05:45:4276 "ipc_platform_file_attachment_posix.cc",
77 "ipc_platform_file_attachment_posix.h",
[email protected]7603bbd12013-08-13 17:33:3778 "ipc_sender.h",
79 "ipc_switches.cc",
80 "ipc_switches.h",
81 "ipc_sync_channel.cc",
82 "ipc_sync_channel.h",
83 "ipc_sync_message.cc",
84 "ipc_sync_message.h",
85 "ipc_sync_message_filter.cc",
86 "ipc_sync_message_filter.h",
erikchen1c1e6652015-10-01 18:51:3287 "mach_port_attachment_mac.cc",
88 "mach_port_attachment_mac.h",
89 "mach_port_mac.cc",
90 "mach_port_mac.h",
[email protected]74122042014-04-25 00:07:3091 "message_filter.cc",
92 "message_filter.h",
93 "message_filter_router.cc",
94 "message_filter_router.h",
markdittmer638a1492016-02-19 01:11:5095 "message_router.cc",
96 "message_router.h",
[email protected]7603bbd12013-08-13 17:33:3797 "param_traits_log_macros.h",
98 "param_traits_macros.h",
99 "param_traits_read_macros.h",
100 "param_traits_write_macros.h",
erikchen87351da2015-09-15 19:11:09101 "placeholder_brokerable_attachment.cc",
102 "placeholder_brokerable_attachment.h",
[email protected]7603bbd12013-08-13 17:33:37103 "struct_constructor_macros.h",
104 "struct_destructor_macros.h",
105 "unix_domain_socket_util.cc",
106 "unix_domain_socket_util.h",
107 ]
108
phosek636bceb32015-10-27 03:36:48109 if (is_nacl && !is_nacl_nonsfi) {
dpranke6065cf72015-02-26 03:30:58110 sources -= [
111 "ipc_channel.cc",
112 "ipc_channel_posix.cc",
113 "unix_domain_socket_util.cc",
114 ]
115 } else {
[email protected]7603bbd12013-08-13 17:33:37116 sources -= [
117 "ipc_channel_nacl.cc",
118 "ipc_channel_nacl.h",
119 ]
[email protected]517d5282014-04-02 17:03:30120 }
[email protected]7603bbd12013-08-13 17:33:37121
eugenebutc5e03292016-05-13 21:48:03122 if (is_win || is_nacl_nonsfi) {
scottmg34fb7e52014-12-03 23:27:24123 sources -= [ "unix_domain_socket_util.cc" ]
[email protected]7603bbd12013-08-13 17:33:37124 }
125
126 defines = [ "IPC_IMPLEMENTATION" ]
127
brettwb7f2c302015-12-08 01:29:21128 public_deps = [
129 ":param_traits",
130 ]
[email protected]7603bbd12013-08-13 17:33:37131 deps = [
132 "//base",
scottmg34fb7e52014-12-03 23:27:24133
[email protected]7603bbd12013-08-13 17:33:37134 # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
135 "//base/third_party/dynamic_annotations",
136 ]
Sergey Ulanov384a29c92015-09-14 17:11:35137
erikchen3ee5d55e32015-10-09 23:20:49138 if (is_win || is_mac) {
139 # On Windows HandleAttachmentWin needs to generate random IDs.
140 # On Mac MachPortAttachmentMac needs to generate random IDs.
Sergey Ulanov384a29c92015-09-14 17:11:35141 deps += [ "//crypto" ]
142 }
ochangcc11d0e2016-04-26 19:58:26143
144 if (enable_ipc_fuzzer) {
145 public_configs = [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
146 }
[email protected]7603bbd12013-08-13 17:33:37147}
148
brettwb7f2c302015-12-08 01:29:21149# This is provided as a separate target so other targets can provide param
150# traits implementations without necessarily linking to all of IPC.
151source_set("param_traits") {
152 public = [
153 "ipc_param_traits.h",
154 ]
155}
156
sdefresne6fd373e2016-05-24 21:24:06157if (!is_ios) {
158 test("ipc_tests") {
159 sources = [
160 "attachment_broker_mac_unittest.cc",
161 "attachment_broker_privileged_mac_unittest.cc",
162 "attachment_broker_privileged_win_unittest.cc",
163 "ipc_channel_posix_unittest.cc",
164 "ipc_channel_proxy_unittest.cc",
165 "ipc_channel_reader_unittest.cc",
166 "ipc_fuzzing_tests.cc",
167 "ipc_message_attachment_set_posix_unittest.cc",
168 "ipc_message_unittest.cc",
169 "ipc_message_utils_unittest.cc",
170 "ipc_sync_channel_unittest.cc",
171 "ipc_sync_message_unittest.cc",
172 "ipc_sync_message_unittest.h",
173 "ipc_test_message_generator.cc",
174 "ipc_test_message_generator.h",
175 "ipc_test_messages.h",
176 "run_all_unittests.cc",
177 "sync_socket_unittest.cc",
178 ]
pkotwicza553a3b2015-10-16 22:29:46179
sdefresne6fd373e2016-05-24 21:24:06180 if (!is_win && !is_ios) {
181 sources += [ "unix_domain_socket_util_unittest.cc" ]
182 }
183
184 if (!is_android) {
185 sources += [ "ipc_channel_unittest.cc" ]
186 }
187
188 if (!is_ios) {
189 sources += [ "ipc_send_fds_test.cc" ]
190 }
191
192 # TODO(brettw) hook up Android testing.
193 #if (is_android && gtest_target_type == "shared_library") {
194 # deps += "/testing/android/native_test.gyp:native_testNative_code"
195 #}
196
197 deps = [
198 ":ipc",
199 ":test_support",
200 "//base",
201 "//base:i18n",
202 "//base/test:test_support",
203 "//crypto",
204 "//testing/gtest",
205 ]
206
207 if (is_mac) {
208 deps += [ "//sandbox/mac:seatbelt" ]
209 }
dpranke177c1e22015-07-22 23:07:43210 }
211
sdefresne6fd373e2016-05-24 21:24:06212 test("ipc_perftests") {
213 sources = [
214 "ipc_perftests.cc",
215 ]
216
217 # TODO(brettw) hook up Android testing.
218 #if (is_android && gtest_target_type == "shared_library") {
219 # deps += "/testing/android/native_test.gyp:native_testNative_code"
220 #}
221
222 deps = [
223 ":ipc",
224 ":test_support",
225 "//base",
226 "//base:i18n",
227 "//base/test:test_support",
228 "//base/test:test_support_perf",
229 "//testing/gtest",
230 ]
brettwa59908d22016-01-21 19:16:48231 }
232
sdefresne6fd373e2016-05-24 21:24:06233 source_set("test_support") {
234 testonly = true
235 sources = [
236 "ipc_multiprocess_test.cc",
237 "ipc_multiprocess_test.h",
238 "ipc_perftest_support.cc",
239 "ipc_perftest_support.h",
240 "ipc_security_test_util.cc",
241 "ipc_security_test_util.h",
242 "ipc_test_base.cc",
243 "ipc_test_base.h",
244 "ipc_test_channel_listener.cc",
245 "ipc_test_channel_listener.h",
246 "ipc_test_sink.cc",
247 "ipc_test_sink.h",
248 "test_util_mac.cc",
249 "test_util_mac.h",
250 ]
251 public_deps = [
252 ":ipc",
253 ]
254 deps = [
255 "//base",
256 "//base/test:test_support",
257 "//testing/gtest",
258 ]
kerrneldc059fe2016-04-12 16:39:06259 }
pkotwicza553a3b2015-10-16 22:29:46260}