Commit Graph

8715 Commits

Author SHA1 Message Date
Alexandre Poirot
0c8582b292 Bug 1410932 - Set innerWindowID for exception coming from WebExtension content scripts. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D157334
2022-12-12 13:17:46 +00:00
Mark Banner
ff47c36f9b Bug 1803914 - Automatically replace Cu.reportError with console.error (misc). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D163772
2022-12-06 14:34:57 +00:00
Tooru Fujisawa
e5c2ee72c8 Bug 1800050 - Use UniqueFreePtr in StartupCache::PutBuffer. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D163453
2022-12-01 10:46:34 +00:00
Tom Ritter
ed527a4716 Bug 1778510: Populate ShouldRFP on content's JS Realm r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D156503
2022-11-29 13:34:13 +00:00
Tom Ritter
9a5f52f41e Bug 1778510: Require subclasses of nsIGlobalObject implement ShouldRFP r=asuth
For the less common subclasses we will hardcode a choice to always obey
RFP if the pref is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D157562
2022-11-29 13:34:12 +00:00
Butkovits Atila
cb853b7f77 Backed out 33 changesets (bug 1778510) for causing build bustages at nsIGlobalObject.h. CLOSED TREE
Backed out changeset f2a53c9e497c
Backed out changeset 59350ca6f3f2 (bug 1778510)
Backed out changeset abbba7e72b57 (bug 1778510)
Backed out changeset 6cf7473afae8 (bug 1778510)
Backed out changeset 74fb5fed93ea (bug 1778510)
Backed out changeset 5b5dc70cdd0a (bug 1778510)
Backed out changeset ff93191cafd2 (bug 1778510)
Backed out changeset 39cc006b610c (bug 1778510)
Backed out changeset dfaef3ad17a9 (bug 1778510)
Backed out changeset 8fbabeb8244b (bug 1778510)
Backed out changeset 45051b62e3f1 (bug 1778510)
Backed out changeset 86c0923fd81f (bug 1778510)
Backed out changeset a49c0f69d519 (bug 1778510)
Backed out changeset cfad733d4aaf (bug 1778510)
Backed out changeset df6d0fe89d5b (bug 1778510)
Backed out changeset 704db76eab17 (bug 1778510)
Backed out changeset 0651c128e369 (bug 1778510)
Backed out changeset 1e650de647c0 (bug 1778510)
Backed out changeset fa15a3572741 (bug 1778510)
Backed out changeset 4ceffd409eae (bug 1778510)
Backed out changeset 47db43142c62 (bug 1778510)
Backed out changeset ebb21153aaac (bug 1778510)
Backed out changeset a87eaaec3f9c (bug 1778510)
Backed out changeset 43ad5ee21f79 (bug 1778510)
Backed out changeset 5f20af8e1263 (bug 1778510)
Backed out changeset b78576875db0 (bug 1778510)
Backed out changeset d801fdeac90b (bug 1778510)
Backed out changeset 5af032c628c0 (bug 1778510)
Backed out changeset 86aa59de11b4 (bug 1778510)
Backed out changeset 58642357a19c (bug 1778510)
Backed out changeset c575e824e291 (bug 1778510)
Backed out changeset 32a358de4843 (bug 1778510)
Backed out changeset 40e0708c01e7 (bug 1778510)
2022-11-28 23:14:52 +02:00
Tom Ritter
3f3cea2329 Bug 1778510: Populate ShouldRFP on content's JS Realm r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D156503
2022-11-28 18:04:06 +00:00
Tom Ritter
1f9c192cbf Bug 1778510: Require subclasses of nsIGlobalObject implement ShouldRFP r=asuth
For the less common subclasses we will hardcode a choice to always obey
RFP if the pref is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D157562
2022-11-28 18:04:04 +00:00
Cosmin Sabou
d245f666b9 Backed out 33 changesets (bug 1778510) for causing bp-hybrid bustages on nsIPrincipal.h. CLOSED TREE
Backed out changeset 282f589ede4a
Backed out changeset e23d03ba5a89 (bug 1778510)
Backed out changeset cbdb34cf7c8d (bug 1778510)
Backed out changeset d9a54521f3fb (bug 1778510)
Backed out changeset f5b7f8ce38b0 (bug 1778510)
Backed out changeset eb64607765a9 (bug 1778510)
Backed out changeset 18291e692834 (bug 1778510)
Backed out changeset bb71cc94a8be (bug 1778510)
Backed out changeset 507e84e1dafe (bug 1778510)
Backed out changeset 6d42e7a083ac (bug 1778510)
Backed out changeset 53799e6a46dd (bug 1778510)
Backed out changeset ff20d709839a (bug 1778510)
Backed out changeset 328d4d2df591 (bug 1778510)
Backed out changeset 9ba44fd8a440 (bug 1778510)
Backed out changeset eb1b7e30e519 (bug 1778510)
Backed out changeset c0927de6153b (bug 1778510)
Backed out changeset 02a306acd093 (bug 1778510)
Backed out changeset 2c5eecc4ad4c (bug 1778510)
Backed out changeset 38a9f45c9621 (bug 1778510)
Backed out changeset 35b7c7df62ce (bug 1778510)
Backed out changeset 187d71f42593 (bug 1778510)
Backed out changeset 450f4ccd6cd0 (bug 1778510)
Backed out changeset 915149e27da0 (bug 1778510)
Backed out changeset 9c6e85369f15 (bug 1778510)
Backed out changeset c6a9fe0ce713 (bug 1778510)
Backed out changeset a2f00462157e (bug 1778510)
Backed out changeset 5278e40b80c3 (bug 1778510)
Backed out changeset dba220581d93 (bug 1778510)
Backed out changeset 17a63044b0dc (bug 1778510)
Backed out changeset 68d607aaa121 (bug 1778510)
Backed out changeset e93004f91f6f (bug 1778510)
Backed out changeset 41d6d9f889e1 (bug 1778510)
Backed out changeset 28ac62019086 (bug 1778510)
2022-11-28 07:34:46 +02:00
Tom Ritter
a1dd535147 Bug 1778510: Populate ShouldRFP on content's JS Realm r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D156503
2022-11-28 04:21:25 +00:00
Tom Ritter
c6dbdf3adf Bug 1778510: Require subclasses of nsIGlobalObject implement ShouldRFP r=asuth
For the less common subclasses we will hardcode a choice to always obey
RFP if the pref is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D157562
2022-11-28 04:21:24 +00:00
Mark Banner
4a8185fb14 Bug 1801368 - Migrate StructuredLog.jsm to an ES module. r=ahal
Depends on D162490

