Граф коммитов

505 Коммитов

Автор SHA1 Сообщение Дата
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
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 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 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
Andrew McCreight 688fc7f03b Bug 1792357, part 2 - Non-scriptable classes don't need to be marked [builtinclass]. r=xpcom-reviewers,necko-reviewers,valentin,nika
They can never be implemented by JS.

I'll enforce this later once some XPConnect interfaces have been removed.

[noscript] also doesn't do anything, so I removed it from nsIUDPSocketSyncListener while
I was there.

Differential Revision: https://phabricator.services.mozilla.com/D158135
2022-09-27 18:31:50 +00:00
Julian Descottes 6d4437d90f Bug 1783814 - Add documentation for remaining SandboxOptions r=kmag
Depends on D154260

Add documentation for
- allowWaivers
- discardSource
- forceSecureContext
- freshCompartment
- invisibleToDebugger
- isWebExtensionContentScript
- metadata
- originAttributes
- userContextId

Differential Revision: https://phabricator.services.mozilla.com/D154307
2022-08-12 08:34:53 +00:00
Julian Descottes 590a767d3a Bug 1783814 - Add documentation for SandboxOptions previously documented on MDN r=kmag
This only ports documentation for options which used to be documented on MDN.
Since then new sandbox options have been added, I will try to add documentation for them in a second changeset

Differential Revision: https://phabricator.services.mozilla.com/D154260
2022-08-12 08:34:53 +00:00
Kris Maglione 2b9e8682a2 Bug 1770237: Part 16 - Remove component loading logic from mozJSComponentLoader. r=mccr8,florian
Differential Revision: https://phabricator.services.mozilla.com/D148196
2022-06-22 20:31:37 +00:00
Tooru Fujisawa 47f69a4984 Bug 1768819 - Add Cu.{isJSModuleLoaded,isESModuleLoaded,loadedJSModules,loadedESModules}. r=kmag
Added 4 new functions, into Cu, for the following reasons:
  * Cu.isModuleLoaded and Cu.loadedModule is kept for backward compatibility
  * Cu.isModuleLoaded and Cu.loadedModule uses shim (bug 1769029 and
    bug 1768922), and loaded ESM (.sys.mjs) is visible as JSM (`.jsm`) there

Differential Revision: https://phabricator.services.mozilla.com/D146167
2022-06-17 04:59:14 +00:00
criss 8fc8ec5d8e Backed out 8 changesets (bug 1771092, bug 1768870, bug 1771097, bug 1769002, bug 1768819) for causing mochitest failures on browser_sendQuery.js. CLOSED TREE
Backed out changeset 8a4d712f819a (bug 1771092)
Backed out changeset f4e27a35c83c (bug 1771092)
Backed out changeset 072323bc72cc (bug 1771092)
Backed out changeset 2ccf2a00fff7 (bug 1769002)
Backed out changeset ba7086fd9b1f (bug 1768819)
Backed out changeset 6205d3e2c666 (bug 1771097)
Backed out changeset 960f0aee97d5 (bug 1768870)
Backed out changeset 5f53760c5637 (bug 1768870)
2022-06-17 05:44:37 +03:00
Tooru Fujisawa e99900bcca Bug 1768819 - Add Cu.{isJSModuleLoaded,isESModuleLoaded,loadedJSModules,loadedESModules}. r=kmag
Added 4 new functions, into Cu, for the following reasons:
  * Cu.isModuleLoaded and Cu.loadedModule is kept for backward compatibility
  * Cu.isModuleLoaded and Cu.loadedModule uses shim (bug 1769029 and
    bug 1768922), and loaded ESM (.sys.mjs) is visible as JSM (`.jsm`) there

Differential Revision: https://phabricator.services.mozilla.com/D146167
2022-06-17 01:30:23 +00:00
Molnar Sandor c1ae6857f8 Backed out 9 changesets (bug 1769002, bug 1768870, bug 1771097, bug 1771092, bug 1768819) for causing lint failures. CLOSED TREE
Backed out changeset 829df1dfad70 (bug 1769002)
Backed out changeset f0537d333adc (bug 1771092)
Backed out changeset 25b43856bc00 (bug 1771092)
Backed out changeset a49f754ca73f (bug 1771092)
Backed out changeset 164f85686a32 (bug 1769002)
Backed out changeset ef5cf9ceb915 (bug 1768819)
Backed out changeset c64e6c1fbfe7 (bug 1771097)
Backed out changeset f85393f988a8 (bug 1768870)
Backed out changeset fe708d13cc1d (bug 1768870)
2022-06-16 20:15:14 +03:00
Tooru Fujisawa 3d15caadb4 Bug 1768819 - Add Cu.{isJSModuleLoaded,isESModuleLoaded,loadedJSModules,loadedESModules}. r=kmag
Added 4 new functions, into Cu, for the following reasons:
  * Cu.isModuleLoaded and Cu.loadedModule is kept for backward compatibility
  * Cu.isModuleLoaded and Cu.loadedModule uses shim (bug 1769029 and
    bug 1768922), and loaded ESM (.sys.mjs) is visible as JSM (`.jsm`) there

