Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Issue 1805743003: Mojom frontend: Compute, validate and populate struct field version info (Closed)

Created:
4 years, 9 months ago by rudominer
Modified:
4 years, 9 months ago
Reviewers:
azani
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Mojom 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+968 lines, -68 lines) Patch
M mojom/mojom_parser/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M mojom/mojom_parser/mojom/computed_data.go View 1 2 4 chunks +48 lines, -18 lines 0 comments Download
M mojom/mojom_parser/mojom/types.go View 5 chunks +24 lines, -4 lines 0 comments Download
M mojom/mojom_parser/mojom/types_test.go View 1 chunk +23 lines, -0 lines 0 comments Download
M mojom/mojom_parser/mojom/user_defined_types.go View 1 2 7 chunks +226 lines, -2 lines 0 comments Download
M mojom/mojom_parser/mojom/user_defined_types_test.go View 1 chunk +39 lines, -0 lines 0 comments Download
A mojom/mojom_parser/parser/computed_data_test.go View 1 2 1 chunk +200 lines, -0 lines 0 comments Download
M mojom/mojom_parser/parser/parse_driver.go View 1 2 1 chunk +1 line, -6 lines 0 comments Download
M mojom/mojom_parser/serialization/serialization.go View 4 chunks +36 lines, -9 lines 0 comments Download
M mojom/mojom_parser/serialization/serialization_test.go View 1 2 6 chunks +369 lines, -29 lines 0 comments Download

Messages

Total messages: 13 (8 generated)
rudominer
Hi Alex, ptal.
4 years, 9 months ago (2016-03-18 00:44:10 UTC) #7
azani
https://codereview.chromium.org/1805743003/diff/60001/mojom/mojom_parser/mojom/computed_data.go File mojom/mojom_parser/mojom/computed_data.go (right): https://codereview.chromium.org/1805743003/diff/60001/mojom/mojom_parser/mojom/computed_data.go#newcode23 mojom/mojom_parser/mojom/computed_data.go:23: func (e *MojomEnum) ComputeDataForGenerators() error { How about ComputeSerializationData ...
4 years, 9 months ago (2016-03-18 01:05:52 UTC) #8
rudominer
ptal https://codereview.chromium.org/1805743003/diff/60001/mojom/mojom_parser/mojom/computed_data.go File mojom/mojom_parser/mojom/computed_data.go (right): https://codereview.chromium.org/1805743003/diff/60001/mojom/mojom_parser/mojom/computed_data.go#newcode23 mojom/mojom_parser/mojom/computed_data.go:23: func (e *MojomEnum) ComputeDataForGenerators() error { On 2016/03/18 ...
4 years, 9 months ago (2016-03-18 01:28:30 UTC) #10
azani
lgtm
4 years, 9 months ago (2016-03-18 18:20:53 UTC) #11
rudominer
4 years, 9 months ago (2016-03-18 18:40:42 UTC) #13
Message was sent while issue was closed.
Committed patchset #3 (id:80001) manually as
6f7b1c9b36cc70a5170e87b0bc06ee9633e9f02a (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698