From 51e15f5815d3e9754195d7ad4c4b80f2fda8f735 Mon Sep 17 00:00:00 2001 From: Michael Kohler Date: Tue, 10 Jan 2012 00:29:30 -0500 Subject: [PATCH] Bug 711818 - MOZILLA_GUARD_OBJECT_NOTIFIER* should use a MOZ_ prefix to follow MFBT style --- content/base/public/nsContentUtils.h | 6 ++-- content/base/public/nsDOMFile.h | 4 +-- content/base/src/nsDOMFile.cpp | 4 +-- content/base/src/nsFrameLoader.cpp | 6 ++-- js/xpconnect/src/xpcprivate.h | 30 ++++++++++---------- mfbt/GuardObjects.h | 36 ++++++++++++------------ toolkit/components/telemetry/Telemetry.h | 6 ++-- xpcom/glue/AutoRestore.h | 6 ++-- xpcom/glue/Mutex.h | 12 ++++---- 9 files changed, 55 insertions(+), 55 deletions(-) diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index 551b0d62c92..78ca02daca8 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -1989,15 +1989,15 @@ private: class NS_STACK_CLASS nsAutoScriptBlocker { public: - nsAutoScriptBlocker(MOZILLA_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + nsAutoScriptBlocker(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; nsContentUtils::AddScriptBlocker(); } ~nsAutoScriptBlocker() { nsContentUtils::RemoveScriptBlocker(); } private: - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; class NS_STACK_CLASS nsAutoScriptBlockerSuppressNodeRemoved : diff --git a/content/base/public/nsDOMFile.h b/content/base/public/nsDOMFile.h index 8c86f161448..7b6a8a9ae4f 100644 --- a/content/base/public/nsDOMFile.h +++ b/content/base/public/nsDOMFile.h @@ -381,11 +381,11 @@ private: class NS_STACK_CLASS nsDOMFileInternalUrlHolder { public: nsDOMFileInternalUrlHolder(nsIDOMBlob* aFile, nsIPrincipal* aPrincipal - MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM); + MOZ_GUARD_OBJECT_NOTIFIER_PARAM); ~nsDOMFileInternalUrlHolder(); nsAutoString mUrl; private: - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; #endif diff --git a/content/base/src/nsDOMFile.cpp b/content/base/src/nsDOMFile.cpp index 0e7105a2ccf..6ff75ea5955 100644 --- a/content/base/src/nsDOMFile.cpp +++ b/content/base/src/nsDOMFile.cpp @@ -659,8 +659,8 @@ nsDOMFileError::GetCode(PRUint16* aCode) nsDOMFileInternalUrlHolder::nsDOMFileInternalUrlHolder(nsIDOMBlob* aFile, nsIPrincipal* aPrincipal - MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; aFile->GetInternalUrl(aPrincipal, mUrl); } diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index bcbc98bc8c6..2044a994a24 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -742,12 +742,12 @@ AllDescendantsOfType(nsIDocShellTreeItem* aParentItem, PRInt32 aType) class NS_STACK_CLASS AutoResetInShow { private: nsFrameLoader* mFrameLoader; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER public: - AutoResetInShow(nsFrameLoader* aFrameLoader MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + AutoResetInShow(nsFrameLoader* aFrameLoader MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mFrameLoader(aFrameLoader) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; } ~AutoResetInShow() { mFrameLoader->mInShow = false; } }; diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index e5415d5f486..f2edcc44459 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -370,10 +370,10 @@ public: static void DestroyLock(XPCLock* lock) {delete lock;} - XPCAutoLock(XPCLock* lock MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + XPCAutoLock(XPCLock* lock MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mLock(lock) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; if (mLock) mLock->Enter(); } @@ -387,7 +387,7 @@ public: private: XPCLock* mLock; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER // Not meant to be implemented. This makes it a compiler error to // construct or assign an XPCAutoLock object incorrectly. @@ -409,10 +409,10 @@ private: class NS_STACK_CLASS XPCAutoUnlock { public: - XPCAutoUnlock(XPCLock* lock MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + XPCAutoUnlock(XPCLock* lock MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mLock(lock) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; if (mLock) { mLock->Exit(); } @@ -426,7 +426,7 @@ public: private: XPCLock* mLock; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER // Not meant to be implemented. This makes it a compiler error to // construct or assign an XPCAutoUnlock object incorrectly. @@ -3907,11 +3907,11 @@ class NS_STACK_CLASS AutoJSErrorAndExceptionEater { public: AutoJSErrorAndExceptionEater(JSContext* aCX - MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mCX(aCX), mOldErrorReporter(JS_SetErrorReporter(mCX, nsnull)), mOldExceptionState(JS_SaveExceptionState(mCX)) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; } ~AutoJSErrorAndExceptionEater() { @@ -3922,7 +3922,7 @@ private: JSContext* mCX; JSErrorReporter mOldErrorReporter; JSExceptionState* mOldExceptionState; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; /****************************************************************************** @@ -3936,10 +3936,10 @@ public: * Saves the JSContext as well as initializing our state * @param cx The JSContext, this can be null, we don't do anything then */ - AutoScriptEvaluate(JSContext * cx MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + AutoScriptEvaluate(JSContext * cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mJSContext(cx), mState(0), mErrorReporterSet(false), mEvaluated(false), mContextHasThread(0) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; } /** @@ -3961,7 +3961,7 @@ private: bool mEvaluated; jsword mContextHasThread; JSAutoEnterCompartment mEnterCompartment; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER // No copying or assignment allowed AutoScriptEvaluate(const AutoScriptEvaluate &) MOZ_DELETE; @@ -3973,11 +3973,11 @@ class NS_STACK_CLASS AutoResolveName { public: AutoResolveName(XPCCallContext& ccx, jsid name - MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mTLS(ccx.GetThreadData()), mOld(mTLS->SetResolveName(name)), mCheck(name) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; } ~AutoResolveName() { @@ -3992,7 +3992,7 @@ private: XPCPerThreadData* mTLS; jsid mOld; jsid mCheck; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; /***************************************************************************/ diff --git a/mfbt/GuardObjects.h b/mfbt/GuardObjects.h index c3f8c447ca9..1ed2895c9bb 100644 --- a/mfbt/GuardObjects.h +++ b/mfbt/GuardObjects.h @@ -68,21 +68,21 @@ namespace mozilla { * * These classes are intended to be used only via the macros immediately * below them: - * MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member + * MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member * variable, and should be put where a declaration of a private * member variable would be placed. - * MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the * parameters to each constructor of the guard object; it declares * (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM * variant for constructors that take no other parameters.) - * MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in * the implementation of such constructors when they are not inline. - * MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in * the implementation of such constructors to pass the parameter to * a base class that also uses these macros - * MOZILLA_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each + * MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each * constructor. It uses the parameter declared by - * MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM. + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM. * * For more details, and examples of using these macros, see * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla @@ -131,29 +131,29 @@ namespace mozilla { } }; - #define MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER \ + #define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \ mozilla::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary; - #define MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM \ + #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \ , const mozilla::GuardObjectNotifier& _notifier = \ mozilla::GuardObjectNotifier() - #define MOZILLA_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \ + #define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \ const mozilla::GuardObjectNotifier& _notifier = \ mozilla::GuardObjectNotifier() - #define MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \ + #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \ , const mozilla::GuardObjectNotifier& _notifier - #define MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \ + #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \ , _notifier - #define MOZILLA_GUARD_OBJECT_NOTIFIER_INIT \ + #define MOZ_GUARD_OBJECT_NOTIFIER_INIT \ PR_BEGIN_MACRO _mCheckNotUsedAsTemporary.Init(_notifier); PR_END_MACRO #else /* defined(DEBUG) */ - #define MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER - #define MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM - #define MOZILLA_GUARD_OBJECT_NOTIFIER_ONLY_PARAM - #define MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL - #define MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT - #define MOZILLA_GUARD_OBJECT_NOTIFIER_INIT PR_BEGIN_MACRO PR_END_MACRO + #define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER + #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM + #define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM + #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL + #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT + #define MOZ_GUARD_OBJECT_NOTIFIER_INIT PR_BEGIN_MACRO PR_END_MACRO #endif /* !defined(DEBUG) */ diff --git a/toolkit/components/telemetry/Telemetry.h b/toolkit/components/telemetry/Telemetry.h index 3d7d642c46e..8e46a3f0c63 100644 --- a/toolkit/components/telemetry/Telemetry.h +++ b/toolkit/components/telemetry/Telemetry.h @@ -84,10 +84,10 @@ base::Histogram* GetHistogramById(ID id); template class AutoTimer { public: - AutoTimer(TimeStamp aStart = TimeStamp::Now() MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + AutoTimer(TimeStamp aStart = TimeStamp::Now() MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : start(aStart) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; } ~AutoTimer() { @@ -96,7 +96,7 @@ public: private: const TimeStamp start; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; /** diff --git a/xpcom/glue/AutoRestore.h b/xpcom/glue/AutoRestore.h index 77eb3494d05..2bb0148f9e2 100644 --- a/xpcom/glue/AutoRestore.h +++ b/xpcom/glue/AutoRestore.h @@ -62,12 +62,12 @@ namespace mozilla { private: T& mLocation; T mValue; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER public: - AutoRestore(T& aValue MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) + AutoRestore(T& aValue MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mLocation(aValue), mValue(aValue) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; } ~AutoRestore() { mLocation = mValue; } }; diff --git a/xpcom/glue/Mutex.h b/xpcom/glue/Mutex.h index 01048e6474c..80db53cadf7 100644 --- a/xpcom/glue/Mutex.h +++ b/xpcom/glue/Mutex.h @@ -176,10 +176,10 @@ public: * @param aLock A valid mozilla::Mutex* returned by * mozilla::Mutex::NewMutex. **/ - MutexAutoLock(mozilla::Mutex& aLock MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) : + MutexAutoLock(mozilla::Mutex& aLock MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mLock(&aLock) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; NS_ASSERTION(mLock, "null mutex"); mLock->Lock(); } @@ -196,7 +196,7 @@ private: static void operator delete(void*); mozilla::Mutex* mLock; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; @@ -210,10 +210,10 @@ private: class NS_COM_GLUE NS_STACK_CLASS MutexAutoUnlock { public: - MutexAutoUnlock(mozilla::Mutex& aLock MOZILLA_GUARD_OBJECT_NOTIFIER_PARAM) : + MutexAutoUnlock(mozilla::Mutex& aLock MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mLock(&aLock) { - MOZILLA_GUARD_OBJECT_NOTIFIER_INIT; + MOZ_GUARD_OBJECT_NOTIFIER_INIT; NS_ASSERTION(mLock, "null lock"); mLock->Unlock(); } @@ -231,7 +231,7 @@ private: static void operator delete(void*); mozilla::Mutex* mLock; - MOZILLA_DECL_USE_GUARD_OBJECT_NOTIFIER + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER };