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

140 Коммитов

Автор SHA1 Сообщение Дата
Nika Layzell 05dc5e0d76 Bug 1754037 - Part 3c: Automatically update all ParamTraits implementations, r=ipc-reviewers,media-playback-reviewers,bryce,mccr8
Automatically generated rewrites of all ParamTraits and IPDLParamTraits
implementations in-tree to use IPC::Message{Reader,Writer}.

Differential Revision: https://phabricator.services.mozilla.com/D140004
2022-03-04 15:39:41 +00:00
Nika Layzell 14e4d6be72 Bug 1754037 - Part 2: Forward declare Message{Reader,Writer} where Message is forward declared, r=ipc-reviewers,mccr8
This will allow the types to be more easily automatically substituted in place
of `IPC::Message`, as the type will already be declared in places it is used.

Differential Revision: https://phabricator.services.mozilla.com/D140000
2022-03-04 15:39:39 +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
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
Sylvestre Ledru caf785c695 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
2020-07-04 09:38:43 +00:00
Peter Van der Beken 6c885dbb71 Bug 1629390 - Don't crash when throwing exception with invalid UTF-8. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D73203
2020-04-30 10:25:58 +00:00
Boris Zbarsky a48980ac8c Bug 1619112 part 6. Remove duplicated string array appender bits. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65544

--HG--
extra : moz-landing-system : lando
2020-03-06 21:08:17 +00:00
Boris Zbarsky 00cd5d4380 Bug 1619112 part 5. Stop accepting nsAString in ErrorResult error-throwing. r=smaug
Callers should pass in UTF-8, since that's what the JS engine ends up with in the end anyway.

The various URL changes are because NS_NewURI converts incoming nsAString to
UTF-8 anyway.  So we might as well do that up-front and then use the UTF-8
string for both the NS_NewURI call and the error-reporting if it fails.

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

--HG--
extra : moz-landing-system : lando
2020-03-06 21:08:02 +00:00
Boris Zbarsky c878a8bb26 Bug 1619112 part 2. Pass char literals instead of char16_t literals into ErrorResult throwing methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65538

--HG--
extra : moz-landing-system : lando
2020-03-06 21:04:58 +00:00
Boris Zbarsky 8015d8dbc8 Bug 1619112 part 1. Change the internal storage for ErrorResult errors-with-messages to UTF8 strings. r=smaug
CStringArrayAppender is just a copy of StringArrayAppender with the incoming
types expanded to accept both wide and narrow strings.  Later patches will
remove the wide-string variants incrementally.

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

--HG--
extra : moz-landing-system : lando
2020-03-06 20:54:56 +00:00
Boris Zbarsky 0b8d2cf399 Bug 1617974. Simplify OOMReporter setup. r=peterv
We don't really need the OOMReporterInstantiator bit.  We can just use
FastErrorResult on the binding side, with casting to OOMReporter to ensure
callees take that, not an ErrorResult.

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

--HG--
extra : moz-landing-system : lando
2020-03-04 16:52:13 +00:00
Boris Zbarsky 9d69c2d87d Bug 1617972. Add a table that stores the exception type of DOM errors. r=peterv
The callsite in DOMIntersectionObserver did end up throwing a RangeError, as the
spec requires, because in the end we just used the exception code to determine
the kind of exception to throw, but was misleading about what it was doing.

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

--HG--
extra : moz-landing-system : lando
2020-03-03 15:47:22 +00:00
Simon Giesecke 8fc0c81644 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/bindings. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63137

--HG--
extra : moz-landing-system : lando
2020-02-20 15:47:53 +00:00
Boris Zbarsky f781fa6569 Bug 1615022 part 3. Disallow conversion of CopyableErrorResult to ErrorResult&. r=farre
This keeps us from passing it to functions that are planning to throw on the
ErrorResult and might throw a JS exception on it.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 10:19:05 +00:00
Boris Zbarsky 7c42333b8a Bug 1615022 part 1. Allow move-constructing ErrorResult from CopyableErrorResult. r=farre
We need the explicit constructor because otherwise which conversion operator to
use when constructing an ErrorResult from a CopyableErrorResult&& is
ambiguous.  And we want the conversion operator to allow passing
CopyableErrorResult& to functions that expect ErrorResult&&.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 08:37:39 +00:00
Boris Zbarsky 05327f8a52 Bug 1613978. Allow passing u"...", not just nsAStrings, to templated ThrowType/RangeError. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D62061

