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

Issue 1915413002: Mojom frontend: Detect Ill-founded Types (Closed)

Created:
4 years, 7 months ago by rudominer
Modified:
4 years, 7 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: Detect Ill-founded Types This patch adds the functionality to detect user-defined types that are unserializable because every instance of the type would contain a cycle. We use the ill-founded node detection algorithm from https://codereview.chromium.org/1908273003/ by having UserDefinedTypeBase implement the |Node| interface. - In mojom_descriptor.go we add the method DetectIllFoundedTypes() - We Invoke DetectIllFoundedTypes()in parse_driver.go after ComputeFinalData() - We add the method NonAvoidableUserDefinedType() to the TypeRef interface to capture the notion that a type reference unavoidably entails a non-null pointer to a struct or union. -We fixed up some ill-founded types that appeared in serialization_test.go because now we would be detecting them and failing before serialization. - We enhanced the ill-founded graph detection library (in wellfounded_graphs.go) by introducing the ability for the client to add labels to the edges. The labels are opaque to the algorithm but we use them to maintain enough information to generate a useful error message. For example we use them to capture the name of the struct or union field corresponding to a graph edge. - See illfounded_types_test.go to see the format of the error messages we will emit when an ill-founded type is detected. BUG= fixes #694 R=azani@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/4c234209f3b34950d174f76c22c4ca8d20a49b9f

Patch Set 1 #

Total comments: 9

Patch Set 2 : Fix comments as per code review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+850 lines, -103 lines) Patch
A mojom/mojom_tool/integration_tests/illfounded_types_test.go View 1 chunk +474 lines, -0 lines 0 comments Download
M mojom/mojom_tool/mojom/mojom_descriptor.go View 1 4 chunks +46 lines, -0 lines 0 comments Download
M mojom/mojom_tool/mojom/types.go View 1 7 chunks +64 lines, -0 lines 0 comments Download
M mojom/mojom_tool/mojom/user_defined_types.go View 5 chunks +131 lines, -0 lines 0 comments Download
M mojom/mojom_tool/parser/parse_driver.go View 1 chunk +6 lines, -1 line 0 comments Download
M mojom/mojom_tool/serialization/serialization_test.go View 1 9 chunks +24 lines, -4 lines 0 comments Download
M mojom/mojom_tool/utils/wellfounded_graphs.go View 13 chunks +88 lines, -81 lines 0 comments Download
M mojom/mojom_tool/utils/wellfounded_graphs_test.go View 9 chunks +17 lines, -17 lines 0 comments Download

Messages

Total messages: 16 (11 generated)
rudominer
Hi Alex, ptal.
4 years, 7 months ago (2016-04-27 23:05:25 UTC) #10
azani
just some minor comments. https://codereview.chromium.org/1915413002/diff/120001/mojom/mojom_tool/mojom/mojom_descriptor.go File mojom/mojom_tool/mojom/mojom_descriptor.go (right): https://codereview.chromium.org/1915413002/diff/120001/mojom/mojom_tool/mojom/mojom_descriptor.go#newcode312 mojom/mojom_tool/mojom/mojom_descriptor.go:312: testingMode bool Can we add ...
4 years, 7 months ago (2016-04-28 22:37:13 UTC) #11
rudominer
ptal https://codereview.chromium.org/1915413002/diff/120001/mojom/mojom_tool/mojom/mojom_descriptor.go File mojom/mojom_tool/mojom/mojom_descriptor.go (right): https://codereview.chromium.org/1915413002/diff/120001/mojom/mojom_tool/mojom/mojom_descriptor.go#newcode312 mojom/mojom_tool/mojom/mojom_descriptor.go:312: testingMode bool On 2016/04/28 22:37:13, azani wrote: > ...
4 years, 7 months ago (2016-04-29 00:27:02 UTC) #12
azani
lgtm https://codereview.chromium.org/1915413002/diff/120001/mojom/mojom_tool/mojom/mojom_descriptor.go File mojom/mojom_tool/mojom/mojom_descriptor.go (right): https://codereview.chromium.org/1915413002/diff/120001/mojom/mojom_tool/mojom/mojom_descriptor.go#newcode312 mojom/mojom_tool/mojom/mojom_descriptor.go:312: testingMode bool On 2016/04/29 00:27:02, rudominer wrote: > ...
4 years, 7 months ago (2016-04-29 00:31:48 UTC) #13
rudominer
4 years, 7 months ago (2016-04-29 01:02:55 UTC) #16
Message was sent while issue was closed.
Committed patchset #2 (id:140001) manually as
4c234209f3b34950d174f76c22c4ca8d20a49b9f (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698