• Chris Cunningham's avatar
    Cleanup deps on //services/viz/public/mojom:mojom_blink · 2d9076ee
    Chris Cunningham authored
    //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}
    2d9076ee
BUILD.gn 79.8 KB