1 # Copyright 2015 The Chromium Authors
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/c++/c++.gni")
6 import("//build/config/chrome_build.gni")
7 import("//build/config/python.gni")
8 import("//build/util/lastchange.gni")
9 import("//build/util/process_version.gni")
10 import("//headless/headless.gni")
11 import("//mojo/public/tools/bindings/mojom.gni")
12 import("//pdf/features.gni")
13 import("//printing/buildflags/buildflags.gni")
14 import("//testing/test.gni")
15 import("//third_party/closure_compiler/compile_js.gni")
16 import("//third_party/inspector_protocol/inspector_protocol.gni")
17 import("//tools/grit/grit_rule.gni")
18 import("//tools/grit/repack.gni")
19 import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
21 if (headless_use_policy) {
22 assert(headless_use_prefs,
23 "'headless_use_policy' requires 'headless_use_prefs'.")
26 # Headless defines config applied to every target below.
27 config("headless_defines_config") {
30 if (headless_use_prefs) {
31 defines += [ "HEADLESS_USE_PREFS" ]
34 if (headless_use_policy) {
35 defines += [ "HEADLESS_USE_POLICY" ]
38 if (headless_mode_policy_supported) {
39 defines += [ "HEADLESS_MODE_POLICY_SUPPORTED" ]
43 # For code inside the build component "headless".
44 config("inside_headless_component") {
45 defines = [ "HEADLESS_IMPLEMENTATION" ]
48 group("headless_lib") {
49 deps = [ ":headless_non_renderer" ]
52 repack("resource_pack_data") {
54 "$root_gen_dir/components/components_resources.pak",
55 "$root_gen_dir/content/content_resources.pak",
56 "$root_gen_dir/content/dev_ui_content_resources.pak",
57 "$root_gen_dir/net/net_resources.pak",
58 "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
59 "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
60 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
61 "$root_gen_dir/ui/resources/webui_generated_resources.pak",
65 "//components/resources:components_resources",
66 "//content:content_resources",
67 "//content:dev_ui_content_resources",
68 "//net:net_resources",
69 "//third_party/blink/public:resources",
70 "//third_party/blink/public:scaled_resources_100_percent",
74 output = "$root_out_dir/headless_lib_data.pak"
77 repack("resource_pack_strings") {
79 "$root_gen_dir/components/strings/components_strings_en-US.pak",
80 "$root_gen_dir/third_party/blink/public/strings/blink_strings_en-US.pak",
81 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
82 "$root_gen_dir/ui/strings/ax_strings_en-US.pak",
83 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
86 if (is_chrome_branded) {
87 sources += [ "${root_gen_dir}/components/strings/components_google_chrome_strings_en-US.pak" ]
89 sources += [ "${root_gen_dir}/components/strings/components_chromium_strings_en-US.pak" ]
93 "//components/strings",
94 "//third_party/blink/public/strings",
100 [ "$root_gen_dir/content/browser/devtools/devtools_resources.pak" ]
101 deps += [ "//content/browser/devtools:devtools_resources" ]
104 output = "$root_out_dir/headless_lib_strings.pak"
107 action("embedded_resource_pack_data") {
108 # TODO(altimin): Consider zipping file here, it can reduce size up to 80%.
109 script = "lib/embed_data.py"
111 inputs = [ "$root_out_dir/headless_lib_data.pak" ]
114 "$root_gen_dir/headless/embedded_resource_pack_data.cc",
115 "$root_gen_dir/headless/embedded_resource_pack_data.h",
120 rebase_path("$root_out_dir/headless_lib_data.pak", root_build_dir),
122 rebase_path("$root_gen_dir", root_build_dir),
124 "headless/embedded_resource_pack_data.h",
126 "headless/embedded_resource_pack_data.cc",
130 "kHeadlessResourcePackData",
133 deps = [ ":resource_pack_data" ]
136 action("embedded_resource_pack_strings") {
137 # TODO(altimin): Consider zipping file here, it can reduce size up to 80%.
138 script = "lib/embed_data.py"
140 inputs = [ "$root_out_dir/headless_lib_strings.pak" ]
143 "$root_gen_dir/headless/embedded_resource_pack_strings.cc",
144 "$root_gen_dir/headless/embedded_resource_pack_strings.h",
149 rebase_path("$root_out_dir/headless_lib_strings.pak", root_build_dir),
151 rebase_path("$root_gen_dir", root_build_dir),
153 "headless/embedded_resource_pack_strings.h",
155 "headless/embedded_resource_pack_strings.cc",
159 "kHeadlessResourcePackStrings",
162 deps = [ ":resource_pack_strings" ]
174 "device_orientation",
181 "headless_experimental",
201 generated_devtools_api_sources = []
202 generated_devtools_api_headers = []
203 foreach(domain, devtools_domains) {
204 generated_devtools_api_headers += [
205 "$target_gen_dir/public/devtools/domains/" + domain + ".h",
206 "$target_gen_dir/public/devtools/domains/types_" + domain + ".h",
207 "$target_gen_dir/public/devtools/internal/type_conversions_" + domain +
209 "$target_gen_dir/public/devtools/internal/" +
210 "types_forward_declarations_" + domain + ".h",
212 generated_devtools_api_sources += [
213 "$target_gen_dir/public/devtools/domains/" + domain + ".cc",
214 "$target_gen_dir/public/devtools/domains/types_" + domain + ".cc",
218 action("gen_devtools_client_api") {
219 script = "lib/browser/devtools_api/client_api_generator.py"
222 "//third_party/blink/public/devtools_protocol:protocol_version",
225 "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
228 outputs = generated_devtools_api_headers + generated_devtools_api_sources
230 "lib/browser/devtools_api/domain_cc.template",
231 "lib/browser/devtools_api/domain_h.template",
232 "lib/browser/devtools_api/domain_type_conversions_h.template",
233 "lib/browser/devtools_api/domain_types_cc.template",
234 "lib/browser/devtools_api/domain_types_forward_declarations_h.template",
235 "lib/browser/devtools_api/domain_types_h.template",
240 rebase_path(inputs[0], root_build_dir),
242 rebase_path(target_gen_dir, root_build_dir) + "/public",
246 inspector_protocol_generate("protocol_sources") {
248 ":backend_cdp_bindings",
249 ":gen_devtools_client_api",
251 deps = [ "//third_party/blink/public/devtools_protocol:protocol_version" ]
252 _blink_protocol_path = rebase_path(
253 "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
256 inspector_protocol_dir = "//third_party/inspector_protocol"
257 out_dir = target_gen_dir
258 config_file = "protocol_config.json"
259 config_values = [ "protocol.path=$_blink_protocol_path" ]
260 use_embedder_types = true
263 "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
267 # These are relative to $target_gen_dir.
269 "lib/browser/protocol/browser.cc",
270 "lib/browser/protocol/browser.h",
271 "lib/browser/protocol/headless_experimental.cc",
272 "lib/browser/protocol/headless_experimental.h",
273 "lib/browser/protocol/page.cc",
274 "lib/browser/protocol/page.h",
275 "lib/browser/protocol/target.cc",
276 "lib/browser/protocol/target.h",
277 "lib/browser/protocol/protocol.h",
281 static_library("backend_cdp_bindings") {
285 "//third_party/inspector_protocol:crdtp",
287 sources = get_target_outputs(":protocol_sources")
288 visibility = [ ":headless_non_renderer" ]
290 ":headless_defines_config",
291 ":inside_headless_component",
295 # Code needed in both processes. Only exposed through the |headless_renderer|
296 # target and the |headless_non_renderer| component.
297 source_set("headless_shared_sources") {
299 ":headless_non_renderer",
300 ":headless_renderer",
305 "app/headless_shell_switches.cc",
306 "app/headless_shell_switches.h",
307 "lib/headless_content_client.cc",
308 "lib/headless_content_client.h",
309 "lib/headless_content_main_delegate.cc",
310 "lib/headless_content_main_delegate.h",
311 "public/headless_browser.cc",
312 "public/headless_browser.h",
313 "public/headless_export.h",
314 "public/internal/headless_devtools_client_impl.h",
315 "public/internal/message_dispatcher.h",
316 "public/internal/value_conversions.h",
317 "public/util/error_reporter.cc",
318 "public/util/error_reporter.h",
319 "public/util/user_agent.cc",
320 "public/util/user_agent.h",
323 sources += generated_devtools_api_headers + generated_devtools_api_sources
327 "lib/headless_crash_reporter_client.cc",
328 "lib/headless_crash_reporter_client.h",
333 ":gen_devtools_client_api",
335 "//base:base_static",
336 "//components/embedder_support/origin_trials",
337 "//content/public/common",
344 "//components/crash/content/browser",
345 "//components/crash/core/app",
349 deps += [ "//sandbox" ]
352 configs += [ ":inside_headless_component" ]
353 configs += [ ":headless_defines_config" ]
355 # TODO(caseq): this is only here because headless_content_main_delegate.cc is here.
356 # Move it to the browser-specific part.
357 if (headless_use_embedded_resources) {
358 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ]
360 ":embedded_resource_pack_data",
361 ":embedded_resource_pack_strings",
364 "$root_gen_dir/headless/embedded_resource_pack_data.cc",
365 "$root_gen_dir/headless/embedded_resource_pack_data.h",
366 "$root_gen_dir/headless/embedded_resource_pack_strings.cc",
367 "$root_gen_dir/headless/embedded_resource_pack_strings.h",
372 # Code that is not needed in a renderer process.
373 component("headless_non_renderer") {
375 "lib/browser/headless_browser_context_impl.cc",
376 "lib/browser/headless_browser_context_impl.h",
377 "lib/browser/headless_browser_context_options.cc",
378 "lib/browser/headless_browser_context_options.h",
379 "lib/browser/headless_browser_impl.cc",
380 "lib/browser/headless_browser_impl.h",
381 "lib/browser/headless_browser_main_parts.cc",
382 "lib/browser/headless_browser_main_parts.h",
383 "lib/browser/headless_devtools.cc",
384 "lib/browser/headless_devtools.h",
385 "lib/browser/headless_devtools_agent_host_client.cc",
386 "lib/browser/headless_devtools_agent_host_client.h",
387 "lib/browser/headless_devtools_client_impl.cc",
388 "lib/browser/headless_devtools_manager_delegate.cc",
389 "lib/browser/headless_devtools_manager_delegate.h",
390 "lib/browser/headless_permission_manager.cc",
391 "lib/browser/headless_permission_manager.h",
392 "lib/browser/headless_platform_event_source.cc",
393 "lib/browser/headless_platform_event_source.h",
394 "lib/browser/headless_quota_permission_context.cc",
395 "lib/browser/headless_quota_permission_context.h",
396 "lib/browser/headless_request_context_manager.cc",
397 "lib/browser/headless_request_context_manager.h",
398 "lib/browser/headless_select_file_dialog_factory.cc",
399 "lib/browser/headless_select_file_dialog_factory.h",
400 "lib/browser/headless_web_contents_impl.cc",
401 "lib/browser/headless_web_contents_impl.h",
402 "lib/browser/headless_window_tree_host.h",
403 "lib/browser/protocol/browser_handler.cc",
404 "lib/browser/protocol/browser_handler.h",
405 "lib/browser/protocol/domain_handler.h",
406 "lib/browser/protocol/headless_devtools_session.cc",
407 "lib/browser/protocol/headless_devtools_session.h",
408 "lib/browser/protocol/headless_handler.cc",
409 "lib/browser/protocol/headless_handler.h",
410 "lib/browser/protocol/page_handler.cc",
411 "lib/browser/protocol/page_handler.h",
412 "lib/browser/protocol/target_handler.cc",
413 "lib/browser/protocol/target_handler.h",
414 "public/headless_browser_context.h",
415 "public/headless_devtools_channel.h",
416 "public/headless_devtools_client.h",
417 "public/headless_devtools_target.h",
418 "public/headless_web_contents.h",
423 "lib/browser/headless_browser_impl_mac.mm",
424 "lib/browser/headless_browser_main_parts_mac.mm",
425 "lib/browser/headless_shell_application_mac.h",
426 "lib/browser/headless_shell_application_mac.mm",
430 if (is_linux || is_chromeos || is_tizen) {
431 sources += [ "lib/browser/headless_browser_main_parts_linux.cc" ]
434 if (headless_use_policy) {
436 "lib/browser/headless_pref_names.cc",
437 "lib/browser/headless_pref_names.h",
438 "lib/browser/policy/headless_browser_policy_connector.cc",
439 "lib/browser/policy/headless_browser_policy_connector.h",
440 "lib/browser/policy/headless_mode_policy.cc",
441 "lib/browser/policy/headless_mode_policy.h",
442 "lib/browser/policy/headless_policies.cc",
443 "lib/browser/policy/headless_policies.h",
449 "lib/browser/headless_browser_impl_aura.cc",
450 "lib/browser/headless_clipboard.cc",
451 "lib/browser/headless_clipboard.h",
452 "lib/browser/headless_focus_client.cc",
453 "lib/browser/headless_focus_client.h",
454 "lib/browser/headless_screen.cc",
455 "lib/browser/headless_screen.h",
456 "lib/browser/headless_window_parenting_client.cc",
457 "lib/browser/headless_window_parenting_client.h",
458 "lib/browser/headless_window_tree_host.cc",
463 ":headless_shared_sources",
472 if (enable_basic_printing) {
473 public_deps += [ "//skia" ]
477 ":backend_cdp_bindings",
479 "//base:base_static",
480 "//build:branding_buildflags",
481 "//build:chromeos_buildflags",
482 "//components/cookie_config",
483 "//components/embedder_support",
484 "//components/keyed_service/content",
485 "//components/os_crypt:os_crypt",
486 "//components/policy:generated",
487 "//components/policy/core/browser",
488 "//components/policy/core/common:common_constants",
489 "//components/pref_registry",
490 "//components/prefs",
491 "//components/profile_metrics",
492 "//components/security_state/core",
493 "//content/public/app",
494 "//content/public/browser",
495 "//content/public/common",
496 "//printing/buildflags",
497 "//services/cert_verifier/public/mojom",
498 "//services/device/public/cpp/geolocation",
499 "//services/service_manager/public/cpp",
500 "//third_party/inspector_protocol:crdtp",
502 "//ui/base/clipboard",
505 "//ui/events/devices",
507 "//ui/shell_dialogs",
511 if (enable_basic_printing) {
513 "//components/printing/browser",
514 "//components/printing/browser/headless",
515 "//components/printing/browser/print_to_pdf:print_to_pdf",
516 "//components/printing/common:mojo_interfaces",
522 if (headless_use_prefs) {
524 "//components/origin_trials:browser",
525 "//components/origin_trials:common",
526 "//components/user_prefs",
527 "//third_party/blink/public/common",
531 if (is_component_build) {
533 "lib/browser/headless_content_browser_client.cc",
534 "lib/browser/headless_content_browser_client.h",
535 "lib/renderer/headless_content_renderer_client.cc",
536 "lib/renderer/headless_content_renderer_client.h",
537 "lib/utility/headless_content_utility_client.cc",
538 "lib/utility/headless_content_utility_client.h",
542 sources += [ "lib/headless_content_main_delegate_mac.mm" ]
545 if (enable_basic_printing) {
547 "lib/renderer/headless_print_render_frame_helper_delegate.cc",
548 "lib/renderer/headless_print_render_frame_helper_delegate.h",
553 "//components/crash/core/common",
554 "//components/security_state/content",
556 "//third_party/blink/public:blink",
563 "//components/crash/content/browser",
564 "//components/crash/core/app",
568 if (enable_basic_printing) {
570 "//components/printing/browser",
571 "//components/printing/renderer",
572 "//components/services/print_compositor",
573 "//components/services/print_compositor/public/mojom",
577 if (headless_use_prefs) {
578 deps += [ "//components/os_crypt" ]
581 if (headless_use_policy) {
582 deps += [ "//components/policy/content" ]
586 if (is_linux || is_chromeos) {
587 data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]
590 # Normally set to false (see build/args/headless.gn), but we can optionally
591 # use external v8 startup data too.
592 if ((!is_win || is_component_build) && v8_use_external_startup_data) {
593 public_deps += [ "//v8" ]
594 if (use_v8_context_snapshot) {
595 data += [ "$root_out_dir/$v8_context_snapshot_filename" ]
596 data_deps += [ "//tools/v8_context_snapshot" ]
598 data += [ "$root_out_dir/snapshot_blob.bin" ]
603 deps += [ ":mac_helpers" ]
606 "CoreFoundation.framework",
609 deps += [ "//ui/aura" ]
612 if (headless_use_embedded_resources) {
613 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ]
615 ":embedded_resource_pack_data",
616 ":embedded_resource_pack_strings",
619 "$root_gen_dir/headless/embedded_resource_pack_data.cc",
620 "$root_gen_dir/headless/embedded_resource_pack_data.h",
621 "$root_gen_dir/headless/embedded_resource_pack_strings.cc",
622 "$root_gen_dir/headless/embedded_resource_pack_strings.h",
626 ":resource_pack_data",
627 ":resource_pack_strings",
632 deps += [ "//ui/ozone" ]
636 defines += [ "USE_DBUS" ]
637 deps += [ "//device/bluetooth" ]
640 configs += [ ":inside_headless_component" ]
641 configs += [ ":headless_defines_config" ]
644 # Headless renderer is a convenience library for non component builds that
645 # includes headless classes that depend on the renderer.
646 if (!is_component_build) {
647 static_library("headless_renderer") {
650 "lib/browser/headless_web_contents_impl.cc",
651 "lib/browser/headless_web_contents_impl.h",
652 "lib/renderer/headless_content_renderer_client.cc",
653 "lib/renderer/headless_content_renderer_client.h",
654 "lib/utility/headless_content_utility_client.cc",
655 "lib/utility/headless_content_utility_client.h",
659 sources += [ "lib/headless_content_main_delegate_mac.mm" ]
662 if (enable_basic_printing) {
664 "lib/renderer/headless_print_render_frame_helper_delegate.cc",
665 "lib/renderer/headless_print_render_frame_helper_delegate.h",
669 public_deps = [ ":headless_shared_sources" ]
672 "//build:chromeos_buildflags",
673 "//components/crash/core/common",
674 "//components/security_state/content",
675 "//components/security_state/core",
676 "//content/public/app",
677 "//content/public/browser",
678 "//content/public/common",
679 "//content/public/renderer",
680 "//content/public/utility",
681 "//printing/buildflags",
682 "//third_party/blink/public:blink_headers",
688 deps += [ "//ui/ozone" ]
690 if (enable_basic_printing) {
692 "//components/printing/browser/headless:headless",
693 "//components/printing/renderer",
694 "//components/services/print_compositor",
695 "//components/services/print_compositor/public/mojom",
698 configs += [ ":headless_defines_config" ]
699 if (is_mac || is_win || is_linux || is_chromeos) {
700 deps += [ "//components/crash/core/app" ]
704 # For component builds all dependencies are already included in the headless
706 group("headless_renderer") {
707 public_deps = [ ":headless_non_renderer" ]
711 group("headless_tests") {
715 ":headless_browsertests",
717 ":headless_unittests",
721 test("headless_unittests") {
723 "public/domains/types_unittest.cc",
724 "public/util/error_reporter_unittest.cc",
726 # Headers for code under test that aren't normally exposed.
727 "public/headless_export.h",
728 "public/util/error_reporter.h",
731 # Headers for generated API code under test.
732 sources += generated_devtools_api_headers
737 ":gen_devtools_client_api",
738 ":headless_non_renderer",
739 ":headless_shell_lib",
740 "//base/test:run_all_unittests",
741 "//base/test:test_support",
742 "//components/security_state/content",
743 "//content/public/app",
744 "//content/public/child:child",
745 "//content/public/common",
751 deps += [ "//components/crash/core/app:crash_export_thunks" ]
754 if (enable_basic_printing) {
756 "//components/printing/browser",
757 "//components/printing/browser/headless",
759 "//printing/buildflags",
760 "//third_party/blink/public:blink",
764 configs += [ ":headless_defines_config" ]
768 copy("mac_helpers") {
769 sources = [ "$root_out_dir/chrome_crashpad_handler" ]
771 deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
773 outputs = [ "$root_out_dir/Helpers/{{source_file_part}}" ]
777 test("headless_browsertests") {
779 "//net:net_test_config",
780 "//tools/v8_context_snapshot:use_v8_context_snapshot",
781 "//v8:external_startup_data",
784 "test/headless_browser_browsertest.cc",
785 "test/headless_browser_context_browsertest.cc",
786 "test/headless_browser_test.cc",
787 "test/headless_browser_test.h",
788 "test/headless_client_browsertest.cc",
789 "test/headless_devtools_client_browsertest.cc",
790 "test/headless_origin_trials_browsertest.cc",
791 "test/headless_test_launcher.cc",
792 "test/headless_web_contents_browsertest.cc",
793 "test/test_network_interceptor.cc",
794 "test/test_network_interceptor.h",
797 if (enable_basic_printing && enable_pdf) {
798 sources += [ "test/headless_printtopdf_browsertest.cc" ]
801 if (headless_use_policy) {
803 "test/headless_policy_browsertest.cc",
804 "test/headless_policy_browsertest.h",
808 # TODO(crbug.com/1318548): Enable on Fuchsia when no longer flakily timeout.
811 "test/headless_compositor_browsertest.cc",
812 "test/headless_protocol_browsertest.cc",
813 "test/headless_protocol_browsertest.h",
819 "test/dom_tree_extraction_expected_nodes.txt",
820 "test/dom_tree_extraction_expected_styles.txt",
821 "$root_out_dir/headless_lib_data.pak",
822 "$root_out_dir/headless_lib_strings.pak",
823 "//net/tools/testserver/",
824 "//third_party/blink/web_tests/http/tests/inspector-protocol/",
825 "//third_party/pywebsocket3/",
831 # TODO(https://crbug.com/1185811): Investigate removing the requirement for
832 # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
833 test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
835 additional_manifest_fragments = [
836 "//build/config/fuchsia/test/fonts.shard.test-cml",
837 "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
838 "//build/config/fuchsia/test/network.shard.test-cml",
839 "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
844 data_deps += [ ":mac_helpers" ]
847 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
850 ":headless_shell_lib",
853 "//components/policy/core/browser",
854 "//components/security_state/content",
855 "//content/test:browsertest_support",
856 "//content/test:test_support",
858 "//net:test_support",
860 "//printing/buildflags",
861 "//services/device/public/cpp:test_support",
862 "//services/network/public/mojom",
865 "//ui/base/clipboard",
866 "//ui/shell_dialogs",
870 deps += [ "//services/device/public/cpp:test_support" ]
874 deps += [ "//third_party/crashpad/crashpad/client" ]
877 if (enable_basic_printing) {
879 "//components/printing/browser",
888 if (headless_use_policy) {
889 deps += [ "//components/policy/core/common:test_support" ]
892 configs += [ ":headless_defines_config" ]
896 # Headless library with only browser dependencies. This is used when no child
897 # dependencies are needed in the target (e.g. chrome:main_dll).
898 static_library("headless_shell_browser_lib") {
900 "app/headless_shell.cc",
901 "app/headless_shell.h",
902 "app/headless_shell_switches.h",
903 "lib/browser/headless_content_browser_client.cc",
904 "lib/browser/headless_content_browser_client.h",
905 "public/headless_shell.h",
908 ":headless_non_renderer",
909 "//build:branding_buildflags",
910 "//components/crash/core/app:app",
911 "//components/crash/core/app:run_as_crashpad_handler",
912 "//components/embedder_support",
913 "//content:sandbox_helper_win",
914 "//content/public/app",
915 "//content/public/browser",
916 "//content/public/common",
918 "//printing/buildflags",
921 if (headless_use_policy) {
922 deps += [ "//components/policy/content" ]
924 if (enable_basic_printing) {
925 deps += [ "//components/printing/browser/headless:headless" ]
927 configs += [ ":headless_defines_config" ]
931 # Headless library with all included dependencies. Use this library unless you
932 # have browser/child dependencies restrictions.
933 static_library("headless_shell_lib") {
935 "app/headless_shell.cc",
936 "app/headless_shell.h",
937 "app/headless_shell_switches.h",
938 "public/headless_shell.h",
942 if (!is_component_build) {
944 "lib/browser/headless_content_browser_client.cc",
945 "lib/browser/headless_content_browser_client.h",
946 "lib/utility/headless_content_utility_client.cc",
947 "lib/utility/headless_content_utility_client.h",
952 "//build:branding_buildflags",
953 "//components/embedder_support",
954 "//components/policy/content",
955 "//components/security_state/content",
957 "//content/public/app",
958 "//content/public/browser",
959 "//content/public/child:child",
960 "//content/public/common",
961 "//content/public/utility",
962 "//printing/buildflags",
966 ":headless_renderer",
968 "//third_party/inspector_protocol:crdtp",
971 if (!is_component_build) {
972 public_deps += [ ":headless_non_renderer" ]
976 deps += [ "//components/crash/content/browser" ]
979 if (enable_basic_printing) {
981 "//components/printing/browser",
982 "//components/printing/browser/headless:headless",
983 "//components/printing/renderer",
984 "//components/services/print_compositor",
985 "//components/services/print_compositor/public/mojom",
989 if (headless_use_policy && !is_component_build) {
990 deps += [ "//components/policy/content" ]
994 defines = [ "HEADLESS_USE_CRASHPAD" ]
997 "//components/crash/core/app:run_as_crashpad_handler",
998 "//content:sandbox_helper_win",
1004 deps += [ "//components/os_crypt" ]
1007 if (is_win || (is_posix && !is_mac)) {
1008 deps += [ "//components/crash/core/app" ]
1011 configs += [ ":headless_defines_config" ]
1014 executable("headless_shell") {
1015 configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
1016 configs += [ "//build/config/compiler:thinlto_optimize_max" ]
1018 sources = [ "app/headless_shell_main.cc" ]
1021 deps = [ ":headless_shell_lib" ]
1023 if (!headless_use_embedded_resources) {
1025 "$root_out_dir/headless_lib_data.pak",
1026 "$root_out_dir/headless_lib_strings.pak",
1032 "//build/win:default_exe_manifest",
1033 "//content/public/app",
1038 deps += [ "//sandbox/mac:seatbelt" ]
1041 configs += [ ":headless_defines_config" ]
1044 process_version("version_header") {
1045 template_file = "public/version.h.in"
1050 output = "$target_gen_dir/public/version.h"
1053 executable("headless_example") {
1054 sources = [ "app/headless_example.cc" ]
1058 ":headless_shell_lib",
1061 "//skia", # we need this to override font render hinting in headless build
1062 "//ui/gfx/geometry",
1066 deps += [ "//content/public/app" ]
1069 configs += [ ":headless_defines_config" ]