Though Glean global is available in privileged "about:" contexts, none of the instrumentation APIs can be called due to CreateWrapperDeniedForOrigin errors
Categories
(Toolkit :: Telemetry, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox119 | --- | fixed |
People
(Reporter: chutten, Assigned: chutten)
References
Details
Attachments
(7 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
I neglected to test beyond "Glean and GleanPings are available in privileged about contexts" and thus missed that no instrumentation APIs actually work. Trying e.g. Glean.aCategory.aName.record() returns Permission denied for <%2$S> to create wrapper for object of class %1$S.
Nika explains that XPCOM-wrapped JS isn't allowed in content contexts, regardless of privilege. So it seems as though we're going to have to go full webidl to make this work:
- Move
dom/chrome-webidl/interfaces todom/webidl/and replace[ChromeOnly]with[Func="nsGlobalWindowInner::IsGleanNeeded"] - Move interfaces out of
t/c/g/xpcom/nsIGleanMetrics.idltowebidl/, rewriting to webidl (no moreAUTF8String. Learn to loveDOMString. And drop thosensIprefixes. AndnsISupportsis nowanyorobject.) - Reimplement moved interfaces in new headers that you reference in
dom/bindings/Bindings.conf - Basically follow https://firefox-source-docs.mozilla.org/dom/webIdlBindings/index.html and see what happens.
It'd be nice if we could do this piecemeal, starting with only supporting Event since that's the interesting one, but I'm getting a sinking feeling that we'll have to convert this all in one go.
| Assignee | ||
Comment 1•3 years ago
|
||
Since we're exposing Glean types in not-chrome-only contexts like privileged
"about:" pages, we can't live in chrome-webidl/ any longer.
| Assignee | ||
Comment 2•3 years ago
|
||
Depends on D186266
| Assignee | ||
Comment 3•3 years ago
|
||
ni?nika -- Is https://phabricator.services.mozilla.com/D186267 about right? I'm specifically wondering how much of my cargo cult is needed (can I just... drop? nsISupports? if we're not doing XPCOMish things?), whether my hunch about using metrics' WrapObject to generate the JSObject for Category and Labeled's NamedGetters are in the right ballpark, whether I'm safe to return nullptr from GetParentObject (and, if not, how I should think about "parent" here).
All in all, I've been finding the docs to be a lovely resource. I just want to make sure I'm not completely off course before I take care of the rest of the interfaces.
| Assignee | ||
Comment 5•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 6•3 years ago
|
||
The severity field is not set for this bug.
:chutten, could you have a look please?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 7•3 years ago
|
||
Sorry, bugbug, I forgot that one.
Since I'm here, might as well supply an update. I'm working through review comments, hoping to have a new version up for reviewers early-mid next week. Other things, like setting fires in the woods (camping. I was camping for three days), keep taking priority but this is still on my desk.
chutten: it looks like this patch does not impact Glean metric generation in a way that would directly impact Bug 1852098. Can you confirm? Thanks!
| Assignee | ||
Comment 9•3 years ago
|
||
Correct. The scope of this problem is limited to JS modules in non-Chrome contexts, and Use Counters are managed entirely within C++.
| Assignee | ||
Comment 10•3 years ago
|
||
Depends on D186267
| Assignee | ||
Comment 11•3 years ago
|
||
Not sure this is the ideal semantics, but it appeases some tests that depend on
the behaviour.
Depends on D187812
| Assignee | ||
Comment 12•3 years ago
|
||
Depends on D187813
| Assignee | ||
Comment 13•3 years ago
|
||
Also: add a missing await for testClickResultTelemetry and,
since this is a multiprocess test, ensure we always wait for FOG IPC to flush
before clearing data.
Depends on D187937
| Assignee | ||
Comment 14•3 years ago
|
||
Depends on D187938
Comment 15•3 years ago
|
||
Comment 16•3 years ago
|
||
Backed out for bustages on TimingDistribution.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/1105d2849f18b5435e9333a0a66d820178af01f0
Log link: https://treeherder.mozilla.org/logviewer?job_id=429686709&repo=autoland&lineNumber=64640
| Assignee | ||
Comment 17•3 years ago
|
||
Ah, non-unified builds are Tier 1 now. Lemme tighten up these includes and try another local build before I resubmit.
Comment 18•3 years ago
|
||
Comment 19•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a88fa44abdc9
https://hg.mozilla.org/mozilla-central/rev/b5f79a977cd5
https://hg.mozilla.org/mozilla-central/rev/87d76dd03552
https://hg.mozilla.org/mozilla-central/rev/074f9e36e8a0
https://hg.mozilla.org/mozilla-central/rev/e2c9789f7de1
https://hg.mozilla.org/mozilla-central/rev/7369ca94287c
https://hg.mozilla.org/mozilla-central/rev/d63842cc4cf9
Updated•2 years ago
|
Description
•