Differential Revision: https://phabricator.services.mozilla.com/D162491
2022-11-24 16:17:47 +00:00
Marco Castelluccio
14f91b348b Bug 1790816 - Reformat js/ with isort. r=linter-reviewers,ahal DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162664
2022-11-24 15:22:43 +00:00
Barret Rennie
81c2567091 Bug 1772733 - Change directory in xpcshell without OS.File r=jmaher,nika
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
2022-11-21 23:49:39 +00:00
Jeff Muizelaar
c30140f182 Bug 1446578. Mark OOM initialization failures as such. r=mccr8
This should make it more obvious the cause of the failures we see
in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D162433
2022-11-18 22:19:07 +00:00
Tooru Fujisawa
42173cef6c Bug 1801082 - Report better error message when ChromeUtils.import tries to import ESM. r=jonco,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D162368
2022-11-18 10:24:36 +00:00
Yulia Startsev
32c96913a6 Bug 1800496 - Re-introduce Cycle Collected LoadContextBase for Workers; r=jonco
The non-cycle collected LoadContextBase caused failures for Module Workers. This reverts that change

Differential Revision: https://phabricator.services.mozilla.com/D162214
2022-11-18 10:02:26 +00:00
Mark Banner
b932ce5801 Bug 1799314 - Convert consumers of testing modules to import ES modules direct (js/). r=arai
Differential Revision: https://phabricator.services.mozilla.com/D161913
2022-11-17 12:00:30 +00:00
Jan Varga
f40ce49b02 Bug 1790207 - Forward declaration of mozilla::Result in nsIGlobalObject.h and other cleanup; r=dom-storage-reviewers,jesup
Depends on D162087

