 Chromium Code Reviews
 Chromium Code Reviews Issue 2762593002:
  Add --headless flag to Windows  (Closed)
    
  
    Issue 2762593002:
  Add --headless flag to Windows  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be | 
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. | 
| 4 | 4 | 
| 5 import("//build/config/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") | 
| 6 import("//headless/headless.gni") | 6 import("//headless/headless.gni") | 
| 7 import("//build/util/process_version.gni") | 7 import("//build/util/process_version.gni") | 
| 8 import("//mojo/public/tools/bindings/mojom.gni") | 8 import("//mojo/public/tools/bindings/mojom.gni") | 
| 9 import("//testing/test.gni") | 9 import("//testing/test.gni") | 
| 10 import("//tools/grit/grit_rule.gni") | 10 import("//tools/grit/grit_rule.gni") | 
| 11 import("//tools/grit/repack.gni") | 11 import("//tools/grit/repack.gni") | 
| 12 | 12 | 
| 13 config("headless_implementation") { | 13 config("headless_implementation") { | 
| 14 defines = [ "HEADLESS_IMPLEMENTATION" ] | 14 defines = [ "HEADLESS_IMPLEMENTATION" ] | 
| 15 | 15 | 
| 16 if (headless_use_embedded_resources) { | 16 if (headless_use_embedded_resources) { | 
| 17 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ] | 17 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ] | 
| 18 } | 18 } | 
| 19 } | 19 } | 
| 20 | 20 | 
| 21 group("headless") { | 21 group("headless_lib") { | 
| 22 deps = [ | 22 deps = [ | 
| 23 "//headless:headless_lib", | 23 "//headless:headless", | 
| 24 ] | 24 ] | 
| 25 } | 25 } | 
| 26 | 26 | 
| 27 repack("pak") { | 27 repack("pak") { | 
| 28 sources = [ | 28 sources = [ | 
| 29 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak" , | 29 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak" , | 
| 30 "$root_gen_dir/blink/public/resources/blink_resources.pak", | 30 "$root_gen_dir/blink/public/resources/blink_resources.pak", | 
| 31 "$root_gen_dir/components/strings/components_strings_en-US.pak", | 31 "$root_gen_dir/components/strings/components_strings_en-US.pak", | 
| 32 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", | 32 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", | 
| 33 "$root_gen_dir/content/app/strings/content_strings_en-US.pak", | 33 "$root_gen_dir/content/app/strings/content_strings_en-US.pak", | 
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 ] | 181 ] | 
| 182 | 182 | 
| 183 args = [ | 183 args = [ | 
| 184 "--protocol", | 184 "--protocol", | 
| 185 rebase_path(inputs[0], root_build_dir), | 185 rebase_path(inputs[0], root_build_dir), | 
| 186 "--output_dir", | 186 "--output_dir", | 
| 187 rebase_path(target_gen_dir) + "/public", | 187 rebase_path(target_gen_dir) + "/public", | 
| 188 ] | 188 ] | 
| 189 } | 189 } | 
| 190 | 190 | 
| 191 static_library("headless_lib") { | 191 component("headless") { | 
| 
Sami
2017/03/27 14:07:58
Can we still call this headless_lib? That's the co
 
dvallet
2017/03/28 02:35:59
From the component doc, it looks like it's prefera
 
Sami
2017/03/28 11:49:32
Okay, let's follow established convention then.
 | |
| 192 sources = generated_devtools_api + [ | 192 sources = generated_devtools_api + [ | 
| 193 "lib/browser/headless_browser_context_impl.cc", | 193 "lib/browser/headless_browser_context_impl.cc", | 
| 194 "lib/browser/headless_browser_context_impl.h", | 194 "lib/browser/headless_browser_context_impl.h", | 
| 195 "lib/browser/headless_browser_context_options.cc", | 195 "lib/browser/headless_browser_context_options.cc", | 
| 196 "lib/browser/headless_browser_context_options.h", | 196 "lib/browser/headless_browser_context_options.h", | 
| 197 "lib/browser/headless_browser_impl.cc", | 197 "lib/browser/headless_browser_impl.cc", | 
| 198 "lib/browser/headless_browser_impl.h", | 198 "lib/browser/headless_browser_impl.h", | 
| 199 "lib/browser/headless_browser_impl_mac.mm", | 199 "lib/browser/headless_browser_impl_mac.mm", | 
| 200 "lib/browser/headless_browser_main_parts_mac.mm", | 200 "lib/browser/headless_browser_main_parts_mac.mm", | 
| 201 "lib/browser/headless_browser_main_parts.cc", | 201 "lib/browser/headless_browser_main_parts.cc", | 
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 ] | 285 ] | 
| 286 } | 286 } | 
| 287 | 287 | 
| 288 deps = [ | 288 deps = [ | 
| 289 ":gen_devtools_client_api", | 289 ":gen_devtools_client_api", | 
| 290 ":version_header", | 290 ":version_header", | 
| 291 "//base", | 291 "//base", | 
| 292 "//components/crash/content/browser", | 292 "//components/crash/content/browser", | 
| 293 "//components/security_state/content", | 293 "//components/security_state/content", | 
| 294 "//components/security_state/core", | 294 "//components/security_state/core", | 
| 295 "//content/public/app:both", | |
| 296 "//content/public/browser", | |
| 297 "//content/public/child:child", | |
| 298 "//content/public/common", | 295 "//content/public/common", | 
| 299 "//content/public/common:service_names", | 296 "//content/public/common:service_names", | 
| 300 "//net", | 297 "//net", | 
| 301 "//services/service_manager/public/cpp", | 298 "//services/service_manager/public/cpp", | 
| 302 "//third_party/mesa:osmesa", | 299 "//third_party/mesa:osmesa", | 
| 303 "//ui/base", | 300 "//ui/base", | 
| 304 "//ui/compositor", | 301 "//ui/compositor", | 
| 305 "//ui/display", | 302 "//ui/display", | 
| 306 "//ui/events/devices", | 303 "//ui/events/devices", | 
| 307 "//url", | 304 "//url", | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 "public/domains/types_unittest.cc", | 340 "public/domains/types_unittest.cc", | 
| 344 "public/util/deterministic_dispatcher_test.cc", | 341 "public/util/deterministic_dispatcher_test.cc", | 
| 345 "public/util/error_reporter_unittest.cc", | 342 "public/util/error_reporter_unittest.cc", | 
| 346 "public/util/expedited_dispatcher_test.cc", | 343 "public/util/expedited_dispatcher_test.cc", | 
| 347 "public/util/generic_url_request_job_test.cc", | 344 "public/util/generic_url_request_job_test.cc", | 
| 348 "public/util/testing/fake_managed_dispatch_url_request_job.cc", | 345 "public/util/testing/fake_managed_dispatch_url_request_job.cc", | 
| 349 "public/util/testing/fake_managed_dispatch_url_request_job.h", | 346 "public/util/testing/fake_managed_dispatch_url_request_job.h", | 
| 350 ] | 347 ] | 
| 351 | 348 | 
| 352 deps = [ | 349 deps = [ | 
| 353 ":headless_lib", | 350 ":headless", | 
| 354 "//base/test:run_all_unittests", | 351 "//base/test:run_all_unittests", | 
| 355 "//base/test:test_support", | 352 "//base/test:test_support", | 
| 353 "//net", | |
| 356 "//testing/gmock", | 354 "//testing/gmock", | 
| 357 "//testing/gtest", | 355 "//testing/gtest", | 
| 358 ] | 356 ] | 
| 359 } | 357 } | 
| 360 | 358 | 
| 361 mojom("embedder_mojo_for_testing") { | 359 mojom("embedder_mojo_for_testing") { | 
| 362 sources = [ | 360 sources = [ | 
| 363 "lib/embedder_test.mojom", | 361 "lib/embedder_test.mojom", | 
| 364 ] | 362 ] | 
| 365 } | 363 } | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 420 "test/data/", | 418 "test/data/", | 
| 421 ] | 419 ] | 
| 422 | 420 | 
| 423 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] | 421 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] | 
| 424 | 422 | 
| 425 deps = [ | 423 deps = [ | 
| 426 ":embedder_mojo_for_testing", | 424 ":embedder_mojo_for_testing", | 
| 427 ":headless_browser_tests_pak", | 425 ":headless_browser_tests_pak", | 
| 428 "//base", | 426 "//base", | 
| 429 "//content/test:test_support", | 427 "//content/test:test_support", | 
| 430 "//headless:headless_lib", | 428 "//headless:headless", | 
| 431 "//testing/gmock", | 429 "//testing/gmock", | 
| 432 "//testing/gtest", | 430 "//testing/gtest", | 
| 433 ] | 431 ] | 
| 434 } | 432 } | 
| 435 | 433 | 
| 436 static_library("headless_shell_lib") { | 434 static_library("headless_shell_lib") { | 
| 437 sources = [ | 435 sources = [ | 
| 438 "app/headless_shell.cc", | 436 "app/headless_shell.cc", | 
| 439 "app/headless_shell.h", | 437 "app/headless_shell.h", | 
| 440 "app/headless_shell_switches.cc", | 438 "app/headless_shell_switches.cc", | 
| 441 "app/headless_shell_switches.h", | 439 "app/headless_shell_switches.h", | 
| 442 "app/shell_navigation_request.cc", | 440 "app/shell_navigation_request.cc", | 
| 443 "app/shell_navigation_request.h", | 441 "app/shell_navigation_request.h", | 
| 444 "public/headless_shell.h", | 442 "public/headless_shell.h", | 
| 445 ] | 443 ] | 
| 446 | 444 | 
| 447 deps = [ | 445 deps = [ | 
| 448 "//headless:headless_lib", | 446 ":headless", | 
| 447 "//content/public/browser", | |
| 448 "//content/public/common", | |
| 449 ] | 449 ] | 
| 450 | 450 | 
| 451 configs += [ ":headless_implementation" ] | 451 if (is_win) { | 
| 452 deps += [ | |
| 453 "//content:sandbox_helper_win", | |
| 454 "//sandbox", | |
| 455 ] | |
| 456 } | |
| 457 } | |
| 458 | |
| 459 static_library("headless_shell_child_lib") { | |
| 
Sami
2017/03/27 14:07:58
Is "child" the right name to be using here since c
 
dvallet
2017/03/28 02:35:59
This is only linked in chrome_child DLL, that's wh
 
Sami
2017/03/28 11:49:32
Ah, a little confusing but okay :)
 | |
| 460 sources = [ | |
| 461 "app/headless_shell.cc", | |
| 462 "app/headless_shell.h", | |
| 463 "app/headless_shell_switches.cc", | |
| 464 "app/headless_shell_switches.h", | |
| 465 "app/shell_navigation_request.cc", | |
| 466 "app/shell_navigation_request.h", | |
| 467 "public/headless_shell.h", | |
| 468 ] | |
| 469 | |
| 470 deps = [ | |
| 471 ":headless", | |
| 472 "//content/public/child:child", | |
| 
Sami
2017/03/27 14:07:58
Where's this dependency coming from? I didn't find
 
dvallet
2017/03/28 02:35:59
This pools the Ppapi plugging, I found it fitting
 | |
| 473 ] | |
| 452 } | 474 } | 
| 453 | 475 | 
| 454 executable("headless_shell") { | 476 executable("headless_shell") { | 
| 455 sources = [ | 477 sources = [ | 
| 456 "app/headless_shell_main.cc", | 478 "app/headless_shell_main.cc", | 
| 457 ] | 479 ] | 
| 458 | 480 | 
| 459 deps = [ | 481 deps = [ | 
| 460 "//headless:headless_shell_lib", | 482 ":headless_shell_lib", | 
| 483 "//content/public/app:both", | |
| 461 ] | 484 ] | 
| 462 | |
| 463 if (is_win) { | |
| 464 deps += [ | |
| 465 "//build/win:default_exe_manifest", | |
| 466 "//content:sandbox_helper_win", | |
| 467 "//sandbox", | |
| 468 ] | |
| 469 } | |
| 470 | |
| 471 configs += [ ":headless_implementation" ] | |
| 472 } | 485 } | 
| 473 | 486 | 
| 474 process_version("version_header") { | 487 process_version("version_header") { | 
| 475 template_file = "public/version.h.in" | 488 template_file = "public/version.h.in" | 
| 476 sources = [ | 489 sources = [ | 
| 477 "//build/util/LASTCHANGE", | 490 "//build/util/LASTCHANGE", | 
| 478 "//chrome/VERSION", | 491 "//chrome/VERSION", | 
| 479 ] | 492 ] | 
| 480 output = "$target_gen_dir/public/version.h" | 493 output = "$target_gen_dir/public/version.h" | 
| 481 } | 494 } | 
| 482 | 495 | 
| 483 executable("headless_example") { | 496 executable("headless_example") { | 
| 484 sources = [ | 497 sources = [ | 
| 485 "app/headless_example.cc", | 498 "app/headless_example.cc", | 
| 486 ] | 499 ] | 
| 487 | 500 | 
| 488 deps = [ | 501 deps = [ | 
| 489 "//headless:headless_shell_lib", | 502 ":headless_shell_lib", | 
| 503 "//content/public/app:both", | |
| 490 ] | 504 ] | 
| 491 } | 505 } | 
| OLD | NEW |