Commit 2d9076ee authored by Chris Cunningham's avatar Chris Cunningham Committed by Commit Bot

Cleanup deps on //services/viz/public/mojom:mojom_blink

//services/viz/public/mojom:mojom_blink is multiply included when
building blink_unittests.

  A) it's built into the blink_unittests executable
  B) it's built into the blink_platform component, which is a dep of
     blink_unittests

This multiple inclusion lead to double definition errors[1] when I tried
to add a new test[2] in blink_unittests.

The test uses media/mojo/mojom/video_decode_perf_history.mojom-blink.h,
generated by //media/mojo/mojom:mojom_blink.

//media/mojo/mojom:mojom_blink is *already* a dep of blink_unittests via
this chain through blink_platform (component)

  //third_party/blink/renderer/controller:blink_unittests
  //third_party/blink/renderer/controller:blink_unittests_sources
  //third_party/blink/renderer/platform:platform
  //third_party/blink/renderer/platform:blink_platform_public_deps
  //third_party/blink/public/mojom:mojom_platform_blink
  //media/mojo/mojom:mojom_blink

//media/mojo/mojom:mojom_blink is *also* a dep of
//services/viz/public/mojom:mojom_blink, which is built directly into
blink_unittests as a source_set.

  //third_party/blink/renderer/controller:blink_unittests
  //third_party/blink/renderer/controller:blink_unittests_sources
  //third_party/blink/renderer/modules:unit_tests
  //services/viz/public/mojom:mojom_blink
  //media/mojo/mojom:mojom_blink

This explains the error[1]

FAILED: blink_unittests.exe
ninja -t msvc ...
lld-link: error: duplicate symbol: public: __thiscall
media::mojom::blink::PredictionFeatures::PredictionFeatures(void)
>defined at obj/media/mojo/mojom/mojom_blink/media_types.mojom-blink.obj
>defined at blink_platform.dll

Hence, this CL removes multiple inclusion by deleting rules that cause
//services/viz/public/mojom:mojom_blink to be directly built into the
blink_unittests executable.

The blink_platform component is now the sole provider of
//services/viz/public/mojom:mojom_blink to blink_unittests.

This also required small export_* additions to the viz BUILD.gn to give
the viz mojom symbols visibility outside the blink_platform component.
Those changes were also made to gpu's BUILD.gn because blink_unittests
had come to rely on the viz dependency to provide unexported gpu
symbols.

[1] https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8886718386427952624/+/steps/compile__with_patch_/0/stdout
[2] https://chromium-review.googlesource.com/c/chromium/src/+/2088494

Change-Id: I1a7cd262f09a08c532479e44572f50360a6ebc40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088493Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Auto-Submit: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747568}
parent 4c119481
......@@ -225,6 +225,10 @@ mojom("interfaces") {
if (use_x11) {
enabled_features += [ "use_x11" ]
}
export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
export_header_blink = "third_party/blink/public/platform/web_common.h"
}
mojom("gpu_preferences_interface") {
......
......@@ -54,4 +54,8 @@ mojom("mojom") {
if (is_chromeos) {
public_deps += [ "//components/chromeos_camera/common" ]
}
export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
export_header_blink = "third_party/blink/public/platform/web_common.h"
}
......@@ -467,7 +467,6 @@ jumbo_source_set("unit_tests") {
"//media:test_support",
"//net:quic_test_tools",
"//services/device/public/cpp:test_support",
"//services/viz/public/mojom:mojom_blink",
"//skia",
"//testing/gmock",
"//testing/gtest",
......
......@@ -1959,7 +1959,6 @@ jumbo_source_set("blink_platform_unittests_sources") {
"//mojo/public/cpp/test_support:test_utils",
"//mojo/public/interfaces/bindings/tests:test_interfaces_blink",
"//services/viz/public/mojom",
"//services/viz/public/mojom:mojom_blink",
"//skia",
"//skia:skcms",
"//skia:test_fonts",
......@@ -2254,7 +2253,6 @@ jumbo_source_set("unit_tests") {
deps = [
":test_support",
"//services/viz/public/mojom:mojom_blink",
"//testing/gmock",
"//testing/gtest",
]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment