Add comments about handling of some memory messages.
[chromium-blink-merge.git] / ipc / BUILD.gn
blob3fda6e4f811756880d51d688e2b02cd75b79fb0e
1 # 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.
5 import("//testing/test.gni")
7 component("ipc") {
8   sources = [
9     "attachment_broker.cc",
10     "attachment_broker.h",
11     "attachment_broker_messages.h",
12     "attachment_broker_privileged.cc",
13     "attachment_broker_privileged.h",
14     "attachment_broker_privileged_win.cc",
15     "attachment_broker_privileged_win.h",
16     "attachment_broker_unprivileged.cc",
17     "attachment_broker_unprivileged.h",
18     "attachment_broker_unprivileged_win.cc",
19     "attachment_broker_unprivileged_win.h",
20     "brokerable_attachment.cc",
21     "brokerable_attachment.h",
22     "handle_attachment_win.cc",
23     "handle_attachment_win.h",
24     "handle_win.cc",
25     "handle_win.h",
26     "ipc_channel.cc",
27     "ipc_channel.h",
28     "ipc_channel_common.cc",
29     "ipc_channel_factory.cc",
30     "ipc_channel_factory.h",
31     "ipc_channel_handle.h",
32     "ipc_channel_nacl.cc",
33     "ipc_channel_nacl.h",
34     "ipc_channel_posix.cc",
35     "ipc_channel_posix.h",
36     "ipc_channel_proxy.cc",
37     "ipc_channel_proxy.h",
38     "ipc_channel_reader.cc",
39     "ipc_channel_reader.h",
40     "ipc_channel_win.cc",
41     "ipc_channel_win.h",
42     "ipc_descriptors.h",
43     "ipc_endpoint.cc",
44     "ipc_endpoint.h",
45     "ipc_export.h",
46     "ipc_handle_win.cc",
47     "ipc_handle_win.h",
48     "ipc_listener.h",
49     "ipc_logging.cc",
50     "ipc_logging.h",
51     "ipc_message.cc",
52     "ipc_message.h",
53     "ipc_message_attachment.cc",
54     "ipc_message_attachment.h",
55     "ipc_message_attachment_set.cc",
56     "ipc_message_attachment_set.h",
57     "ipc_message_generator.cc",
58     "ipc_message_generator.h",
59     "ipc_message_macros.h",
60     "ipc_message_start.h",
61     "ipc_message_utils.cc",
62     "ipc_message_utils.h",
63     "ipc_param_traits.h",
64     "ipc_platform_file.cc",
65     "ipc_platform_file.h",
66     "ipc_platform_file_attachment_posix.cc",
67     "ipc_platform_file_attachment_posix.h",
68     "ipc_sender.h",
69     "ipc_switches.cc",
70     "ipc_switches.h",
71     "ipc_sync_channel.cc",
72     "ipc_sync_channel.h",
73     "ipc_sync_message.cc",
74     "ipc_sync_message.h",
75     "ipc_sync_message_filter.cc",
76     "ipc_sync_message_filter.h",
77     "message_filter.cc",
78     "message_filter.h",
79     "message_filter_router.cc",
80     "message_filter_router.h",
81     "param_traits_log_macros.h",
82     "param_traits_macros.h",
83     "param_traits_read_macros.h",
84     "param_traits_write_macros.h",
85     "struct_constructor_macros.h",
86     "struct_destructor_macros.h",
87     "unix_domain_socket_util.cc",
88     "unix_domain_socket_util.h",
89   ]
91   if (is_nacl) {
92     sources -= [
93       "ipc_channel.cc",
94       "ipc_channel_posix.cc",
95       "unix_domain_socket_util.cc",
96     ]
97   } else {
98     sources -= [
99       "ipc_channel_nacl.cc",
100       "ipc_channel_nacl.h",
101     ]
102   }
104   if (is_win || is_ios) {
105     sources -= [ "unix_domain_socket_util.cc" ]
106   }
108   defines = [ "IPC_IMPLEMENTATION" ]
110   deps = [
111     "//base",
113     # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
114     "//base/third_party/dynamic_annotations",
115     "//crypto:crypto",
116   ]
119 # TODO(GYP): crbug.com/360936. Get this to build and run on Android.
120 if (!is_android) {
121   group("ipc_tests_run") {
122     testonly = true
123     deps = [
124       ":ipc_tests",
125     ]
126   }
128   test("ipc_tests") {
129     sources = [
130       "attachment_broker_privileged_win_unittest.cc",
131       "attachment_broker_unprivileged_win_unittest.cc",
132       "ipc_channel_posix_unittest.cc",
133       "ipc_channel_proxy_unittest.cc",
134       "ipc_channel_reader_unittest.cc",
135       "ipc_channel_unittest.cc",
136       "ipc_fuzzing_tests.cc",
137       "ipc_message_attachment_set_posix_unittest.cc",
138       "ipc_message_unittest.cc",
139       "ipc_message_utils_unittest.cc",
140       "ipc_send_fds_test.cc",
141       "ipc_sync_channel_unittest.cc",
142       "ipc_sync_message_unittest.cc",
143       "ipc_sync_message_unittest.h",
144       "sync_socket_unittest.cc",
145       "unix_domain_socket_util_unittest.cc",
146     ]
148     if (is_win || is_ios) {
149       sources -= [ "unix_domain_socket_util_unittest.cc" ]
150     }
152     # TODO(brettw) hook up Android testing.
153     #if (is_android && gtest_target_type == "shared_library") {
154     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
155     #}
157     # TODO(brettw) hook up tcmalloc to this target.
158     #if (is_posix && !is_mac && !is_android) {
159     #  if (use_allocator!="none") {
160     #    deps += "/base/allocator"
161     #  }
162     #}
164     deps = [
165       ":ipc",
166       ":test_support",
167       "//base",
168       "//base:i18n",
169       "//base/test:run_all_unittests",
170       "//base/test:test_support",
171       "//testing/gtest",
172     ]
173   }
175   test("ipc_perftests") {
176     sources = [
177       "ipc_perftests.cc",
178     ]
180     # TODO(brettw) hook up Android testing.
181     #if (is_android && gtest_target_type == "shared_library") {
182     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
183     #}
185     # TODO(brettw) hook up tcmalloc to this target.
186     #if (is_posix && !is_mac && !is_android) {
187     #  if (use_allocator!="none") {
188     #    deps += "//base/allocator"
189     #  }
190     #}
191     deps = [
192       ":ipc",
193       ":test_support",
194       "//base",
195       "//base:i18n",
196       "//base/test:test_support",
197       "//base/test:test_support_perf",
198       "//testing/gtest",
199     ]
200   }
203 source_set("test_support") {
204   testonly = true
205   sources = [
206     "ipc_multiprocess_test.cc",
207     "ipc_multiprocess_test.h",
208     "ipc_perftest_support.cc",
209     "ipc_perftest_support.h",
210     "ipc_security_test_util.cc",
211     "ipc_security_test_util.h",
212     "ipc_test_base.cc",
213     "ipc_test_base.h",
214     "ipc_test_channel_listener.cc",
215     "ipc_test_channel_listener.h",
216     "ipc_test_sink.cc",
217     "ipc_test_sink.h",
218   ]
219   deps = [
220     ":ipc",
221     "//base",
222     "//base/test:test_support",
223     "//testing/gtest",
224   ]