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

760 Коммитов

Автор SHA1 Сообщение Дата
Tom Schuster 67961ba46a Bug 1717279 - Remove JSID_IS_SYMBOL and JSID_TO_SYMBOL. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D118287
2021-06-21 20:56:10 +00:00
Andi-Bogdan Postelnicu 1cf28e7475 Bug 1519636 - Reformat recent changes to the Google coding style. r=emilio
Updated with clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D115804
2021-05-24 15:08:47 +00:00
Peter Van der Beken 2ffa0654be Bug 1709695 - Only init PropertyInfos and sort IDs for resolving Xray properties once needed. r=nika
Most of the time, a lot of the WebIDL interfaces are never used with Xray wrappers.
We still always initialise the necessary PropertyInfo arrays whenever they're used
normally (not through Xray wrappers). I think we should postpone that initialisation
until we're actually going to use them with Xray wrappers.

Differential Revision: https://phabricator.services.mozilla.com/D114402
2021-05-07 13:57:24 +00:00
Tom Schuster a2dce1438e Bug 1708698 - Use Maybe<PropertyDescriptor> for Xray resolveOwnProperty and a lot of related code. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D113976
2021-05-07 12:29:05 +00:00
Dorel Luca 753e2506cf Backed out changeset d1070cff14c6 (bug 1709695) for Mochitest failures in dom/tests/mochitest/chrome/test_sandbox_bindings.xhtml. CLOSED TREE 2021-05-07 10:47:54 +03:00
Peter Van der Beken ba1380d84b Bug 1709695 - Only init PropertyInfos and sort IDs for resolving Xray properties once needed. r=nika
Most of the time, a lot of the WebIDL interfaces are never used with Xray wrappers.
We still always initialise the necessary PropertyInfo arrays whenever they're used
normally (not through Xray wrappers). I think we should postpone that initialisation
until we're actually going to use them with Xray wrappers.

