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

35 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke 9c23bfdb2e Bug 1685677 - Extract functions from CheckTemporaryStorageLimits and rename it to CleanupTemporaryStorage. r=dom-workers-and-storage-reviewers,janv
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins

Differential Revision: https://phabricator.services.mozilla.com/D101145
2021-02-02 17:46:40 +00:00
Csoregi Natalia 74e4cf16bf Backed out 5 changesets (bug 1689967, bug 1685677) for bustage on TestFlatten.cpp. CLOSED TREE
Backed out changeset 129b45a961fb (bug 1689967)
Backed out changeset d354b3d5312c (bug 1685677)
Backed out changeset 3c1b1f51f19c (bug 1685677)
Backed out changeset cc4f20677a7e (bug 1685677)
Backed out changeset bcbba85964cb (bug 1685677)
2021-02-02 17:05:23 +02:00
Simon Giesecke e4a5513e58 Bug 1685677 - Extract functions from CheckTemporaryStorageLimits and rename it to CleanupTemporaryStorage. r=dom-workers-and-storage-reviewers,janv
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins

Differential Revision: https://phabricator.services.mozilla.com/D101145
2021-02-02 12:53:44 +00:00
smolnar d18d54a300 Backed out 4 changesets (bug 1685677) for causing build bustage in TestFlatten. CLOSED TREE DONTBUILD
Backed out changeset 0110eb26213b (bug 1685677)
Backed out changeset e3223c398959 (bug 1685677)
Backed out changeset d1fbaf6882a3 (bug 1685677)
Backed out changeset e1e26422161e (bug 1685677)
2021-02-02 14:46:30 +02:00
Simon Giesecke 0da4951ba0 Bug 1685677 - Extract functions from CheckTemporaryStorageLimits and rename it to CleanupTemporaryStorage. r=dom-workers-and-storage-reviewers,janv
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins

Differential Revision: https://phabricator.services.mozilla.com/D101145
2021-02-02 10:10:21 +00:00
Butkovits Atila cc5cb272ff Backed out 2 changesets (bug 1685677) for causing xpcshell failure. CLOSED TREE
Backed out changeset 26e9adf102c8 (bug 1685677)
Backed out changeset ed3a62552625 (bug 1685677)
2021-02-01 22:54:39 +02:00
Simon Giesecke f78d2e7d7e Bug 1685677 - Extract functions from CheckTemporaryStorageLimits and rename it to CleanupTemporaryStorage. r=dom-workers-and-storage-reviewers,janv
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins

Differential Revision: https://phabricator.services.mozilla.com/D101145
2021-02-01 14:42:15 +00:00
Jan Varga 165dbaf2e5 Bug 1689802 - Fix construction of MovingNotNull from NotNull; r=sg
Depends on D103556

Differential Revision: https://phabricator.services.mozilla.com/D103632
2021-02-01 13:52:31 +00:00
smolnar 0fc1e1e521 Backed out 4 changesets (bug 1685677) for causing xpcshell failures in test_storagePressure. CLOSED TREE
Backed out changeset 263d593f8609 (bug 1685677)
Backed out changeset 81a737afce4f (bug 1685677)
Backed out changeset ea958694bd17 (bug 1685677)
Backed out changeset 121e93b3787f (bug 1685677)
2021-02-01 16:38:01 +02:00
Simon Giesecke 1134a78170 Bug 1685677 - Extract functions from CheckTemporaryStorageLimits and rename it to CleanupTemporaryStorage. r=dom-workers-and-storage-reviewers,janv
Extracts parts of CheckTemporaryStorageLimits into the following new private
member functions of QuotaManager:
* LockedGetOriginInfosExceedingGroupLimit
* LockedGetOriginInfosExceedingGlobalLimit
* GetOriginInfosExceedingLimits
* ClearOrigins

Differential Revision: https://phabricator.services.mozilla.com/D101145
2021-02-01 13:37:30 +00:00
Simon Giesecke 7326b3cd81 Bug 1410760 - Fix comment on NotNull<UniquePtr<T>>. r=gerald DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D100322
2020-12-22 11:11:21 +00:00
Simon Giesecke 9235fda693 Bug 1648452 - Make construction of NotNull work with MovingNotNull of derived-type. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81077
2020-06-25 13:10:08 +00:00
Simon Giesecke 736ed67de5 Bug 1634003 - Add MovingNotNull class template. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D73032
2020-05-05 09:09:13 +00:00
Simon Giesecke ddfa9fe2d2 Bug 1633719 - Make NotNull move its member pointer where possible. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D72827
2020-05-05 09:09:01 +00:00
Simon Giesecke 2e99dc5200 Bug 1633809 - Suppress -Wpointer-bool-conversion in WrapNotNullUnchecked. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D73013
2020-04-29 14:04:09 +00:00
Simon Giesecke 8f84ea1eaa Bug 1631709 - NotNull must not be movable. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71721
2020-04-28 11:23:05 +00:00
Simon Giesecke 9a017967d6 Bug 1628715 - Part 14: Add MOZ_NONNULL_RETURN attribute on NotNull::operator->. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71299
2020-04-24 13:33:55 +00:00
Simon Giesecke e6e6d49af2 Bug 1628715 - Part 13: Add specialization NotNull<T*> with MOZ_NONNULL_RETURN attributes. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71298
2020-04-24 13:33:48 +00:00
Simon Giesecke 1961cd994a Bug 1628715 - Part 12: Add WrapNotNullUnchecked for NotNull<T*>. r=xpcom-reviewers,nika,jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71296
2020-04-24 13:33:35 +00:00
André Bargull 14ca007916 Bug 1625138 - Part 41: Remove no longer needed includes for mozilla/TypeTraits. r=froydnj
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.

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

