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|PTO, Assigned: chutten|PTO)
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.idl
towebidl/
, rewriting to webidl (no moreAUTF8String
. Learn to loveDOMString
. And drop thosensI
prefixes. AndnsISupports
is nowany
orobject
.) - 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•1 year 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•1 year ago
|
||
Depends on D186266
Assignee | ||
Comment 3•1 year 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 NamedGetter
s 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•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 6•1 year 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•1 year 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.
Comment 8•1 year ago
|
||
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•1 year 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•1 year ago
|
||
Depends on D186267
Assignee | ||
Comment 11•1 year ago
|
||
Not sure this is the ideal semantics, but it appeases some tests that depend on
the behaviour.
Depends on D187812
Assignee | ||
Comment 12•1 year ago
|
||
Depends on D187813
Assignee | ||
Comment 13•1 year 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•1 year ago
|
||
Depends on D187938
Comment 15•1 year ago
|
||
Comment 16•1 year 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•1 year ago
|
||
Ah, non-unified builds are Tier 1 now. Lemme tighten up these includes and try another local build before I resubmit.
Comment 18•1 year ago
|
||
Comment 19•1 year 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•1 year ago
|
Description
•