Differential Revision: https://phabricator.services.mozilla.com/D114402
2021-05-07 06:59:07 +00:00
Peter Van der Beken d3d8dcf5f6 Bug 1688198 - Symbol.toStringTag is incorrectly defined on the global object, rather than on its prototype. r=edgar.
For [Global] WebIDL interfaces, properties from the property array are installed
on the object itself, instead of on the prototype. To fix the bug I changed how
we install the @@toStringTag property, instead of adding it in the property
array of every interface we'll now instead install the property directly in
CreateInterfacePrototypeObject, which is also a codesize win. This does mean
that we need to look up the value dynamically in XrayResolveOwnProperty (we
can't resolve it from the property array anymore), but luckily we can use
NamesOfInterfacesWithProtos for that.

Differential Revision: https://phabricator.services.mozilla.com/D113664
2021-05-07 06:58:31 +00:00
Peter Van der Beken 9b5b32ef7e Bug 1708497 - Stop generating identical ResolveOwnProperty/EnumerateOwnProperties implementations. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D113827
2021-05-05 13:43:59 +00:00
Edgar Chen 70f3dbe892 Bug 1707721 - Fix the comment for BindingJSObjectCreator; r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D113414
2021-04-27 09:34:12 +00:00
Kagami Sascha Rosylight 20a3a7aaff Bug 1631581 - Part 4: Rename Unforgeable to LegacyUnforgeable r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D111212
2021-04-11 03:13:32 +00:00
Kagami Sascha Rosylight 76d2e42ae7 Bug 1631581 - Part 2: Rename NamedConstructor to LegacyFactoryFunction r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D111210
2021-04-11 03:13:31 +00:00
Sean Feng daffde1ac2 Bug 1700391 - Remove the unused UnprivilegedJunkScopeOrWorkerGlobal() method r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D109514
2021-03-24 12:56:45 +00:00
Simon Giesecke c153cfe233 Bug 1674080 - Add some required includes to the bindings generator. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D95147
2021-03-11 13:38:31 +00:00
Jan de Mooij 32014a5271 Bug 1696860 - Remove prototype splicing code for the global object. r=iain
After the ObjectGroup removal changes, prototype splicing and SetPrototype are
equivalent in that both (only) trigger a shape change for the new proto.

Differential Revision: https://phabricator.services.mozilla.com/D107459
2021-03-10 14:06:28 +00:00
Chris Peterson 2d4ca059e8 Bug 1691889 - Replace MOZ_MUST_USE with [[nodiscard]] in dom/. r=peterv
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.

The [[nodiscard]] attribute must precede a function declaration's declaration specifiers (like static, extern, inline, or virtual). The __attribute__((warn_unused_result)) attribute does not have this order restriction.

Differential Revision: https://phabricator.services.mozilla.com/D107355
2021-03-10 08:19:25 +00:00
Ted Campbell bf2062a7c7 Bug 1694040 - Use JSObject::is<ProxyObject> in more places. r=jandem
Also replace JSClass::isProxy with isProxyObject and clarify that the flag
indicates primarily that the JSObject is of type js::ProxyObject.

In DOM binding code, prefer checks for NativeObject rather than !ProxyObject
where that is what we really meant.

Differential Revision: https://phabricator.services.mozilla.com/D105884
2021-02-22 13:12:29 +00:00
Kagami Sascha Rosylight 9d5beaf069 Bug 1688335 - Remove .length and .name from namespaces r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D102830
2021-01-25 21:47:12 +00:00
Simon Giesecke a61cef41e1 Bug 1673931 - Avoid including ScriptSettings.h from BindingUtils.h. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D96560

Depends on D96557
2020-11-23 16:10:52 +00:00
Simon Giesecke 6fac745ea4 Bug 1673931 - Remove dependency of BindingUtils.h on Document.h.
Differential Revision: https://phabricator.services.mozilla.com/D95048

Depends on D95047
2020-11-23 16:08:03 +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
Jon Coppeard 6550bf91b1 Bug 1668825 - Remove unused onChild return value r=sfink
This isn't used anywhere so we can make onChild void.

Differential Revision: https://phabricator.services.mozilla.com/D92257
2020-10-05 07:55:13 +00:00
Jon Coppeard 070d9db800 Bug 1668825 - Combine TracerKindTag and TracerKind r=sfink
Currently we have two different enums that determine the tracer kind. Combine
this into a single enum and move it to the JS namespace.

Differential Revision: https://phabricator.services.mozilla.com/D92253
2020-10-05 07:53:38 +00:00
Jeff Walden 6d5beafab1 Bug 1663365 - Move various Object-related functions to a new js/public/Object.h header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89333
2020-09-08 22:55:38 +00:00
Jeff Walden 49d77af36e Bug 1663365 - Move |JSJitInfo| out of jsfriendapi.h to its own experimental header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89332
2020-09-08 22:52:34 +00:00
Jeff Walden b5ec4c7eba Bug 1663365 - Create a new js/public/String.h header seeded with the inline string functions previously found in jsfriendapi.h. (More functions ought be added/moved here, but these make a good start.) r=jandem,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D89330
2020-09-08 22:50:52 +00:00
Jeff Walden c9ab0ce005 Bug 1656411 - Move WindowProxy-related functions out of jsfriendapi.h to their own header. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D85521
2020-07-31 16:11:36 +00:00
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Simon Giesecke b4b3fdfc78 Bug 1653228 - Move PinnedStringId to a separate header. r=peterv
AtomList uses only PinnedStringId from BindingUtils, and there are no other
dependencies between BindingUtils and PinnedStringId, and BindingUtils is
complex to parse. Moving PinnedStringId to a separate header therefore seems
beneficial.

Differential Revision: https://phabricator.services.mozilla.com/D83769
2020-07-22 15:13:21 +00:00
Simon Giesecke 1cd5c68592 Bug 1652002 - Remove some unnecessary includes from BindingUtils.h. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D83098
2020-07-15 15:34:49 +00:00
Kris Maglione f6b7b4f451 Bug 1645510: Part 1 - Make unprivileged junk scope creation lazy, weak, and fallible. r=mccr8,bholley
Differential Revision: https://phabricator.services.mozilla.com/D79719
2020-06-27 03:06:26 +00:00
Jon Coppeard c53e11c2b2 Bug 1642974 - Don't expose WeakRef targets which are DOM wrappers whose target has been collected r=smaug,sfink
WeakRef targets that are wrappers to DOM objects are preserved when the WeakRef is created.  This checks whether the wrapper is still preserved in deref() and if it is found to have been released, the target is cleared.

The patch adds a new DOMJSClass hook to deal with getting the wrapper cache for non-nsISupports objects.

Differential Revision: https://phabricator.services.mozilla.com/D78061
2020-06-06 06:58:42 +00:00
Tom Schuster f77a3af47a Bug 1277799 - Define @@toStringTag on all DOM interface prototype objects. r=peterv
Instead of manually defining toStringTag we now add the toStringTag symbol to the list of properties.
This is also how we usually define toStringTag in the JS engine.
Even though this changes more code I like this approach better. Everything is centralized in the generated bindings file.

Differential Revision: https://phabricator.services.mozilla.com/D72179
2020-05-05 17:54:51 +00:00
Tom Schuster bd161088e3 Bug 1633145 - Replace INTERNED_STRING_TO_JSID. r=jandem
I am honstely still not convinced that this function should actually exists.
It seems like a convulted way of saying AtomToId, while also asserting that the atom is pinned.

Differential Revision: https://phabricator.services.mozilla.com/D72563
2020-04-30 18:18:12 +00:00
Jon Coppeard 7cf55278e0 Bug 1425450 - Ensure that we call Drop/HoldJSObjects when a preserved wrapper is changed for one in a different zone r=mccr8
So that we can update the holders table correctly we will need to remove the wrapper from its original vector and add it to the one associated with the new zone.

I tried to make SetPreservingWrapper private but there's still a use in layout/style/Rule.cpp that I couldn't see an obvious fix for.

Differential Revision: https://phabricator.services.mozilla.com/D68521
2020-04-20 17:08:14 +00:00
Bogdan Tara eddea671e7 Backed out 6 changesets (bug 1425450) for hazard failure complaining about nsWrapperCacheInlines CLOSED TREE
Backed out changeset c57ac2e125e8 (bug 1425450)
Backed out changeset 4238c59af7bb (bug 1425450)
Backed out changeset 2a00272e72ba (bug 1425450)
Backed out changeset 3e4a52d596bb (bug 1425450)
Backed out changeset 5da68de67491 (bug 1425450)
Backed out changeset efac091a3ba4 (bug 1425450)
2020-04-06 21:22:51 +03:00
Jon Coppeard eff4a09dd5 Bug 1425450 - Ensure that we call Drop/HoldJSObjects when a preserved wrapper is changed for one in a different zone r=mccr8
So that we can update the holders table correctly we will need to remove the wrapper from its original vector and add it to the one associated with the new zone.

I tried to make SetPreservingWrapper private but there's still a use in layout/style/Rule.cpp that I couldn't see an obvious fix for.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 16:13:51 +00:00
Tom Schuster 97d9a753fc Bug 1170775 - Rename DOM Xray DefineProperty parameter from *defined to *done. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D68721

--HG--
extra : moz-landing-system : lando
2020-04-02 05:44:22 +00:00
André Bargull 73a498ec0c Bug 1625138 - Part 38: Replace mozilla::IsSame with std::is_same in dom/. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68557

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:21 +00:00
André Bargull 9de017ffb8 Bug 1625138 - Part 33: Replace mozilla::IntegralConstant with std::integral_constant. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68552

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:19 +00:00
André Bargull cae4e1fdbc Bug 1606962: Replace mozilla::EnableIf with std::enable_if. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68401

--HG--
extra : moz-landing-system : lando
2020-03-28 13:35:31 +00:00
André Bargull 1be056677a Bug 1625138 - Part 26: Replace mozilla::Conditional with std::conditional. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68381

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
Boris Zbarsky da6fb20d19 Bug 1618011 part 8. Switch ByteString conversions to having a method name prefix. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D64889

--HG--
extra : moz-landing-system : lando
2020-03-06 23:05:16 +00:00
Boris Zbarsky 0082f55dee Bug 1618011 part 7. Switch most error messages used in bindings to having a method name prefix. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D64888

--HG--
extra : moz-landing-system : lando
2020-03-06 23:05:16 +00:00
Boris Zbarsky f612519949 Bug 1618011 part 2. Add a BindingCallContext class. r=peterv
We instantiate this class in various binding methods.  Future patches will make
use of it to throw errors.

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

--HG--
extra : moz-landing-system : lando
2020-03-06 23:05:15 +00:00
Arthur Iakab 14247fb057 Backed out 11 changesets (bug 1618011)for Linting failure.
CLOSED TREE

Backed out changeset 8b11ddd8999f (bug 1618011)
Backed out changeset 11df2f359473 (bug 1618011)
Backed out changeset c50121035d50 (bug 1618011)
Backed out changeset 8b8c4c60c34b (bug 1618011)
Backed out changeset b01f8c66110b (bug 1618011)
Backed out changeset 433fdf04058c (bug 1618011)
Backed out changeset 29a9227d08ac (bug 1618011)
Backed out changeset b2dfa2e66d24 (bug 1618011)
Backed out changeset 85650ee945c4 (bug 1618011)
Backed out changeset 278a213e5304 (bug 1618011)
Backed out changeset 9119aeb72ea4 (bug 1618011)
2020-03-07 00:15:57 +02:00
Boris Zbarsky 2564974432 Bug 1618011 part 8. Switch ByteString conversions to having a method name prefix. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D64889

--HG--
extra : moz-landing-system : lando
2020-03-06 20:39:23 +00:00
Boris Zbarsky bc068d0e54 Bug 1618011 part 7. Switch most error messages used in bindings to having a method name prefix. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D64888

--HG--
extra : moz-landing-system : lando
2020-03-06 20:39:10 +00:00
Boris Zbarsky 0dbc444246 Bug 1618011 part 2. Add a BindingCallContext class. r=peterv
We instantiate this class in various binding methods.  Future patches will make
use of it to throw errors.

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

--HG--
extra : moz-landing-system : lando
2020-03-06 20:30:22 +00:00