Currently, in Mus, we convert cc types back and forth including full CompositorFrames. This seems like a lot of unnecessary overhead. We should use ParamTraits or StructTraits instead.
Chatting with rockot@ offline, it sounds like StructTraits are the way forward, and we can place them alongside ParamTraits. Of course, cc ParamTraits live in content currently, so it seems like good housekeeping to move those traits to cc/ipc or something in the spirit of the content modularization effort.
I'm curious about the statement of StructTraits vs ParamTraits.
If the structures in question need to be sent from languages other than C++, then definitely we want to have the one definition in mojom files and we can use StructTraits to map to other existing C++ classes.
If the structures in question are in classes that also have useful methods but are only called by C++, that's a reason why we can't just move the definition to mojom. In that case, using ParamTraits is less work than ParamTraits (i.e. don't have to specify the structure twice).
Can you expand on which of the above cases (or a different one) applies here?
I want to get to a point where the one true versions are in mojoms. I want to use StructTraits to C++ once StructTraits are ready. The classes do indeed have useful methods however and they should move to elsewhere over time.
Got it. If the end goal is to get to the one definition being in mojom, that's the best solution. StructTraits can be used as a temporary bridge until that happens.
Comment 1 by fsam...@chromium.org
, May 13 2016