DescriptionMojom frontend: Compute, validate and populate struct field version info
We compute, validate and set the |min_version| field of StructField and the |version_info| array of MojomStruct in mojom_types.mojom.
In a nutshell we process the "MinVersion" attributes and perform the validation that is currently done in pack.py in the backend.
We do not yet compute the actual packing data and so the |offset| and |bit| fields of StructField and the |num_bytes| field of StructVersion are currently always set to 0.
We do not yet consume the data in the backend.
- In computed_data.go we repurposed the function ComputeDataForGenerators. It was originally going to be specifically for struct field packing data but now it is a master function that invokes whatever computations need to be done for each user defined type. (We also renamed it to ComputeFinalData).
For Structs it currently invokes ComputeVersionInfo() and ComputeFieldOffsets().
- Got rid of the invocation of ComputeEnumValueIntegers in parse_driver.go because now that is invoked from ComputeFinalData.
- Added some missing functionality to types.go that was needed.
- In serialization.go we set the min_version, offset, and bit fields of StructField. (For now the latter two are set to 0)
and we set the version_info field of MojomStruct.
- In user_defined_types.go we implemented ComputeVersionInfo()
BUG=#713
R=azani@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/6f7b1c9b36cc70a5170e87b0bc06ee9633e9f02a
Patch Set 1 #Patch Set 2 : More comments. #
Total comments: 2
Patch Set 3 : Rename ComputeDataForGenerators to ComputeFinalData #Messages
Total messages: 13 (8 generated)
|