mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
459ac122eb
Currently there is a tight coupling between registered APIs because they share the same global scope, and the dependencies between the modules that use these globals are not explicit. Consequently, it would be possible for APIs to break when the registered APIs run in separate processes, because then there are separate global scopes. To mitigate this issue, this patch isolates the global namespaces of API registrations in different environments, starting with the "chrome" process. Content and addon processes will follow later. A new JSM is introduced to avoid hidden dependencies between ext-*.js and the script loader. ExtensionUtils.jsm would be a natural choice for this shared utility method, but cannot be used because its local `EventEmitter` implementation conflicts with the `EventEmitter` import in ext-tabs.js. So, this patch provides isolation of global variables declared through `globals.XXX = ...`, but does not provide isolation for `Cu.import`-ed logic. Ideally `Cu.import` should always use its second argument to prevent inadvertent namespace pollution. MozReview-Commit-ID: 1DTZaKOaeSE --HG-- extra : rebase_source : 1376a1325fd9bf186e09e1dbe83467f3ad94516f |
||
---|---|---|
.. | ||
app | ||
base | ||
branding | ||
components | ||
config | ||
docs | ||
experiments | ||
extensions | ||
fonts | ||
installer | ||
locales | ||
modules | ||
themes | ||
tools/mozscreenshots | ||
.eslintrc | ||
app-rules.mk | ||
app.mozbuild | ||
build.mk | ||
confvars.sh | ||
defs.mk | ||
LICENSE | ||
Makefile.in | ||
moz.build | ||
moz.configure |