blob: 21cacd86750ef5ff78490d9729bc262b022a664a [file] [log] [blame]
Avi Drissmandb497b32022-09-15 19:47:281# Copyright 2015 The Chromium Authors
brettwf7eb6ca2015-02-14 01:37:312# 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")
Fabian Sommer295fb5d2022-08-22 10:25:046import("//components/nacl/toolchain.gni")
David Dorwinfb7128132022-04-26 01:36:517import("//ppapi/buildflags/buildflags.gni")
8
K. Moonf17e2162022-07-18 20:59:429assert(enable_ppapi)
phosek636bceb32015-10-27 03:36:4810
brettwf7eb6ca2015-02-14 01:37:3111config("proxy_implementation") {
12 defines = [ "PPAPI_PROXY_IMPLEMENTATION" ]
13}
14
Dirk Pranke9c0fc3b2020-08-06 16:01:3015component("proxy") {
brettwf7eb6ca2015-02-14 01:37:3116 output_name = "ppapi_proxy"
17
18 sources = [
19 # Take some standalone files from the C++ wrapper allowing us to more
20 # easily make async callbacks in the proxy. We can't depend on the
21 # full C++ wrappers at this layer since the C++ wrappers expect
22 # symbols defining the globals for "being a plugin" which we are not.
cfredric4757cd92021-07-12 21:23:1723 #
24 # These callback files are supposed to be standalone, but are not; see
25 # http://crbug.com/1228394.
brettwf7eb6ca2015-02-14 01:37:3126 "../cpp/completion_callback.h",
cfredric4757cd92021-07-12 21:23:1727 "../cpp/logging.h",
brettwf7eb6ca2015-02-14 01:37:3128 "../utility/completion_callback_factory.h",
29 "audio_buffer_resource.cc",
30 "audio_buffer_resource.h",
jchuang586e3db2015-02-25 05:17:5631 "camera_capabilities_resource.cc",
32 "camera_capabilities_resource.h",
33 "camera_device_resource.cc",
34 "camera_device_resource.h",
brettwf7eb6ca2015-02-14 01:37:3135 "dispatcher.cc",
brettwf7eb6ca2015-02-14 01:37:3136 "enter_proxy.h",
37 "error_conversion.cc",
38 "error_conversion.h",
39 "file_chooser_resource.cc",
40 "file_chooser_resource.h",
41 "file_io_resource.cc",
42 "file_io_resource.h",
brettwf7eb6ca2015-02-14 01:37:3143 "file_ref_resource.cc",
44 "file_ref_resource.h",
45 "file_system_resource.cc",
46 "file_system_resource.h",
47 "gamepad_resource.cc",
48 "gamepad_resource.h",
49 "graphics_2d_resource.cc",
50 "graphics_2d_resource.h",
51 "host_resolver_private_resource.cc",
brettwf7eb6ca2015-02-14 01:37:3152 "host_resolver_resource.cc",
53 "host_resolver_resource.h",
54 "host_resolver_resource_base.cc",
brettwf7eb6ca2015-02-14 01:37:3155 "interface_list.cc",
brettwf7eb6ca2015-02-14 01:37:3156 "interface_proxy.cc",
brettwf7eb6ca2015-02-14 01:37:3157 "isolated_file_system_private_resource.cc",
58 "isolated_file_system_private_resource.h",
59 "locking_resource_releaser.h",
60 "media_stream_audio_track_resource.cc",
61 "media_stream_audio_track_resource.h",
62 "media_stream_track_resource_base.cc",
63 "media_stream_track_resource_base.h",
64 "media_stream_video_track_resource.cc",
65 "media_stream_video_track_resource.h",
66 "message_handler.cc",
brettwf7eb6ca2015-02-14 01:37:3167 "net_address_resource.cc",
68 "net_address_resource.h",
69 "network_list_resource.cc",
brettwf7eb6ca2015-02-14 01:37:3170 "network_monitor_resource.cc",
71 "network_monitor_resource.h",
72 "network_proxy_resource.cc",
73 "network_proxy_resource.h",
brettwf7eb6ca2015-02-14 01:37:3174 "plugin_array_buffer_var.cc",
75 "plugin_array_buffer_var.h",
76 "plugin_dispatcher.cc",
brettwf7eb6ca2015-02-14 01:37:3177 "plugin_globals.cc",
78 "plugin_globals.h",
79 "plugin_message_filter.cc",
80 "plugin_message_filter.h",
81 "plugin_resource.cc",
brettwf7eb6ca2015-02-14 01:37:3182 "plugin_resource_tracker.cc",
83 "plugin_resource_tracker.h",
84 "plugin_resource_var.cc",
85 "plugin_resource_var.h",
86 "plugin_var_serialization_rules.cc",
87 "plugin_var_serialization_rules.h",
88 "plugin_var_tracker.cc",
brettwf7eb6ca2015-02-14 01:37:3189 "ppapi_command_buffer_proxy.cc",
90 "ppapi_command_buffer_proxy.h",
brettwf7eb6ca2015-02-14 01:37:3191 "ppb_audio_proxy.cc",
92 "ppb_audio_proxy.h",
93 "ppb_core_proxy.cc",
94 "ppb_core_proxy.h",
95 "ppb_graphics_3d_proxy.cc",
96 "ppb_graphics_3d_proxy.h",
97 "ppb_image_data_proxy.cc",
98 "ppb_image_data_proxy.h",
99 "ppb_instance_proxy.cc",
100 "ppb_instance_proxy.h",
101 "ppb_message_loop_proxy.cc",
102 "ppb_message_loop_proxy.h",
103 "ppb_testing_proxy.cc",
104 "ppb_testing_proxy.h",
brettwf7eb6ca2015-02-14 01:37:31105 "ppp_class_proxy.cc",
106 "ppp_class_proxy.h",
brettwf7eb6ca2015-02-14 01:37:31107 "ppp_graphics_3d_proxy.cc",
108 "ppp_graphics_3d_proxy.h",
109 "ppp_input_event_proxy.cc",
110 "ppp_input_event_proxy.h",
111 "ppp_instance_proxy.cc",
112 "ppp_instance_proxy.h",
113 "ppp_messaging_proxy.cc",
114 "ppp_messaging_proxy.h",
115 "ppp_mouse_lock_proxy.cc",
116 "ppp_mouse_lock_proxy.h",
brettwf7eb6ca2015-02-14 01:37:31117 "ppp_printing_proxy.cc",
118 "ppp_printing_proxy.h",
119 "ppp_text_input_proxy.cc",
120 "ppp_text_input_proxy.h",
121 "printing_resource.cc",
122 "printing_resource.h",
123 "proxy_array_output.cc",
124 "proxy_array_output.h",
125 "proxy_channel.cc",
brettwf7eb6ca2015-02-14 01:37:31126 "proxy_completion_callback_factory.h",
brettwf7eb6ca2015-02-14 01:37:31127 "proxy_object_var.cc",
128 "proxy_object_var.h",
129 "resource_creation_proxy.cc",
130 "resource_creation_proxy.h",
131 "resource_reply_thread_registrar.cc",
brettwf7eb6ca2015-02-14 01:37:31132 "tcp_server_socket_private_resource.cc",
133 "tcp_server_socket_private_resource.h",
134 "tcp_socket_private_resource.cc",
135 "tcp_socket_private_resource.h",
136 "tcp_socket_resource.cc",
137 "tcp_socket_resource.h",
138 "tcp_socket_resource_base.cc",
139 "tcp_socket_resource_base.h",
dmichaelb11ca7b2015-04-02 16:59:40140 "udp_socket_filter.cc",
141 "udp_socket_filter.h",
brettwf7eb6ca2015-02-14 01:37:31142 "udp_socket_private_resource.cc",
143 "udp_socket_private_resource.h",
144 "udp_socket_resource.cc",
145 "udp_socket_resource.h",
146 "udp_socket_resource_base.cc",
147 "udp_socket_resource_base.h",
148 "uma_private_resource.cc",
149 "uma_private_resource.h",
150 "url_loader_resource.cc",
151 "url_loader_resource.h",
152 "url_request_info_resource.cc",
153 "url_request_info_resource.h",
154 "url_response_info_resource.cc",
155 "url_response_info_resource.h",
dpranke6065cf72015-02-26 03:30:58156 "video_decoder_resource.cc",
157 "video_decoder_resource.h",
dpranke6065cf72015-02-26 03:30:58158 "video_encoder_resource.cc",
159 "video_encoder_resource.h",
brettwf7eb6ca2015-02-14 01:37:31160 "video_frame_resource.cc",
161 "video_frame_resource.h",
adrian.belgun0873bcb2016-06-08 10:00:55162 "vpn_provider_resource.cc",
163 "vpn_provider_resource.h",
brettwf7eb6ca2015-02-14 01:37:31164 "websocket_resource.cc",
165 "websocket_resource.h",
166 ]
167
168 if (is_nacl) {
Mark Seaborn0040a612022-04-08 17:42:50169 # Consistency check: Check that is_nacl_irt is set to true for this
170 # code that is built for the NaCl IRT. Previously, there was a bug
171 # where is_nacl_irt was not always set to true for builds of the NaCl
172 # IRT.
173 assert(is_nacl_irt)
174
brettwf7eb6ca2015-02-14 01:37:31175 sources += [
mseaborn770b3282015-07-21 16:37:57176 "../nacl_irt/irt_interfaces.cc",
177 "../nacl_irt/irt_interfaces.h",
mseabornd735c8b92015-07-22 02:55:07178 "../nacl_irt/irt_pnacl_translator_compile.cc",
179 "../nacl_irt/irt_pnacl_translator_link.cc",
brettwf7eb6ca2015-02-14 01:37:31180 "../nacl_irt/irt_ppapi.cc",
181 "../nacl_irt/irt_ppapi.h",
182 "../nacl_irt/irt_start.cc",
183 "../nacl_irt/manifest_service.cc",
184 "../nacl_irt/manifest_service.h",
brettwf7eb6ca2015-02-14 01:37:31185 "../nacl_irt/plugin_startup.cc",
186 "../nacl_irt/plugin_startup.h",
187 "../nacl_irt/ppapi_dispatcher.cc",
188 "../nacl_irt/ppapi_dispatcher.h",
189 ]
190 } else {
191 sources += [
192 "audio_input_resource.cc",
193 "audio_input_resource.h",
xzhang3a2a4702017-04-07 16:34:30194 "audio_output_resource.cc",
195 "audio_output_resource.h",
brettwf7eb6ca2015-02-14 01:37:31196 "browser_font_singleton_resource.cc",
197 "browser_font_singleton_resource.h",
198 "device_enumeration_resource_helper.cc",
199 "device_enumeration_resource_helper.h",
brettwf7eb6ca2015-02-14 01:37:31200 "host_dispatcher.cc",
201 "host_dispatcher.h",
202 "host_var_serialization_rules.cc",
203 "host_var_serialization_rules.h",
brettwf7eb6ca2015-02-14 01:37:31204 "ppb_buffer_proxy.cc",
bradnelson961324d2015-03-24 21:03:02205 "ppb_var_deprecated_proxy.cc",
206 "ppb_var_deprecated_proxy.h",
brettwf7eb6ca2015-02-14 01:37:31207 "ppb_video_decoder_proxy.cc",
208 "ppb_video_decoder_proxy.h",
John Abd-El-Malek38963ea42021-04-07 21:11:33209 "ppb_x509_certificate_private_proxy.cc",
210 "ppb_x509_certificate_private_proxy.h",
brettwf7eb6ca2015-02-14 01:37:31211 "ppp_instance_private_proxy.cc",
212 "ppp_instance_private_proxy.h",
213 "ppp_video_decoder_proxy.cc",
214 "ppp_video_decoder_proxy.h",
brettwf7eb6ca2015-02-14 01:37:31215 "video_capture_resource.cc",
216 "video_capture_resource.h",
brettwf7eb6ca2015-02-14 01:37:31217 ]
218 }
219
brettwbc8b2a22015-07-28 18:24:42220 configs += [
221 ":proxy_implementation",
222 "//build/config:precompiled_headers",
223 ]
brettwf7eb6ca2015-02-14 01:37:31224
brettwc17eb982015-11-27 22:52:49225 public_deps = [
rockot38e46dd2017-03-24 16:55:13226 "//ipc",
brettwc17eb982015-11-27 22:52:49227 "//ppapi/proxy:ipc_sources",
228 ]
229
brettwf7eb6ca2015-02-14 01:37:31230 deps = [
scottmg3cab0ba2017-01-25 18:34:16231 ":common",
brettwf7eb6ca2015-02-14 01:37:31232 "//base",
Fabian Sommer295fb5d2022-08-22 10:25:04233 "//components/nacl/common:buildflags",
Matt Reynolds7550995f2018-05-23 03:12:55234 "//device/base/synchronization",
235 "//device/gamepad/public/cpp:shared_with_blink",
Andrew Shulaevc8f936e2021-06-25 15:48:15236 "//gpu/command_buffer/client:client",
237 "//gpu/command_buffer/client:gles2_cmd_helper",
piman864ffa62016-06-27 21:00:01238 "//gpu/command_buffer/client:gles2_implementation",
Antoine Labourfeab2392017-12-21 20:28:39239 "//gpu/command_buffer/common",
piman864ffa62016-06-27 21:00:01240 "//gpu/ipc/common:command_buffer_traits",
brettwf7eb6ca2015-02-14 01:37:31241 "//media:shared_memory_support",
Ken Rockotf03d97c952018-07-04 22:08:10242 "//mojo/core/embedder",
brettwf7eb6ca2015-02-14 01:37:31243 "//ppapi/c",
brettwf7eb6ca2015-02-14 01:37:31244 "//ppapi/shared_impl",
Nico Weber7c271e92021-11-30 04:21:09245 "//third_party/icu",
pimanb36392c22016-07-13 02:11:36246 "//ui/gfx/geometry",
247 "//ui/gfx/ipc/geometry",
brettwf7eb6ca2015-02-14 01:37:31248 ]
249
Fabian Sommer295fb5d2022-08-22 10:25:04250 if (!is_nacl && !is_minimal_toolchain) {
dpranke6065cf72015-02-26 03:30:58251 deps += [
252 "//base/third_party/dynamic_annotations",
253 "//gin",
254 "//skia",
255 "//ui/events:events_base",
256 "//ui/surface",
257 ]
258 }
brettwf7eb6ca2015-02-14 01:37:31259}
260
scottmg3cab0ba2017-01-25 18:34:16261source_set("common") {
262 sources = [
scottmg3cab0ba2017-01-25 18:34:16263 "tcp_socket_resource_constants.h",
scottmg3cab0ba2017-01-25 18:34:16264 "udp_socket_resource_constants.h",
265 ]
Andrew Shulaevc8f936e2021-06-25 15:48:15266
267 deps = [ "//base:base" ]
scottmg3cab0ba2017-01-25 18:34:16268}
269
brettw542f7532015-04-06 22:35:45270group("ipc") {
271 if (is_component_build) {
Nico Weber2c451b532020-01-13 19:15:58272 public_deps = [ "//ppapi/proxy" ]
brettw542f7532015-04-06 22:35:45273 } else {
Nico Weber2c451b532020-01-13 19:15:58274 public_deps = [ ":ipc_sources" ]
brettw542f7532015-04-06 22:35:45275 }
276}
277
278source_set("ipc_sources") {
brettwf7eb6ca2015-02-14 01:37:31279 sources = [
Ari Chivukula1da866b2021-08-11 22:39:06280 "connection.h",
281 "dispatcher.h",
282 "host_resolver_private_resource.h",
283 "host_resolver_resource_base.h",
284 "interface_list.h",
285 "interface_proxy.h",
286 "message_handler.h",
brettwf7eb6ca2015-02-14 01:37:31287 "nacl_message_scanner.cc",
288 "nacl_message_scanner.h",
Ari Chivukula1da866b2021-08-11 22:39:06289 "network_list_resource.h",
290 "plugin_dispatcher.h",
291 "plugin_resource.h",
292 "plugin_var_tracker.h",
scottmg3cab0ba2017-01-25 18:34:16293 "ppapi_message_utils.h",
brettwf7eb6ca2015-02-14 01:37:31294 "ppapi_messages.cc",
295 "ppapi_messages.h",
296 "ppapi_param_traits.cc",
297 "ppapi_param_traits.h",
Ari Chivukula1da866b2021-08-11 22:39:06298 "ppb_buffer_proxy.h",
299 "proxy_channel.h",
brettwf7eb6ca2015-02-14 01:37:31300 "raw_var_data.cc",
301 "raw_var_data.h",
302 "resource_message_params.cc",
303 "resource_message_params.h",
Ari Chivukula1da866b2021-08-11 22:39:06304 "resource_reply_thread_registrar.h",
brettwf7eb6ca2015-02-14 01:37:31305 "serialized_handle.cc",
306 "serialized_handle.h",
307 "serialized_structs.cc",
308 "serialized_structs.h",
309 "serialized_var.cc",
310 "serialized_var.h",
311 "var_serialization_rules.h",
312 ]
brettwf7eb6ca2015-02-14 01:37:31313
314 configs += [ ":proxy_implementation" ]
315
316 deps = [
317 "//base",
fsamuel19acfae2016-03-22 05:38:24318 "//gpu/ipc/common:command_buffer_traits",
brettwf7eb6ca2015-02-14 01:37:31319 "//ppapi/c",
320 "//ppapi/shared_impl",
brettwf7eb6ca2015-02-14 01:37:31321 ]
rockot38e46dd2017-03-24 16:55:13322
Nico Weber2c451b532020-01-13 19:15:58323 public_deps = [ "//ipc" ]
rockot38e46dd2017-03-24 16:55:13324
Fabian Sommer295fb5d2022-08-22 10:25:04325 if (!is_nacl && !is_minimal_toolchain) {
miletus45effdc42015-08-05 00:29:18326 deps += [ "//skia" ]
dpranke6065cf72015-02-26 03:30:58327 }
brettwf7eb6ca2015-02-14 01:37:31328}
329
Dirk Pranke9c0fc3b2020-08-06 16:01:30330static_library("test_support") {
brettwf7eb6ca2015-02-14 01:37:31331 testonly = true
332
333 sources = [
334 "ppapi_proxy_test.cc",
335 "ppapi_proxy_test.h",
336 "resource_message_test_sink.cc",
337 "resource_message_test_sink.h",
338 ]
339
Nico Weber2c451b532020-01-13 19:15:58340 public_deps = [ ":proxy" ]
brettwf7eb6ca2015-02-14 01:37:31341 deps = [
342 "//base/test:test_support",
343 "//ipc",
344 "//ipc:test_support",
345 "//ppapi/proxy",
346 "//ppapi/shared_impl",
Andrew Shulaevc8f936e2021-06-25 15:48:15347 "//ppapi/shared_impl:test_support",
brettwf7eb6ca2015-02-14 01:37:31348 "//testing/gmock",
349 "//testing/gtest",
350 ]
351}