Instead of relying on OS.File.setCurrentDirectory in the xpcshell test harness
we instead provide a function to directly change directory.
Differential Revision: https://phabricator.services.mozilla.com/D148977
nsGlobalWindowInner, WorkerGlobalScopeBase, BackstagePas and SandboxPrivate now
explicitly provide GetStorageKey implementation which explicitly block null and
expanded principals. All other globals (nsGlobalWindowOuter, SimpleGlobalObject,
ShadowRealmGlobalScope and WorkletGlobalScope) inherit the default
implementation which returns NS_ERROR_NOT_AVAILABLE.
Differential Revision: https://phabricator.services.mozilla.com/D162087
In order to use the WorkerLoadContext as a handle for ScriptLoadRequests in the main thread portion
of worker loading, we need to make it thread safe. Which means, it cannot be CC'd, and we need to
manually break cycles. This patch does the first portion of this work, which is inroduce two new
loadContextBase classes, that are either cc'd or not cc'd. For the DOM and mozJSComponent loader, we
continue to use a CC'd LoadContextBase. Workers however now have a non-cc'd variant.
Differential Revision: https://phabricator.services.mozilla.com/D160333
This patch doesn't change behavior; it's just expanding an abbreviated typename.
Without this patch, my local static-analysis build fails with the following
error for mozStorageStatementJSHelper.h (which has a class that implements
nsIXPCScriptable and is outside of SpiderMonkey):
"error: The fully qualified types are preferred over the shorthand typedefs for
JS::Handle/JS::Rooted types outside SpiderMonkey."
The error message points to the NS_DECL_NSIXPCSCRIPTABLE macro, and
specifically to a usage of this typename inside of that macro. This patch's
type-expansion seems to appease this static analysis rule.
Before this patch, the type here was `JS::MutableHandleIdVector` which is a
typedef for `MutableHandle<StackGCVector<JS::PropertyKey>>` as defined here:
https://searchfox.org/mozilla-central/rev/fe5c9c39a879b07d5b629257f63d825c3c8cd0ed/js/public/TypeDecls.h#98
After this patch, the type here is `JS::MutableHandleVector<JS::PropertyKey>`
(which I took from the static analysis error message's suggestion). That
expands to the same full-qualified type, since `MutableHandleVector<T>` is an
alias for `MutableHandle<StackGCVector<T>>` as defined here:
https://searchfox.org/mozilla-central/rev/fe5c9c39a879b07d5b629257f63d825c3c8cd0ed/js/public/TypeDecls.h#128
Differential Revision: https://phabricator.services.mozilla.com/D160690
DONTBUILD because this is just whitespace cleanup.
I found the files to fix up here using this command:
grep -r ' ' * 2>/dev/null | grep -v "other-licenses" | grep "idl:"
I replaced the tab characters with however many spaces seemed consistent with
the indentation in the surrounding code (and did some minor space-indentation
cleanup in contextual lines to preserve alignment, in a few cases).
Differential Revision: https://phabricator.services.mozilla.com/D160577
The only remaining user of this function uses it as an awkward way to get the
debug name of a timer callback function. We should just provide it with a
straightforward way to do that instead.
Differential Revision: https://phabricator.services.mozilla.com/D159335
It shouldn't actually keep us out of Baseline anymore, and `eval` should be
enough to prevent any heavy optimization.
I tried replacing the `eval()` with `Cu.exportFunction` to create native stack
frames in a definitely-not-JITtable way, but the frames were too small, and
the stub JS function calls started failing with stack overflow errors at the
same time as the "heavy" native calls.
That also happened to uncover a fairly obvious bug in the existing test, in
that we can't actually report a failed assertion when we're out of stack
space, and just wind up throwing another stack overflow or allocation error
instead.
Differential Revision: https://phabricator.services.mozilla.com/D159225
They haven't been scriptable in years, so there's no need for them to go
through XPIDL or for the methods to be virtual.
Differential Revision: https://phabricator.services.mozilla.com/D158081
Some more of these tests could probably be removed completely, but they still
leave some vestigial opaque COW tests that might still be worse something,
even though they should be completely redundant.
Differential Revision: https://phabricator.services.mozilla.com/D158997
They haven't been scriptable in years, so there's no need for them to go
through XPIDL or for the methods to be virtual.
Differential Revision: https://phabricator.services.mozilla.com/D158081
browser_exception_leak.js is intentionally creating a leak, so maybe the unused
doc is intentional.
browser_import_mapped_jsm.js is deliberately testing the behavior of Cu.import,
so ignore the failure there.
Differential Revision: https://phabricator.services.mozilla.com/D158507
One place was missing an explicit return.
The eslint-disable-next-line is needed because the analysis doesn't
seem to understand the non-static string.
The return was split into a separate line because that made eslint
complain that we needed to be consistent about returns, though
the return type of defineModuleGetter is undefined.
Finally, I updated the ChromeUtils.import() calls so they weren't using
the deprecated argument.
Differential Revision: https://phabricator.services.mozilla.com/D158506