Differential Revision: https://phabricator.services.mozilla.com/D162088
2022-11-15 17:13:02 +00:00
Jan Varga
7ce6e92fa1 Bug 1790207 - Change nsIGlobalObject::GetStorageKey to return NS_ERROR_NOT_AVAILABLE by default; r=dom-storage-reviewers,jesup,asuth
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
2022-11-15 17:13:01 +00:00
Randell Jesup
229303901a Bug 1790207: Provide cross-origin security checks for OPFS r=nika,asuth
Differential Revision: https://phabricator.services.mozilla.com/D157892
2022-11-15 17:13:01 +00:00
Tooru Fujisawa
23d0744bd3 Bug 1799415 - Try fallback from jsm to sys.mjs when access is denied by sandbox. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D161766
2022-11-10 11:35:24 +00:00
Yulia Startsev
90c9e66373 Bug 1799619 - Disable array grouping by default on nightly; r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D161567
2022-11-09 09:24:14 +00:00
nchevobbe
ac8e984261 Bug 1797021 - Expose MIDIInputMap/MIDIOutputMap in devtools sandbox. r=smaug,gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D160238
2022-11-04 08:49:02 +00:00
Yulia Startsev
17fd034c7a Bug 1797327 - Introduce CC'd and non CC'd variants of LoadContextBase; r=jonco
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
2022-11-01 18:03:34 +00:00
Mark Banner
9189ff3f6f Bug 1798018 - Convert consumers of toolkit/modules/tests to import ES modules direct. r=Gijs,webdriver-reviewers,extension-reviewers,settings-reviewers,credential-management-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D160664
2022-11-01 13:26:38 +00:00
André Bargull
7621911562 Bug 1765357 - Part 5: Remove top_level_await preference. r=mgaudet
Depends on D160615

Differential Revision: https://phabricator.services.mozilla.com/D160616
2022-10-31 07:08:47 +00:00
André Bargull
a4d3ba1baa Bug 1765357 - Part 4: Remove ergonomic_brand_checks preference. r=mgaudet
Depends on D160614

Differential Revision: https://phabricator.services.mozilla.com/D160615
2022-10-31 07:08:47 +00:00
Daniel Holbert
3c368026cb Bug 1798068 part 2: Expand JS::MutableHandleIdVector to more verbose typename in nsIXPCScriptable.idl, to satisfy static-analysis rule. r=xpcom-reviewers,mccr8
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
2022-10-28 23:11:46 +00:00
Daniel Holbert
9475dbb311 Bug 1798068 part 1: Fix indentation on some mis-indented lines of nsIXPCScriptable.idl. r=xpcom-reviewers,mccr8
This is a non-functional change (just whitespace cleanup).

