MeasureAs on IDL `attribute` - any reasons for low use counter?

3 views
Skip to first unread message

David Van Cleve

unread,
Sep 10, 2020, 11:57:50 AM9/10/20
to blink-reviews-bindings, zhe...@google.com
Hi from Seattle!

I'm looking at some launch metrics including UKM from a MeasureAs IDL attribute on an HTMLIframeElement member:

[RuntimeEnabled=TrustTokens, SecureContext, Reflect, MeasureAs=TrustTokenIframe] attribute DOMString trustToken;

We're seeing lower numbers on the UseCounter than we expected (by a few orders of magnitude). From looking at the binding, does anything stick out that might explain this? 

(We're separately looking for reasons why the JS that we expect to be setting the attribute might not be setting it.)

Thanks!


Yuki Shiino

unread,
Sep 10, 2020, 2:01:34 PM9/10/20
to David Van Cleve, blink-reviews-bindings, zhe...@google.com
I quickly checked the generated bindings code, but it looks normal to me.

Do you see that the count has dropped drastically and/or recently?  Or do you see just a lower count than you expect?

[RuntimeEnabled=TrustTokens], where TrustTokens is an origin trial feature, should have very low usage, I think.  [SecureContext] restricts it to https only, and it may lower the count.

We've recently made a big change in Blink-V8 bindings (new Web IDL compiler), but it's in M86 (not yet stable).  So, it's unlikely that the change affected you.  As far as I remember, we've not made other major changes, especially about [MeasureAs], these months.

Or ... web sites might misuse the origin trial feature?  Since it's iframe related, web sites could be confused whether they should specify the origin trial feature to the parent window or the child (iframe) window?

Also note that <iframe trustToken="..."> won't be counted because it's not using the IDL attribute.

Lastly, I don't have a good sense in this area, but looking at https://www.chromestatus.com/metrics/feature/popularity , TrustTokenIframe's count looks similar to other minor (no offense) features.

Cheers,
Yuki Shiino


2020年9月11日(金) 0:57 David Van Cleve <dav...@chromium.org>:

David Van Cleve

unread,
Sep 10, 2020, 2:47:05 PM9/10/20
to Yuki Shiino, blink-reviews-bindings, Zheng Wei
Thanks!

Looks like the answer for us is that our biggest user doesn't trigger the UseCounter because their code uses Element.setAttribute('trusttoken', /* value */); rather than directly setting the attribute.

Has it been suggested before to extend the default MeasureAs use counters to cover the following by default?
1) cases like <iframe trusttoken="...">
2) cases like const iframe = ...; iframe.setAttribute('trusttoken', ...);

At least as a first-time Blink feature author, it surprised me that there were ways to set the attribute that did not trigger the use counter.

Yuki Shiino

unread,
Sep 10, 2020, 3:13:23 PM9/10/20
to David Van Cleve, Yuki Shiino, blink-reviews-bindings, Zheng Wei
It doesn't make sense because you may want to measure the usage of setFoo specifically without counting changeFoo when you're planning to deprecate setFoo in favor of changeFoo.  [MeasureAs] is designed to measure usage of a specific API, not a feature.

If you just want to measure usage of a certain feature, then you can add UseCount() in the implementation internals.

Also, generally speaking, HTML content attributes and Web IDL attributes are different concepts, like DOM and JS are different.

Cheers,
Yuki Shiino


2020年9月11日(金) 3:47 David Van Cleve <dav...@chromium.org>:

David Van Cleve

unread,
Sep 10, 2020, 3:15:44 PM9/10/20
to Yuki Shiino, blink-reviews-bindings, Zheng Wei
Got it.

Thanks for the quick responses!
Reply all
Reply to author
Forward
0 new messages