Differential Revision: https://phabricator.services.mozilla.com/D146167
2022-06-16 16:20:37 +00:00
Jon Coppeard d40ccf2be0 Bug 1757956 - Part 3: Rename JSFreeOp to JS::GCContext in the JS engine r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D140525
2022-03-10 08:40:03 +00:00
Nick Alexander 02dda268a6 Bug 1742879 - Let `Cu.createCommandLine` accept arguments and state. r=nika
There's a lot of history in this area that mostly explains why this
has not been supported in the past, leading to several awkward
workarounds in tests.  But it doesn't appear that there's any reason
to prevent tests from creating actual command lines, so that's what we
allow here.

I've elected to flesh out `Cu.createCommandLine` rather than expose
`.init(..._)` directly since `Cu.createCommandLine` is already used in
the relevant tests and is only used in tests.  And I've made the
arguments required, rather than optional, so that consumers think
about the arguments, in particular `state`.

Differential Revision: https://phabricator.services.mozilla.com/D132089
2021-12-02 19:06:44 +00:00
Noemi Erli 4aa2f8759e Backed out 2 changesets (bug 1742879) for causing build bustage in nsDebug.h CLOSED TREE
Backed out changeset 994d0986757c (bug 1742879)
Backed out changeset d4b8e45faaec (bug 1742879)
2021-12-02 09:34:25 +02:00
Nick Alexander a8c4c5c97b Bug 1742879 - Let `Cu.createCommandLine` accept arguments and state. r=nika
There's a lot of history in this area that mostly explains why this
has not been supported in the past, leading to several awkward
workarounds in tests.  But it doesn't appear that there's any reason
to prevent tests from creating actual command lines, so that's what we
allow here.

I've elected to flesh out `Cu.createCommandLine` rather than expose
`.init(..._)` directly since `Cu.createCommandLine` is already used in
the relevant tests and is only used in tests.  And I've made the
arguments required, rather than optional, so that consumers think
about the arguments, in particular `state`.

Differential Revision: https://phabricator.services.mozilla.com/D132089
2021-12-02 04:02:07 +00:00
Tooru Fujisawa f263a1ae81 Bug 1718481 - Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Differential Revision: https://phabricator.services.mozilla.com/D121254
2021-09-21 03:18:02 +00:00
Butkovits Atila 8957144a0f Backed out 3 changesets (bug 1718194, bug 1718623, bug 1718481) for causing leaks. CLOSED TREE
Backed out changeset 1cd8bdf1fc92 (bug 1718481)
Backed out changeset aa56fe2c069d (bug 1718194)
Backed out changeset f7cb7313d1c7 (bug 1718623)
2021-09-18 15:47:45 +03:00
Tooru Fujisawa 58155ebcca Bug 1718481 - Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Differential Revision: https://phabricator.services.mozilla.com/D121254
2021-09-18 11:16:46 +00:00
Henrik Skupin 0edcc72b48 Bug 1722718 - [xpconnect] Allow Javascript to print to stderr. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D121094
2021-07-29 07:17:07 +00:00
Peter Van der Beken c1a5f99ad3 Bug 1697900 - Remove unused NS_ERROR_XPC_CANT_GET_JSOBJECT_OF_DOM_OBJECT. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D108095
2021-03-12 10:57:15 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Gijs Kruitbosch af15d01659 Bug 1666221 - cope with not having a working directory, r=robwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D91221
2020-10-22 19:44:46 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Bobby Holley daf490c526 Bug 1669556 - Remove nsIXPCScriptable enumerate hook. r=mccr8
NewEnumerate is used, but Enumerate isn't.

Differential Revision: https://phabricator.services.mozilla.com/D92685
2020-10-07 20:06:18 +00:00
Tooru Fujisawa 436f86f9a2 Bug 1666683 - Part 5: Add options parameter to nsXPConnect::ReadScript. r=tcampbell,kmag
Differential Revision: https://phabricator.services.mozilla.com/D92407
2020-10-07 04:46:55 +00:00
Kris Maglione 4200cb539c Bug 1464542: Part 2 - Add infrastructure for defining named services exposed to JS. r=mccr8
This builds on the existing static components infrastructure to allow defining
a Services.jsm-type services cache with no runtime memory overhead for any
services until they're accessed.

Any class entry with a 'js_name' attribute automatically becomes available on
the services cache with that name, and any interfaces listed in its
'interfaces' list are automatically queried on it.