--HG--
extra : moz-landing-system : lando
2020-02-10 13:08:48 +00:00
Boris Zbarsky 1395be1f23 Bug 1613013 part 3. Annotate TypeErrors and RangeErrors from WebIDL implementations with the method they come from. r=peterv
Please review the changes to Errors.msg very carefully.  I caught a number of
mistakes there in self-review (e.g. not renumbering replacement markers
correctly when I added {0} to the beginnings of strings), and my confidence
that I caught them all is only middling.

A few lines (MSG_USELESS_SETTIMEOUT, MSG_TYPEDARRAY_IS_DETACHED,
MSG_NOT_SUBMIT_BUTTON) were removed from Errors.msg either because they were
already unused or because they either were single-user constant strings or
became such in the new setup and we could just use the string version of
ThrowTypeError.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 21:22:32 +00:00
Boris Zbarsky 09a1a6496e Bug 1613013 part 2. Change ThrowErrorMessage to be templated on the error number. r=peterv
This makes it easier to static_assert correct use.  It caught several bugs in
the next patch in this stack.

I had to disambiguate some calls to the templated ThrowDOMException that are
inside the binding_detail namespace, because otherwise they were trying to call
teh non-template function of the same name that's declared in binding_detail.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 20:40:36 +00:00
Boris Zbarsky 747a4d9f0a Bug 1613013 part 1. Annotate DOMExceptions from WebIDL implementations with the method they come from. r=peterv
This adds the name of the interface and method to the beginning of the exception
string when reporting the exception from Web IDL codegen, so it's clearer what
was called.

Some existing error messages are adjusted to not duplicate the information
about which method was called.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 21:16:10 +00:00
Boris Zbarsky 9b0b56bfc7 Bug 1612213 part 3. Switch Promise::RejectWithDOMException consumers to new convenience methods. r=smaug,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D61269

--HG--
extra : moz-landing-system : lando
2020-02-03 20:37:32 +00:00
Boris Zbarsky 7a16020858 Bug 1612213 part 2. Move the DOMException definitions from ErrorResult.h into a separate file. r=smaug
This way we can use the for Promise too.

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

--HG--
extra : moz-landing-system : lando
2020-01-30 08:57:42 +00:00
Boris Zbarsky a389959875 Bug 1412856 part 1. Change ClientOpPromise to use a CopyableErrorResult for its rejection type. r=dom-workers-and-storage-reviewers,sg?
Differential Revision: https://phabricator.services.mozilla.com/D61196

--HG--
extra : moz-landing-system : lando
2020-01-30 09:01:26 +00:00
Boris Zbarsky 5cd4320f78 Bug 1612007. Add convenience methods for throwing various spec-defined DOMExceptions on ErrorResult. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D61202

--HG--
extra : moz-landing-system : lando
2020-01-29 09:09:11 +00:00
Emilio Cobos Álvarez 256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Boris Zbarsky 18bee19d2c Bug 1594304. Add deprecation notes to methods that allow throwing a bare nsresult with no useful message. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D53092

--HG--
extra : moz-landing-system : lando
2019-11-14 22:51:21 +00:00
Boris Zbarsky 417c6749c3 Bug 1581276. Require a message arg to ThrowDOMException. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D46250

--HG--
extra : moz-landing-system : lando
2019-09-20 02:17:01 +00:00
Boris Zbarsky d0ce4c7209 Bug 1581315 part 3. Add MOZ_MUST_RETURN_FROM_CALLER_IF_THIS_IS_ARG to more ErrorResult methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D46107

--HG--
extra : moz-landing-system : lando
2019-09-20 02:19:18 +00:00
Boris Zbarsky fa0ce4b209 Bug 1581315 part 1. Adjust MOZ_MUST_RETURN_FROM_CALLER to only apply to method calls on arguments. r=nika
It doesn't really make sense to enforce this behavior for calls on stack
variables (which presumably we then want to do something with) and doesn't
necessarily make sense to enforce it for member variables either.

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

