diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /xpcom/threads/StateMirroring.h | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/threads/StateMirroring.h')
-rw-r--r-- | xpcom/threads/StateMirroring.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/xpcom/threads/StateMirroring.h b/xpcom/threads/StateMirroring.h index 9f8ded70f4..887fe6edb1 100644 --- a/xpcom/threads/StateMirroring.h +++ b/xpcom/threads/StateMirroring.h @@ -4,22 +4,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#if !defined(StateMirroring_h_) -# define StateMirroring_h_ - -# include <cstddef> -# include "mozilla/AbstractThread.h" -# include "mozilla/AlreadyAddRefed.h" -# include "mozilla/Assertions.h" -# include "mozilla/Logging.h" -# include "mozilla/Maybe.h" -# include "mozilla/RefPtr.h" -# include "mozilla/StateWatching.h" -# include "nsCOMPtr.h" -# include "nsIRunnable.h" -# include "nsISupports.h" -# include "nsTArray.h" -# include "nsThreadUtils.h" +#ifndef XPCOM_THREADS_STATEMIRRORING_H_ +#define XPCOM_THREADS_STATEMIRRORING_H_ + +#include <cstddef> +#include "mozilla/AbstractThread.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Assertions.h" +#include "mozilla/Logging.h" +#include "mozilla/Maybe.h" +#include "mozilla/RefPtr.h" +#include "mozilla/StateWatching.h" +#include "nsCOMPtr.h" +#include "nsIRunnable.h" +#include "nsISupports.h" +#include "nsTArray.h" +#include "nsThreadUtils.h" /* * The state-mirroring machinery allows pieces of interesting state to be @@ -51,9 +51,9 @@ namespace mozilla { // Mirror<T> and Canonical<T> inherit WatchTarget, so we piggy-back on the // logging that WatchTarget already does. Given that, it makes sense to share // the same log module. -# define MIRROR_LOG(x, ...) \ - MOZ_ASSERT(gStateWatchingLog); \ - MOZ_LOG(gStateWatchingLog, LogLevel::Debug, (x, ##__VA_ARGS__)) +#define MIRROR_LOG(x, ...) \ + MOZ_ASSERT(gStateWatchingLog); \ + MOZ_LOG(gStateWatchingLog, LogLevel::Debug, (x, ##__VA_ARGS__)) template <typename T> class AbstractMirror; @@ -335,9 +335,9 @@ class Mirror { void ConnectedOnCanonicalThread(AbstractCanonical<T>* aCanonical) override { MOZ_ASSERT(aCanonical->OwnerThread()->IsCurrentThreadIn()); -# ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED +#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED ++mIncomingConnects; -# endif +#endif OwnerThread()->DispatchStateChange( NewRunnableMethod<StoreRefPtrPassByPtr<AbstractCanonical<T>>>( "Mirror::Impl::SetCanonical", this, &Impl::SetCanonical, @@ -349,9 +349,9 @@ class Mirror { aCanonical); MOZ_ASSERT(OwnerThread()->IsCurrentThreadIn()); MOZ_ASSERT(!IsConnected()); -# ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED +#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED --mIncomingConnects; -# endif +#endif mCanonical = aCanonical; } @@ -413,9 +413,9 @@ class Mirror { private: T mValue; RefPtr<AbstractCanonical<T>> mCanonical; -# ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED +#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED std::atomic<size_t> mIncomingConnects = 0; -# endif +#endif }; public: @@ -446,7 +446,7 @@ class Mirror { RefPtr<Impl> mImpl; }; -# undef MIRROR_LOG +#undef MIRROR_LOG } // namespace mozilla |