Closed
Bug 1514153
Opened 6 years ago
Closed 5 years ago
Loader global check in Cu.permitCPOWsInScope is broken
Categories
(Core :: XPConnect, enhancement, P3)
Core
XPConnect
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: jandem, Unassigned)
References
Details
We assert !mozJSComponentLoader::Get()->IsLoaderGlobal(scopeObj), but callers typically pass |this| and that's the JSM environment or something in the shared JSM global.
We have a few modules like Task.jsm that call Cu.permitCPOWsInScope(this). Comments suggest we can probably remove at least some of these calls now, I'll see how far I get with that.
Reporter | ||
Comment 1•6 years ago
|
||
Also maybe we can make this use xpc::CrashIfNotInAutomation().
Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #1)
> Also maybe we can make this use xpc::CrashIfNotInAutomation().
Oh evilpie already did something similar in the actual CPOW code in bug 1465911, by making it throw, so it seems the risk of this bug causing issues currently is pretty small.
Reporter | ||
Comment 3•6 years ago
|
||
See also bug 1512655 comment 6.
Updated•6 years ago
|
Priority: -- → P3
Comment 4•6 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #0)
> We assert !mozJSComponentLoader::Get()->IsLoaderGlobal(scopeObj), but
> callers typically pass |this| and that's the JSM environment or something in
> the shared JSM global.
The JSMs that call this should all be whitelisted to run in their own globals:
https://searchfox.org/mozilla-central/rev/49e78df13e7a505827a3a86daae9efdf827133c6/js/xpconnect/loader/mozJSComponentLoader.cpp#626-632
So they shouldn't be running in the shared JSM global.
> We have a few modules like Task.jsm that call Cu.permitCPOWsInScope(this).
> Comments suggest we can probably remove at least some of these calls now,
> I'll see how far I get with that.
Task.jsm is basically dead at this point, except for some odd references from test code and Android.
Comment 5•6 years ago
|
||
(To be clear, I agree this check is broken, and that we need to remove calls in places like Task.jsm and Promise-backend.js.)
Comment 6•5 years ago
|
||
Gijs removed this method in bug 1620226.
You need to log in
before you can comment on or make changes to this bug.
Description
•