New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 651713 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Improve type safety of SetUpContext / TearDownContext in StructTraits

Project Member Reported by dcheng@chromium.org, Sep 30 2016

Issue description

Right now, it's just a void*, which results in fun casts.

It doesn't seem like any consumers actually need this polymorphism; we should have some way to statically declare what the context type of a StructTraits will be (perhaps in the typemap?)
 
Components: Internals>Mojo

Comment 2 by roc...@chromium.org, Oct 31 2017

Components: -Internals>Mojo Internals>Mojo>Bindings

Comment 3 by yzshen@chromium.org, Oct 31 2017

Now that we guarantee at most one call to each getter, we have reduced context usage significantly.

I searched "file:strcut_traits SetUpContext" and only 1 class is using it.

I wonder whether it is worth the effort to make the suggested changes. WDYT?

Comment 4 by roc...@chromium.org, Oct 31 2017

I found myself almost using SetUpContext again recently, but ended up not
needing it. I almost changed it to be more strongly typed in that CL
because I felt it was an improvement.

It may be worth leaving this bug open just in case, as I don't see any
downside to addressing the issue if anyone has cycles to do so at some
point. Does that sound reasonable?

Comment 5 by yzshen@chromium.org, Oct 31 2017

SGTM, thanks!
Cc: -roc...@chromium.org rockot@google.com
Cc: -yzshen@chromium.org
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)
Still relevant but not really high priority. FWIW the only remaining usage is for WTFString traits.

Sign in to add a comment