Don't preload rarely seen large images
[chromium-blink-merge.git] / components / nacl / BUILD.gn
blob078a8769c228bc7b0db0018c0b7b346b9db57837
1 # Copyright (c) 2015 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("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
9 if (enable_nacl) {
10   source_set("nacl") {
11     sources = [
12       "loader/nacl_ipc_adapter.cc",
13       "loader/nacl_ipc_adapter.h",
14       "loader/nacl_listener.cc",
15       "loader/nacl_listener.h",
16       "loader/nacl_main.cc",
17       "loader/nacl_main_platform_delegate.h",
18       "loader/nacl_main_platform_delegate_linux.cc",
19       "loader/nacl_main_platform_delegate_mac.mm",
20       "loader/nacl_main_platform_delegate_win.cc",
21       "loader/nacl_trusted_listener.cc",
22       "loader/nacl_trusted_listener.h",
23       "loader/nacl_validation_db.h",
24       "loader/nacl_validation_query.cc",
25       "loader/nacl_validation_query.h",
26     ]
28     deps = [
29       ":nacl_common",
30       ":nacl_switches",
31       "//base",
32       "//base:base_static",
33       "//content/public/common",
34       "//crypto",
35       "//ipc",
36       "//native_client/src/trusted/service_runtime:sel_main_chrome",
37       "//ppapi/c",
38       "//ppapi/proxy:ipc",
39       "//ppapi/shared_impl",
40       "//third_party/mojo/src/mojo/edk/embedder",
41     ]
43     if (enable_nacl_untrusted) {
44       data_deps = [
45         # TODO(GYP): handle other architectures correctly.
46         "//ppapi/native_client:nacl_irt(//native_client/build/toolchain/nacl:irt_x64)",
47       ]
48     }
49     if (enable_pnacl) {
50       data_deps += [
51         # TODO(GYP): handle other architectures correctly.
52         "//ppapi/native_client/src/untrusted/pnacl_support_extension",
53       ]
54     }
55   }
57   source_set("nacl_browser") {
58     sources = [
59       "browser/bad_message.cc",
60       "browser/bad_message.h",
61       "browser/nacl_broker_host_win.cc",
62       "browser/nacl_broker_host_win.h",
63       "browser/nacl_broker_service_win.cc",
64       "browser/nacl_broker_service_win.h",
65       "browser/nacl_browser.cc",
66       "browser/nacl_browser.h",
67       "browser/nacl_file_host.cc",
68       "browser/nacl_file_host.h",
69       "browser/nacl_host_message_filter.cc",
70       "browser/nacl_host_message_filter.h",
71       "browser/nacl_process_host.cc",
72       "browser/nacl_process_host.h",
73       "browser/nacl_validation_cache.cc",
74       "browser/nacl_validation_cache.h",
75       "browser/pnacl_host.cc",
76       "browser/pnacl_host.h",
77       "browser/pnacl_translation_cache.cc",
78       "browser/pnacl_translation_cache.h",
79       "common/nacl_debug_exception_handler_win.cc",
80       "common/nacl_debug_exception_handler_win.h",
81     ]
83     deps = [
84       ":nacl_common",
85       ":nacl_switches",
86       ":nacl_helper",
87       "//base",
88       "//base/third_party/dynamic_annotations",
89       "//content/public/browser",
90       "//content/public/common",
91       "//ipc",
92       "//native_client/src/trusted/service_runtime:sel_main_chrome",
93       "//net",
94       "//ppapi/host",
95       "//ppapi/proxy:ipc",
96       "//ppapi/shared_impl",
97       "//sandbox/linux:sandbox_services",
98     ]
100     if (is_linux) {
101       sources += [
102         "zygote/nacl_fork_delegate_linux.cc",
103         "zygote/nacl_fork_delegate_linux.h",
104       ]
106       deps += [ "//sandbox/linux:suid_sandbox_client" ]
107     }
108   }
110   source_set("nacl_renderer") {
111     sources = [
112       "renderer/file_downloader.cc",
113       "renderer/file_downloader.h",
114       "renderer/histogram.cc",
115       "renderer/histogram.h",
116       "renderer/json_manifest.cc",
117       "renderer/json_manifest.h",
118       "renderer/manifest_downloader.cc",
119       "renderer/manifest_downloader.h",
120       "renderer/manifest_service_channel.cc",
121       "renderer/manifest_service_channel.h",
122       "renderer/nacl_helper.cc",
123       "renderer/nacl_helper.h",
124       "renderer/nexe_load_manager.cc",
125       "renderer/nexe_load_manager.h",
126       "renderer/platform_info.cc",
127       "renderer/platform_info.h",
128       "renderer/pnacl_translation_resource_host.cc",
129       "renderer/pnacl_translation_resource_host.h",
130       "renderer/ppb_nacl_private_impl.cc",
131       "renderer/ppb_nacl_private_impl.h",
132       "renderer/progress_event.cc",
133       "renderer/progress_event.h",
134       "renderer/trusted_plugin_channel.cc",
135       "renderer/trusted_plugin_channel.h",
136     ]
138     deps = [
139       ":nacl_common",
140       ":nacl_switches",
141       "renderer/plugin:nacl_trusted_plugin",
142       "//base",
143       "//content/public/common",
144       "//content/public/renderer",
145       "//ipc",
146       "//net",
147       "//ppapi/c",
148       "//ppapi/proxy:ipc",
149       "//ppapi/shared_impl",
150       "//third_party/WebKit/public:blink",
151       "//third_party/jsoncpp",
152     ]
153   }
155   test("nacl_loader_unittests") {
156     sources = [
157       "loader/nacl_ipc_adapter_unittest.cc",
158       "loader/nacl_validation_query_unittest.cc",
159       "loader/run_all_unittests.cc",
160     ]
162     deps = [
163       ":nacl",
164       "//base/test:test_support",
165       "//ipc:test_support",
166       "//testing/gtest",
167     ]
168   }
170   if (is_linux) {
171     executable("nacl_helper") {
172       sources = [
173         "loader/nacl_helper_linux.cc",
174         "loader/nacl_helper_linux.h",
175       ]
177       deps = [
178         ":nacl",
179         ":nacl_linux",
180         ":nacl_switches",
181         "//base",
182         "//content/public/common",
183         "//crypto",
184         "//ipc",
185         "//sandbox/linux:libc_urandom_override",
186       ]
188       cflags = [ "-fPIE" ]
190       ldflags = [ "-pie" ]
191     }
193     source_set("nacl_linux") {
194       sources = [
195         "//ppapi/nacl_irt/irt_manifest.h",
196         "//ppapi/nacl_irt/manifest_service.cc",
197         "//ppapi/nacl_irt/manifest_service.h",
198         "//ppapi/nacl_irt/plugin_main.cc",
199         "//ppapi/nacl_irt/plugin_main.h",
200         "//ppapi/nacl_irt/plugin_startup.cc",
201         "//ppapi/nacl_irt/plugin_startup.h",
202         "//ppapi/nacl_irt/ppapi_dispatcher.cc",
203         "//ppapi/nacl_irt/ppapi_dispatcher.h",
204         "loader/nonsfi/abi_conversion.cc",
205         "loader/nonsfi/abi_conversion.h",
206         "loader/nonsfi/elf_loader.cc",
207         "loader/nonsfi/elf_loader.h",
208         "loader/nonsfi/irt_basic.cc",
209         "loader/nonsfi/irt_clock.cc",
210         "loader/nonsfi/irt_exception_handling.cc",
211         "loader/nonsfi/irt_fdio.cc",
212         "loader/nonsfi/irt_futex.cc",
213         "loader/nonsfi/irt_icache.cc",
214         "loader/nonsfi/irt_interfaces.cc",
215         "loader/nonsfi/irt_interfaces.h",
216         "loader/nonsfi/irt_memory.cc",
217         "loader/nonsfi/irt_ppapi.cc",
218         "loader/nonsfi/irt_random.cc",
219         "loader/nonsfi/irt_resource_open.cc",
220         "loader/nonsfi/irt_thread.cc",
221         "loader/nonsfi/irt_util.h",
222         "loader/nonsfi/nonsfi_listener.cc",
223         "loader/nonsfi/nonsfi_listener.h",
224         "loader/nonsfi/nonsfi_main.cc",
225         "loader/nonsfi/nonsfi_main.h",
226         "loader/nonsfi/nonsfi_sandbox.cc",
227         "loader/nonsfi/nonsfi_sandbox.h",
228         "loader/sandbox_linux/nacl_bpf_sandbox_linux.cc",
229         "loader/sandbox_linux/nacl_sandbox_linux.cc",
230       ]
232       defines = [ "IN_NACL_HELPER=1" ]
234       deps = [
235         ":nacl",
236         ":nacl_common",
237         ":nacl_switches",
238         "//base",
239         "//components/tracing",
240         "//content/public/common",
241         "//crypto",
242         "//ipc",
243         "//ppapi/c",
244         "//ppapi/proxy",
245         "//ppapi/shared_impl",
246         "//sandbox",
247         "//sandbox/linux:libc_urandom_override",
248         "//sandbox/linux:sandbox_services_headers",
249       ]
251       if (use_glib) {
252         configs += [ "//build/config/linux:glib" ]
253       }
255       if (use_seccomp_bpf) {
256         defines += [ "USE_SECCOMP_BPF" ]
257       }
258     }
259   }
260 } else {
261   group("nacl") {
262   }
265 source_set("nacl_switches") {
266   sources = [
267     "common/nacl_switches.cc",
268     "common/nacl_switches.h",
269   ]
272 source_set("nacl_common") {
273   sources = [
274     "common/nacl_cmd_line.cc",
275     "common/nacl_cmd_line.h",
276     "common/nacl_constants.cc",
277     "common/nacl_constants.h",
278     "common/nacl_host_messages.cc",
279     "common/nacl_host_messages.h",
280     "common/nacl_messages.cc",
281     "common/nacl_messages.h",
282     "common/nacl_nonsfi_util.cc",
283     "common/nacl_nonsfi_util.h",
284     "common/nacl_process_type.h",
285     "common/nacl_renderer_messages.cc",
286     "common/nacl_renderer_messages.h",
287     "common/nacl_sandbox_type.h",
288     "common/nacl_types.cc",
289     "common/nacl_types.h",
290     "common/nacl_types_param_traits.cc",
291     "common/nacl_types_param_traits.h",
292     "common/pnacl_types.cc",
293     "common/pnacl_types.h",
294   ]
296   deps = [
297     ":nacl_switches",
298     "//base",
299     "//content/public/common",
300     "//ipc",
301     "//url",
302   ]
304   if (is_linux) {
305     sources += [
306       "common/nacl_paths.cc",
307       "common/nacl_paths.h",
308     ]
310     defines = [ "__STDC_LIMIT_MACROS=1" ]
311   }