From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- xpcom/threads/StateMirroring.h | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'xpcom/threads/StateMirroring.h') 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 -# 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 +#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 and Canonical 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 class AbstractMirror; @@ -335,9 +335,9 @@ class Mirror { void ConnectedOnCanonicalThread(AbstractCanonical* aCanonical) override { MOZ_ASSERT(aCanonical->OwnerThread()->IsCurrentThreadIn()); -# ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED +#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED ++mIncomingConnects; -# endif +#endif OwnerThread()->DispatchStateChange( NewRunnableMethod>>( "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> mCanonical; -# ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED +#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED std::atomic mIncomingConnects = 0; -# endif +#endif }; public: @@ -446,7 +446,7 @@ class Mirror { RefPtr mImpl; }; -# undef MIRROR_LOG +#undef MIRROR_LOG } // namespace mozilla -- cgit v1.2.3