tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 280f29e2b86ea41f688a17969f9848a908326e01
parent c04e52aa0c31315ac54ac94e07eef17a80a015db
Author: serge-sans-paille <sguelton@mozilla.com>
Date:   Fri, 10 Oct 2025 13:56:35 +0000

Bug 1993181 - Cleanup mfbt/NotNull.h r=emilio

- Remove unused includes
- use std::nullptr_t instead of decltype(nullptr)

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

Diffstat:
Mdom/base/Element.cpp | 1-
Mdom/base/nsContentUtils.cpp | 1-
Mdom/base/nsFrameMessageManager.cpp | 1-
Mmfbt/NotNull.h | 11+++++------
4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp @@ -49,7 +49,6 @@ #include "mozilla/MappedDeclarationsBuilder.h" #include "mozilla/Maybe.h" #include "mozilla/MouseEvents.h" -#include "mozilla/NotNull.h" #include "mozilla/PointerLockManager.h" #include "mozilla/PresShell.h" #include "mozilla/PresShellForwards.h" diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp @@ -99,7 +99,6 @@ #include "mozilla/Maybe.h" #include "mozilla/MediaFeatureChange.h" #include "mozilla/MouseEvents.h" -#include "mozilla/NotNull.h" #include "mozilla/NullPrincipal.h" #include "mozilla/OriginAttributes.h" #include "mozilla/Preferences.h" diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp @@ -37,7 +37,6 @@ #include "mozilla/Assertions.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/ErrorResult.h" -#include "mozilla/NotNull.h" #include "mozilla/OwningNonNull.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/RefPtr.h" diff --git a/mfbt/NotNull.h b/mfbt/NotNull.h @@ -62,8 +62,7 @@ // NotNull is an alternative that can be used in any of the above cases except // for the last one, where the handle type is |void|. See below. -#include <stddef.h> - +#include <cstddef> #include <type_traits> #include <utility> @@ -434,15 +433,15 @@ constexpr bool operator!=(const T& aLhs, const NotNull<U>& aRhs) { // Disallow comparing a NotNull to a nullptr. template <typename T> -bool operator==(const NotNull<T>&, decltype(nullptr)) = delete; +bool operator==(const NotNull<T>&, std::nullptr_t) = delete; template <typename T> -bool operator!=(const NotNull<T>&, decltype(nullptr)) = delete; +bool operator!=(const NotNull<T>&, std::nullptr_t) = delete; // Disallow comparing a nullptr to a NotNull. template <typename T> -bool operator==(decltype(nullptr), const NotNull<T>&) = delete; +bool operator==(std::nullptr_t, const NotNull<T>&) = delete; template <typename T> -bool operator!=(decltype(nullptr), const NotNull<T>&) = delete; +bool operator!=(std::nullptr_t, const NotNull<T>&) = delete; } // namespace mozilla