Differential Revision: https://phabricator.services.mozilla.com/D81417
2020-07-09 20:42:50 +00:00
Csoregi Natalia b355fcc4bf Backed out 6 changesets (bug 1464542) for xpcshell failures on test_Services.js. CLOSED TREE
Backed out changeset b50af9005851 (bug 1464542)
Backed out changeset 9d3a0ea2cf65 (bug 1464542)
Backed out changeset 71c3475fcbc2 (bug 1464542)
Backed out changeset 51ff93220a95 (bug 1464542)
Backed out changeset e84de1547c09 (bug 1464542)
Backed out changeset bbecc16d08eb (bug 1464542)
2020-07-09 23:19:26 +03:00
Kris Maglione 0ae37bde4e Bug 1464542: Part 2 - Add infrastructure for defining named services exposed to JS. r=mccr8
This builds on the existing static components infrastructure to allow defining
a Services.jsm-type services cache with no runtime memory overhead for any
services until they're accessed.

Any class entry with a 'js_name' attribute automatically becomes available on
the services cache with that name, and any interfaces listed in its
'interfaces' list are automatically queried on it.

Differential Revision: https://phabricator.services.mozilla.com/D81417
2020-07-09 17:59:11 +00:00
Andrew McCreight 208d20a42e Bug 1645908 - Eliminate gratuitous use of dom::danger::GetJSContext() in ForceShrinkingGC(). r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D79756
2020-06-15 22:37:10 +00:00
Masatoshi Kimura 8b30e469c5 Bug 1481640 - Remove forcePermissiveCOWs(). r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D77612
2020-06-01 18:04:20 +00:00
Gijs Kruitbosch 2f983e6cfa Bug 1638373 - remove Cu.isCrossProcessWrapper now that CPOWs are dead, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D76597
2020-05-24 23:38:17 +00:00
Tom Schuster 25a8ce26ec Bug 1277801 - Introduce Cu.isOpaqueWrapper. r=peterv
With the following changes Object.prototype.toString is not using the JSClass' name
anymore. This means we now fail to detect opaque wrappers, because they just get the default string: [object Object]

Differential Revision: https://phabricator.services.mozilla.com/D74016
2020-05-11 20:53:10 +00:00
Florian Quèze fa2f59b3f7 Bug 1630982 - Terminate browser-chrome mochitests with an exit(0), r=gbrown,dthayer.
Differential Revision: https://phabricator.services.mozilla.com/D71336
2020-05-07 17:34:30 +00:00
Dorel Luca d9c6949cf6 Backed out changeset b77388326b1b (bug 1630982) for causing leaks on mochitest jobs. CLOSED TREE 2020-05-07 13:49:20 +03:00
Florian Quèze c1fe95dc03 Bug 1630982 - Terminate browser-chrome mochitests with an exit(0), r=gbrown,dthayer.
Differential Revision: https://phabricator.services.mozilla.com/D71336
2020-05-07 09:25:57 +00:00
Gijs Kruitbosch 5ffecefa61 Bug 1620226 - remove Cu.permitCPOWsInScope and Cu.getCrossProcessWrapperTag, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D71400
2020-04-17 21:32:38 +00:00
Mihai Alexandru Michis 0eb5f699ca Backed out 2 changesets (bug 1622718) as requested by dev for causing Bug 1626727.
Backed out changeset eb632d0b3a7b (bug 1622718)
Backed out changeset 016b86b83932 (bug 1622718)
2020-04-03 06:03:25 +03:00
Logan Smyth 1442e01626 Bug 1622718 - Part 1: Expose 'useCompilationScope' as an option from nsIJSSubScriptLoader. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D68502

--HG--
extra : moz-landing-system : lando
2020-03-30 23:29:23 +00:00
Tom Schuster 00218dcac0 Bug 1275508 - Remove JavaScript werror from browser. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D66255

--HG--
extra : moz-landing-system : lando
2020-03-11 12:20:21 +00:00
Tom Schuster 3946b3eaea Bug 1619177 - Remove remaining extra warnings code. r=tcampbell,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D65830

--HG--
extra : moz-landing-system : lando
2020-03-10 22:59:41 +00:00
Boris Zbarsky 7df96355fc Bug 1448992. Get rid of nsXPCComponentsBase. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D65737

--HG--
extra : moz-landing-system : lando
2020-03-06 17:40:57 +00:00
Ted Campbell c23b94d337 Bug 1598053 - Remove nsIXPConnect::writeFunction/readFunction r=kmag
These are no longer used after the removal of XBL. The underlying
SpiderMonkey APIs will be removed as well to fascilitate modernizing of
bytecode caching.

Differential Revision: https://phabricator.services.mozilla.com/D54007

--HG--
extra : moz-landing-system : lando
2019-11-20 20:06:42 +00:00