[reland] Support generation of component targets for Mojom C++ bindings

NOTE: Reland of https://chromium-review.googlesource.com/c/497830/,
with component dependency fixed. Variant components needed to depend
on the shared component. This also means struct *_Data classes need
to be exported, which in turn required moving all their method
definitions out-of-line. Furthermore, automatically generated shared
components (when using export_* parameters) need to be unique, so
this allows component_output_prefix to be set on such targets as well.

This allows developers to force the mojom GN template to emit a
component target for C++ bindings rather than a source_set and updates
some existing uses of the export_class_attribute etc parameters to use
explicit component generation instead.

This is a step towards using mojom component targets by default, but
that is currently impossible without additional GN support.

BUG=718098
TBR=jam@chromium.org
TBR=yzshen@chromium.org

Change-Id: I22e58a9fad78cc1fc40b23067d942082a4b14c0c
Reviewed-on: https://chromium-review.googlesource.com/504707
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#471334}

CrOS-Libchrome-Original-Commit: a999f951a26f1fece78238836b198999b0050ae6
9 files changed
tree: 3109f3cea963c5d90bbc35c6e5dbcbf89e30cb1c
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/