Differential Revision: https://phabricator.services.mozilla.com/D160689
2022-10-28 23:11:46 +00:00
Daniel Holbert
16170f25a6 Bug 1797840: Replace stray tab characters with spaces in IDL files throughout the tree. r=mccr8,necko-reviewers,credential-management-reviewers,smaug,sgalich,valentin
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
2022-10-28 18:08:17 +00:00
Matthew Gaudet
47be3bc251 Bug 1726039 - Disallow setting private fields on MaybeCrossOrigin objects (HostEnsureCanPrivateElementAdd) r=peterv,jandem
Differential Revision: https://phabricator.services.mozilla.com/D122780
2022-10-26 21:53:36 +00:00
Mark Banner
9613c19f16 Bug 1795880 - Add an ESLint rule to enforce using static imports where possible. r=arai,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D160131
2022-10-26 09:37:46 +00:00
Tooru Fujisawa
8f7d859eb1 Bug 1795873 - Part 1: Add profiler marker for ChromeUtils.importESModule static import. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D159920
2022-10-25 07:02:37 +00:00
Robert Longson
a546daf2d8 Bug 1795568 Part 1 - Remove plugin support code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D159465
2022-10-24 18:56:41 +00:00
Matthew Gaudet
4852cc8cc4 Bug 1795914 - Remove JS Streams implementation r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D159610
2022-10-24 16:05:58 +00:00
Marian-Vasile Laza
bfba58d8e6 Backed out 3 changesets (bug 1795873, bug 1796539) as req by the dev (arai). CLOSED TREE
Backed out changeset de1917baf71d (bug 1796539)
Backed out changeset 8326cc71c2dd (bug 1795873)
Backed out changeset 292542f833fe (bug 1795873)
2022-10-24 16:05:20 +03:00
Tooru Fujisawa
be76847d32 Bug 1795873 - Part 1: Add profiler marker for ChromeUtils.importESModule static import. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D159920
2022-10-24 12:22:30 +00:00
Mark Banner
2ffde1e92f Bug 1792341 - Migrate more toolkit/modules consumers to use direct ES module import. r=Gijs,webdriver-reviewers,perftest-reviewers,necko-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,sgalich,owlish,bytesized,AlexandruIonescu,whimboo,mconley,mixedpuppy
Mainly automated changes. Some manual ESLint fixes and whitespace cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D158452
2022-10-18 11:21:26 +00:00
Kris Maglione
242c704d10 Bug 1795164: Replace Cu.generateXPCWrappedJS with Cu.getDebugName. r=mccr8
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
2022-10-14 22:49:20 +00:00
Kris Maglione
fc029513a6 Bug 1794424: Stop using with() to try to avoid the JIT. r=jandem,mccr8
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
2022-10-13 20:50:08 +00:00
Kris Maglione
1225e9b8e7 Bug 1792334 - Decom nsIXPConnect and friends. r=mccr8
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
2022-10-12 22:26:12 +00:00
Cristian Tuns
c815815081 Backed out changeset b5b51c1be2f5 (bug 1792334) for causing build bustages on XPCWrappedJS.cpp CLOSED TREE 2022-10-12 18:05:39 -04:00
Kris Maglione
48e9d5b01f Bug 1794186: Remove remaining __exposedProps__ references. r=nika
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
2022-10-12 21:46:02 +00:00
Kris Maglione
fd512a79f8 Bug 1792334 - Decom nsIXPConnect and friends. r=mccr8
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
2022-10-12 21:45:13 +00:00
Alexandre Poirot
f48160c87a Bug 1793602 - Test getModuleImportStack only on nightly builds in test_import_devtools_loader.js. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D159060
2022-10-12 10:24:57 +00:00
Andrew McCreight
cbfad78f92 Bug 1793227, part 9 - Automated fixes for js/xpconnect/tests/browser/. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D158508
2022-10-10 22:22:02 +00:00
Andrew McCreight
1e9cfa44fc Bug 1793227, part 8 - Manual eslint fixes for js/xpconnect/tests/browser/. r=kmag
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
2022-10-10 22:22:02 +00:00
Andrew McCreight
6667e48501 Bug 1793227, part 7 - Manual fixes for XPCOMUtils.sys.mjs. r=kmag
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
2022-10-10 22:22:02 +00:00
Andrew McCreight
c41c392332 Bug 1793227, part 6 - Automated fixes for XPCOMUtils.sys.mjs. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D158505
2022-10-10 22:22:01 +00:00