DescriptionMojom frontend: Implement computeFieldOffsets().
We compute and serialize the |offset| and |bit| fields of StructField and the |num_bytes| field of StructVersion. In a nutshell we have ported the field packing logic from pack.py in the backend to the frontend.
This is part 2 of the work initiated in https://codereview.chromium.org/1805743003/.
We do not yet consume the data in the backend.
- We moved ComputeVersionInfo() out of user_defined_types.go into computed_data.go because we intend for computed_data.go to encapsulate all of the final data computation.
- In computed_data.go we implement computeFieldOffsets.
- We added the methods SerializationSize() and SerializationAlignment() to the interfaces TypeRef and UserDefinedType.
BUG=#713
R=azani@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/0bbfd71ec4b7dbc48d3673b25b513082b17792c3
Patch Set 1 #
Total comments: 8
Patch Set 2 : Responds to code review and adds more test cases. #Patch Set 3 : Another comment and more tests. #
Messages
Total messages: 11 (5 generated)
|