Currently, if Blink and Chromium want to access the same struct_traits.h to do
conversion between mojom types and user custom types, we can only templatize
StructTraits so that the following function
static bool Read(typename T::DataView data, UserCustomType* out);
can be applied to both Blink mojom type and Chromium mojom type.
This raises a concern: making all these struct_traits templated will cause code
bloating in headers, as many Read() functions are long and are better separated
in .cc implementation files.
A refactoring in mojo internals to let Chromium and Blink variants share the same
DataView would be helpful for mojo users from Blink. It would be good if the
StructTraits can specialize with DataView.
Comment 1 by xlai@chromium.org
, Jul 27 2016