diff --git a/extensions/auth/nsAuthGSSAPI.h b/extensions/auth/nsAuthGSSAPI.h index 5fce23b4ef46..a0430b42f41f 100644 --- a/extensions/auth/nsAuthGSSAPI.h +++ b/extensions/auth/nsAuthGSSAPI.h @@ -41,7 +41,7 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIAUTHMODULE - nsAuthGSSAPI(pType package); + explicit nsAuthGSSAPI(pType package); static void Shutdown(); diff --git a/modules/libjar/nsJAR.h b/modules/libjar/nsJAR.h index 43b032512052..b7c716de39f0 100644 --- a/modules/libjar/nsJAR.h +++ b/modules/libjar/nsJAR.h @@ -140,7 +140,7 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIZIPENTRY - nsJARItem(nsZipItem* aZipItem); + explicit nsJARItem(nsZipItem* aZipItem); private: virtual ~nsJARItem() {} @@ -167,7 +167,7 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIUTF8STRINGENUMERATOR - nsJAREnumerator(nsZipFind *aFind) : mFind(aFind), mName(nullptr) { + explicit nsJAREnumerator(nsZipFind *aFind) : mFind(aFind), mName(nullptr) { NS_ASSERTION(mFind, "nsJAREnumerator: Missing zipFind."); } diff --git a/modules/libjar/zipwriter/nsDeflateConverter.h b/modules/libjar/zipwriter/nsDeflateConverter.h index 51c4778708d9..95ee17586cd1 100644 --- a/modules/libjar/zipwriter/nsDeflateConverter.h +++ b/modules/libjar/zipwriter/nsDeflateConverter.h @@ -31,7 +31,7 @@ public: mLevel = 6; } - nsDeflateConverter(int32_t level) + explicit nsDeflateConverter(int32_t level) { mLevel = level; } diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp index b3f850ac24db..6827afe219c1 100644 --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp @@ -105,7 +105,7 @@ public: ValueObserverHashKey(const char *aPref, PrefChangedFunc aCallback) : mPrefName(aPref), mCallback(aCallback) { } - ValueObserverHashKey(const ValueObserverHashKey *aOther) : + explicit ValueObserverHashKey(const ValueObserverHashKey *aOther) : mPrefName(aOther->mPrefName), mCallback(aOther->mCallback) { } diff --git a/modules/libpref/nsPrefBranch.h b/modules/libpref/nsPrefBranch.h index ed629e686309..d93817c565d5 100644 --- a/modules/libpref/nsPrefBranch.h +++ b/modules/libpref/nsPrefBranch.h @@ -78,7 +78,7 @@ class PrefCallback : public PLDHashEntryHdr { } // Copy constructor needs to be explicit or the linker complains. - PrefCallback(const PrefCallback *&aCopy) + explicit PrefCallback(const PrefCallback *&aCopy) : mDomain(aCopy->mDomain), mBranch(aCopy->mBranch), mWeakRef(aCopy->mWeakRef), diff --git a/profile/dirserviceprovider/nsProfileDirServiceProvider.h b/profile/dirserviceprovider/nsProfileDirServiceProvider.h index bf00523923a5..3754a896d5a0 100644 --- a/profile/dirserviceprovider/nsProfileDirServiceProvider.h +++ b/profile/dirserviceprovider/nsProfileDirServiceProvider.h @@ -71,7 +71,7 @@ public: virtual nsresult Shutdown(); protected: - nsProfileDirServiceProvider(bool aNotifyObservers = true); + explicit nsProfileDirServiceProvider(bool aNotifyObservers = true); virtual ~nsProfileDirServiceProvider(); nsresult Initialize(); diff --git a/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.cpp b/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.cpp index c4f89d47db39..337a36451876 100644 --- a/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.cpp +++ b/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.cpp @@ -29,7 +29,7 @@ struct Connection PRFileDesc *mSocket; char mByte; - Connection(PRFileDesc *aSocket); + explicit Connection(PRFileDesc *aSocket); ~Connection(); }; diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp index 931f73c0a421..2d7e7bc59b5b 100644 --- a/toolkit/components/downloads/ApplicationReputation.cpp +++ b/toolkit/components/downloads/ApplicationReputation.cpp @@ -212,7 +212,7 @@ public: NS_DECL_NSIURLCLASSIFIERCALLBACK // Constructor and destructor - PendingDBLookup(PendingLookup* aPendingLookup); + explicit PendingDBLookup(PendingLookup* aPendingLookup); // Look up the given URI in the safebrowsing DBs, optionally on both the allow // list and the blocklist. If there is a match, call diff --git a/toolkit/components/osfile/NativeOSFileInternals.cpp b/toolkit/components/osfile/NativeOSFileInternals.cpp index 311209c961a7..a674df14e10d 100644 --- a/toolkit/components/osfile/NativeOSFileInternals.cpp +++ b/toolkit/components/osfile/NativeOSFileInternals.cpp @@ -92,10 +92,10 @@ struct ScopedArrayBufferContentsTraits { }; struct ScopedArrayBufferContents: public Scoped { - ScopedArrayBufferContents(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM): + explicit ScopedArrayBufferContents(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM): Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT) { } - ScopedArrayBufferContents(const ArrayBufferContents& v + explicit ScopedArrayBufferContents(const ArrayBufferContents& v MOZ_GUARD_OBJECT_NOTIFIER_PARAM): Scoped(v MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT) { } @@ -171,7 +171,7 @@ public: * @param aStartDate The instant at which the operation was * requested. Used to collect Telemetry statistics. */ - AbstractResult(TimeStamp aStartDate) + explicit AbstractResult(TimeStamp aStartDate) : mStartDate(aStartDate) { MOZ_ASSERT(NS_IsMainThread()); @@ -277,7 +277,7 @@ AbstractResult::GetResult(JSContext *cx, JS::MutableHandleValue aResult) class StringResult MOZ_FINAL : public AbstractResult { public: - StringResult(TimeStamp aStartDate) + explicit StringResult(TimeStamp aStartDate) : AbstractResult(aStartDate) { } @@ -328,7 +328,7 @@ StringResult::GetCacheableResult(JSContext* cx, JS::MutableHandleValue aResult) class TypedArrayResult MOZ_FINAL : public AbstractResult { public: - TypedArrayResult(TimeStamp aStartDate) + explicit TypedArrayResult(TimeStamp aStartDate) : AbstractResult(aStartDate) { } diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index dff063e621e1..8ce16ef6a2a4 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -101,7 +101,7 @@ private: nsRefPtr mService; public: - nsAppExitEvent(nsAppStartup *service) : mService(service) {} + explicit nsAppExitEvent(nsAppStartup *service) : mService(service) {} NS_IMETHOD Run() { // Tell the appshell to exit diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index f1b6f4a5bc09..bea32fab3e94 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -77,7 +77,7 @@ template class AutoHashtable : public nsTHashtable { public: - AutoHashtable(uint32_t initLength = PL_DHASH_DEFAULT_INITIAL_LENGTH); + explicit AutoHashtable(uint32_t initLength = PL_DHASH_DEFAULT_INITIAL_LENGTH); typedef bool (*ReflectEntryFunc)(EntryType *entry, JSContext *cx, JS::Handle obj); bool ReflectIntoJS(ReflectEntryFunc entryFunc, JSContext *cx, JS::Handle obj); private: @@ -306,7 +306,7 @@ class TelemetryIOInterposeObserver : public IOInterposeObserver }; public: - TelemetryIOInterposeObserver(nsIFile* aXreDir); + explicit TelemetryIOInterposeObserver(nsIFile* aXreDir); /** * An implementation of Observe that records statistics of all diff --git a/toolkit/components/url-classifier/HashStore.h b/toolkit/components/url-classifier/HashStore.h index ede320bb9ef2..c33323f05c72 100644 --- a/toolkit/components/url-classifier/HashStore.h +++ b/toolkit/components/url-classifier/HashStore.h @@ -22,7 +22,7 @@ namespace safebrowsing { // new hashes. class TableUpdate { public: - TableUpdate(const nsACString& aTable) + explicit TableUpdate(const nsACString& aTable) : mTable(aTable), mLocalUpdate(false) {} const nsCString& TableName() const { return mTable; } diff --git a/toolkit/components/url-classifier/nsUrlClassifierProxies.h b/toolkit/components/url-classifier/nsUrlClassifierProxies.h index c8e9fd1a3087..3ab1948a1e5c 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierProxies.h +++ b/toolkit/components/url-classifier/nsUrlClassifierProxies.h @@ -21,7 +21,7 @@ class UrlClassifierDBServiceWorkerProxy MOZ_FINAL : public nsIUrlClassifierDBServiceWorker { public: - UrlClassifierDBServiceWorkerProxy(nsIUrlClassifierDBServiceWorker* aTarget) + explicit UrlClassifierDBServiceWorkerProxy(nsIUrlClassifierDBServiceWorker* aTarget) : mTarget(aTarget) { } @@ -162,7 +162,7 @@ class UrlClassifierLookupCallbackProxy MOZ_FINAL : public nsIUrlClassifierLookupCallback { public: - UrlClassifierLookupCallbackProxy(nsIUrlClassifierLookupCallback* aTarget) + explicit UrlClassifierLookupCallbackProxy(nsIUrlClassifierLookupCallback* aTarget) : mTarget(new nsMainThreadPtrHolder(aTarget)) { } @@ -194,7 +194,7 @@ private: class UrlClassifierCallbackProxy MOZ_FINAL : public nsIUrlClassifierCallback { public: - UrlClassifierCallbackProxy(nsIUrlClassifierCallback* aTarget) + explicit UrlClassifierCallbackProxy(nsIUrlClassifierCallback* aTarget) : mTarget(new nsMainThreadPtrHolder(aTarget)) { } @@ -227,7 +227,7 @@ class UrlClassifierUpdateObserverProxy MOZ_FINAL : public nsIUrlClassifierUpdateObserver { public: - UrlClassifierUpdateObserverProxy(nsIUrlClassifierUpdateObserver* aTarget) + explicit UrlClassifierUpdateObserverProxy(nsIUrlClassifierUpdateObserver* aTarget) : mTarget(new nsMainThreadPtrHolder(aTarget)) { } diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index b15161100479..cabad55ce2d4 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -295,7 +295,7 @@ static const int kMagicChildCrashReportFd = 4; static Mutex* dumpMapLock; struct ChildProcessData : public nsUint32HashKey { - ChildProcessData(KeyTypePointer aKey) + explicit ChildProcessData(KeyTypePointer aKey) : nsUint32HashKey(aKey) , sequence(0) #ifdef MOZ_CRASHREPORTER_INJECTOR @@ -323,7 +323,7 @@ static nsIThread* sInjectorThread; class ReportInjectedCrash : public nsRunnable { public: - ReportInjectedCrash(uint32_t pid) : mPID(pid) { } + explicit ReportInjectedCrash(uint32_t pid) : mPID(pid) { } NS_IMETHOD Run(); @@ -1710,7 +1710,7 @@ class DelayedNote DelayedNote(const nsACString& aKey, const nsACString& aData) : mKey(aKey), mData(aData), mType(Annotation) {} - DelayedNote(const nsACString& aData) + explicit DelayedNote(const nsACString& aData) : mData(aData), mType(AppNote) {} void Run() diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp index e1a174d1c32d..05b3ed42ee5d 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -154,7 +154,7 @@ private: NS_DECL_ISUPPORTS NS_DECL_NSISIMPLEENUMERATOR - ProfileEnumerator(nsToolkitProfile *first) + explicit ProfileEnumerator(nsToolkitProfile *first) { mCurrent = first; } private: ~ProfileEnumerator() { } diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 91149535617f..b98e27b634bb 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -1330,7 +1330,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIFACTORY - nsSingletonFactory(nsISupports* aSingleton); + explicit nsSingletonFactory(nsISupports* aSingleton); private: ~nsSingletonFactory() { } diff --git a/xpcom/tests/TestDeadlockDetector.cpp b/xpcom/tests/TestDeadlockDetector.cpp index a55caff4605e..0fbdd395216e 100644 --- a/xpcom/tests/TestDeadlockDetector.cpp +++ b/xpcom/tests/TestDeadlockDetector.cpp @@ -58,7 +58,7 @@ public: nsCString mStdout; nsCString mStderr; - Subprocess(const char* aTestName) { + explicit Subprocess(const char* aTestName) { // set up stdio redirection PRFileDesc* readStdin; PRFileDesc* writeStdin; PRFileDesc* readStdout; PRFileDesc* writeStdout; diff --git a/xpfe/appshell/nsContentTreeOwner.cpp b/xpfe/appshell/nsContentTreeOwner.cpp index 98f79c395bfc..2bf7c984e871 100644 --- a/xpfe/appshell/nsContentTreeOwner.cpp +++ b/xpfe/appshell/nsContentTreeOwner.cpp @@ -58,7 +58,7 @@ using namespace mozilla; class nsSiteWindow : public nsIEmbeddingSiteWindow { public: - nsSiteWindow(nsContentTreeOwner *aAggregator); + explicit nsSiteWindow(nsContentTreeOwner *aAggregator); virtual ~nsSiteWindow(); NS_DECL_ISUPPORTS diff --git a/xpfe/appshell/nsContentTreeOwner.h b/xpfe/appshell/nsContentTreeOwner.h index 0fb674237752..cb4d4514aa6b 100644 --- a/xpfe/appshell/nsContentTreeOwner.h +++ b/xpfe/appshell/nsContentTreeOwner.h @@ -43,7 +43,7 @@ public: NS_DECL_NSIWINDOWPROVIDER protected: - nsContentTreeOwner(bool fPrimary); + explicit nsContentTreeOwner(bool fPrimary); virtual ~nsContentTreeOwner(); void XULWindow(nsXULWindow* aXULWindow); diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow.cpp index a441f2a8964f..297bfcc41e0f 100644 --- a/xpfe/appshell/nsWebShellWindow.cpp +++ b/xpfe/appshell/nsWebShellWindow.cpp @@ -444,7 +444,7 @@ namespace mozilla { class WebShellWindowTimerCallback MOZ_FINAL : public nsITimerCallback { public: - WebShellWindowTimerCallback(nsWebShellWindow* aWindow) + explicit WebShellWindowTimerCallback(nsWebShellWindow* aWindow) : mWindow(aWindow) {} diff --git a/xpfe/appshell/nsWebShellWindow.h b/xpfe/appshell/nsWebShellWindow.h index 8d56876a352a..cd703704ba7d 100644 --- a/xpfe/appshell/nsWebShellWindow.h +++ b/xpfe/appshell/nsWebShellWindow.h @@ -28,7 +28,7 @@ class nsWebShellWindow MOZ_FINAL : public nsXULWindow, public nsIWidgetListener { public: - nsWebShellWindow(uint32_t aChromeFlags); + explicit nsWebShellWindow(uint32_t aChromeFlags); // nsISupports interface... NS_DECL_ISUPPORTS_INHERITED diff --git a/xpfe/appshell/nsXULWindow.h b/xpfe/appshell/nsXULWindow.h index acd17f0245f2..c08530d92781 100644 --- a/xpfe/appshell/nsXULWindow.h +++ b/xpfe/appshell/nsXULWindow.h @@ -80,7 +80,7 @@ protected: PAD_SIZE = 0x4 }; - nsXULWindow(uint32_t aChromeFlags); + explicit nsXULWindow(uint32_t aChromeFlags); virtual ~nsXULWindow(); NS_IMETHOD EnsureChromeTreeOwner(); diff --git a/xpfe/components/directory/nsDirectoryViewer.h b/xpfe/components/directory/nsDirectoryViewer.h index 957da4b32c09..0bbb37357df2 100644 --- a/xpfe/components/directory/nsDirectoryViewer.h +++ b/xpfe/components/directory/nsDirectoryViewer.h @@ -79,7 +79,7 @@ protected: nsIInterfaceRequestor* mRequestor; // WEAK nsCOMPtr mDirectory; - nsHTTPIndex(nsIInterfaceRequestor* aRequestor); + explicit nsHTTPIndex(nsIInterfaceRequestor* aRequestor); nsresult CommonInit(void); nsresult Init(nsIURI* aBaseURL); void GetDestination(nsIRDFResource* r, nsXPIDLCString& dest);