--HG--
extra : moz-landing-system : lando
2020-03-28 16:00:09 +00:00
André Bargull 32cb16fc45 Bug 1625138 - Part 32: Replace mozilla::RemoveConst with std::remove_const. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68551

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:19 +00:00
André Bargull 42d4ebbda9 Bug 1625138 - Part 27: Replace mozilla::DeclVal with std::declval. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68545

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull 3ee851a1a5 Bug 1625138 - Part 25: Replace mozilla::RemoveReference with std::remove_reference. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68380

--HG--
extra : moz-landing-system : lando
2020-03-28 14:16:19 +00:00
André Bargull 44a255a4d6 Bug 1625138 - Part 22: Replace mozilla::IsArray with std::is_array. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68377

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:17 +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
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
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
Masatoshi Kimura 1c639cc220 Bug 1463011 - Constexpr-ify mozilla::NotNull r=njn
MozReview-Commit-ID: EyXmRskjtfU

--HG--
extra : rebase_source : bd86a8126d1f2098c436f5e61106857c8b068c04
2018-05-21 23:03:16 +09:00
Gerald Squelart a1f5bed9e9 Bug 1443367 - Rework MakeNotNull to build with VS 2017 15.6 - r=njn
VS 2017 15.6 (March 2018) doesn't seem to understand
`*DeclVal<SharedFontList*>()` anymore.
To work around this issue, the pointed-to type is now extracted in a separate
struct, for which we provide a specialization for raw pointers, so we don't
encounter the shaky `*DeclVal<T*>()` statement anymore.

MozReview-Commit-ID: FuslManbfdB

--HG--
extra : rebase_source : be3813aa9a028e6891cb3de1fc4faae5bde0348e
2018-03-06 20:27:27 +11:00
Gerald Squelart 5bea7c3a56 Bug 1410252 - MakeNotNull<PointerType, OptionalPointeeType>(Args...) - r=njn
MakeNotNull is similar to UniquePtr, in that it combines the infallible
allocation and construction of an object on the heap and wraps the (raw or
smart) pointer into a NotNull.
It skips the unnecessary null check from WrapNotNull, and removes the usual
naked 'new' used in many WrapNotNull calls.

MozReview-Commit-ID: UwCrhDnkUg

--HG--
extra : rebase_source : 5a027165fc17ed748783c7ffda03eb421865ad6e
2017-10-20 14:56:01 +11:00
Masatoshi Kimura 5480e54c73 Bug 1374629 - Ensure that mozilla::NotNull has zero space overhead. r=njn
MozReview-Commit-ID: 9Bo2qxd3HRv

--HG--
extra : rebase_source : e35aec9978f13092d91141955effb0942e84e70c
2017-06-22 00:52:28 +09:00
Wes Kocher fe34bc092b Backed out changeset 3411f1c818f6 (bug 1374629) for build bustage a=backout
MozReview-Commit-ID: GHWdfD0h8LI
2017-06-21 15:50:15 -07:00
Masatoshi Kimura 14bf5a00e1 Bug 1374629 - Ensure that mozilla::NotNull has zero space overhead. r=njn
MozReview-Commit-ID: 9Bo2qxd3HRv

--HG--
extra : rebase_source : 5e19d7c405f243b602ee2beca3a94b880eddb27e
2017-06-22 00:52:28 +09:00
Nicholas Nethercote b3d842431f Bug 1272203 (part 1) - Add mozilla::NotNull to MFBT. r=froydnj.
This patch implements mozilla::NotNull, which is similar but not identicial to
gsl::not_null.

The current draft(?) implementation of gsl::not_null is at
https://github.com/Microsoft/GSL/blob/master/include/gsl.h.

The main difference is that not_null allows implicit conversion from T to
not_null<T>. In contrast, NotNull only allows explicit conversion from T to
NotNull<T> via WrapNotNull().

The rationale for this is that when converting from a less-constrained type to
a more constrained type, implicit conversion is undesirable. For example, if I
changed a function f from this:

  f(int* aPtr);

to this:

  f(gsl::not_null<int*> aPtr);

no call sites would have to be modified. But if I changed it to this:

  f(mozilla::NotNull<int*> aPtr);

call sites *would* need to be modified. This is a good thing! It forces the
author to audit the call sites for non-nullness, and encourages them to
back-propagate NotNull throughout the code.

The other difference between not_null and NotNull is that not_null disables
pointer arithmetic, which means it cannot be used with array pointers. I have
not implemented this restriction for NotNull because it seems arbitrary and
unnecessary.
2016-05-12 14:21:16 +10:00