--HG--
extra : moz-landing-system : lando
2019-09-20 02:17:01 +00:00
Boris Zbarsky e26682d684 Bug 1581173 part 1. Add a way to more easily throw TypeErrors and RangeErrors with custom message strings via ErrorResult. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D45932

--HG--
extra : moz-landing-system : lando
2019-09-20 02:19:18 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Andi-Bogdan Postelnicu 6ab86028d3 Bug 1475515 - Remove member initialization for union Extra::mMessage. r=bz
MozReview-Commit-ID: GgJyXg5KxQm

--HG--
extra : rebase_source : 4a0e0137c1545b96aab9c436c42274db1c393a0a
2018-07-13 14:39:12 +03:00
Andi-Bogdan Postelnicu 88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Ben Kelly 818897b5a1 Bug 1471303 Fix CopyableErrorResult::operator==() to actually compile with ipdl types. r=bz 2018-06-27 06:51:24 -07:00
Steve Fink 70f3630002 Bug 1343620 - Use JS_HAZ_ROOTED everywhere instead of programmatic annotations, r=pbone
--HG--
extra : topic : haz.rooted
extra : rebase_source : 69a2c810ccfecdf7c59fe030a83aad9cb6d5f8ad
2018-06-06 16:28:38 -07:00
Emilio Cobos Álvarez 1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Ben Kelly d4090dc614 Bug 1357463 Add CopyableErrorResult to opt in to auto-cloning ErrorResult values. r=bz 2018-04-26 13:50:56 -07:00
Jeff Walden 04d21ccac0 Bug 1451248. r=jorendorff, r=bz
--HG--
extra : rebase_source : e26439a5954162bdaf332fbd63d623a3810e19e0
2018-04-25 19:40:09 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Boris Zbarsky 17509bc9da Bug 1449019. Actually propagate out exceptions from the innerHTML getter. r=smaug
I moved the IgnoreErrors decl so it would come after the OOMReporter decl and I
could add the new conversion operator.

MozReview-Commit-ID: B1S6DXmZfvE
2018-03-26 16:41:43 -04:00
Kannan Vijayan 627eb6ae9a Bug 1411415 - r=bz r=fitzgen 2018-03-05 19:27:02 -05:00
Eric Rahm 14975c9574 Bug 1434689 - Part 4: Annotate IgnoreErrors as MOZ_TEMPORARY_CLASS. r=bz
IgnoreErrors is intended to only be used as a temporary class, this adds an
explicit annotation.

--HG--
extra : rebase_source : 4142429081d3f70097594d200950b74d100ab67b
2018-02-02 13:21:51 -08:00
Boris Zbarsky f7f6285330 Bug 1434686 part 1. Introduce a mozilla::IgnoreErrors which can be used as a temporary to pass to an ErrorResult& arg when the error should be ignored. r=mystor
Once bug 1434689 is fixed, we can mark this thing as being required to be a temporary.

MozReview-Commit-ID: 7VX0XSYVOc4
2018-02-01 14:21:14 -05:00
Eric Rahm 07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
Sylvestre Ledru 15f2be4d17 Bug 1411034 - Remove the const to fix the -Wignored-qualifiers warning r=froydnj
MozReview-Commit-ID: 8BIWJpv9Odz

--HG--
extra : rebase_source : cc7222f056c9eeefd57ecd77f776aa35f080b2ff
2017-10-23 22:40:30 +02:00
Andrew McCreight fe0bcc3a40 Bug 1338272 - Require that the return value of MaybeSetPendingException is used. r=bz
Most of the time, the return value of this method should be checked,
because behavior should depend on whether or not an exception is
thrown. However, if it is called immediately after a throw it doesn't
need to be checked because it will always return true. bz said there
is no public API that lets you assume there is an exception because it
would be "too easy to misuse".

MozReview-Commit-ID: CqyicBbcNjW

--HG--
extra : rebase_source : a5b74ba88a927a90d491ceb8f0b750a67f62b0f4
2017-02-14 16:17:02 -08:00
Michael Layzell 46ade67ada Bug 1331434 - Part 2: Add MOZ_MAY_CALL_AFTER_MUST_RETURN and MOZ_MUST_RETURN_FROM_CALLER annotations, r=ehsan
MozReview-Commit-ID: 1o2egvdhkqT
2017-03-07 19:06:48 -05:00