Bug 1048280 - Fix more bad implicit constructors in XPCOM; r=froydnj

This commit is contained in:
Ehsan Akhgari 2014-08-05 09:36:59 -04:00
parent d865feac08
commit a635ff39b2
14 changed files with 19 additions and 19 deletions

View File

@ -79,7 +79,7 @@ public:
class PerThreadData
{
public:
PerThreadData(bool aIsMainThread = false)
explicit PerThreadData(bool aIsMainThread = false)
: mIsMainThread(aIsMainThread)
, mIsHandlingObservation(false)
, mCurrentGeneration(0)

View File

@ -71,7 +71,7 @@ private:
class MonitorAutoLock
{
public:
MonitorAutoLock(Monitor &aMonitor)
explicit MonitorAutoLock(Monitor &aMonitor)
: mMonitor(aMonitor)
{
mMonitor.Lock();
@ -99,7 +99,7 @@ private:
class MonitorAutoUnlock
{
public:
MonitorAutoUnlock(Monitor &aMonitor)
explicit MonitorAutoUnlock(Monitor &aMonitor)
: mMonitor(aMonitor)
{
mMonitor.Unlock();
@ -145,7 +145,7 @@ private:
class AutoLock
{
public:
AutoLock(Mutex& aLock)
explicit AutoLock(Mutex& aLock)
: mLock(aLock)
{
mLock.Lock();

View File

@ -94,7 +94,7 @@ static void RecordStackWalker(void *aPC, void *aSP, void *aClosure)
class LateWriteObserver MOZ_FINAL : public IOInterposeObserver
{
public:
LateWriteObserver(const char* aProfileDirectory)
explicit LateWriteObserver(const char* aProfileDirectory)
: mProfileDirectory(PL_strdup(aProfileDirectory))
{
}

View File

@ -27,7 +27,7 @@ PRFileInfo64FN sFileInfo64Fn = nullptr;
class NSPRIOAutoObservation : public IOInterposeObserver::Observation
{
public:
NSPRIOAutoObservation(IOInterposeObserver::Operation aOp)
explicit NSPRIOAutoObservation(IOInterposeObserver::Operation aOp)
: IOInterposeObserver::Observation(aOp, "NSPRIOInterposer")
{
}

View File

@ -109,7 +109,7 @@ public:
NS_DECL_NSISEARCHABLEINPUTSTREAM
NS_DECL_NSICLASSINFO
nsPipeInputStream(nsPipe* aPipe)
explicit nsPipeInputStream(nsPipe* aPipe)
: mPipe(aPipe)
, mReaderRefCnt(0)
, mLogicalOffset(0)
@ -176,7 +176,7 @@ public:
NS_DECL_NSIASYNCOUTPUTSTREAM
NS_DECL_NSICLASSINFO
nsPipeOutputStream(nsPipe* aPipe)
explicit nsPipeOutputStream(nsPipe* aPipe)
: mPipe(aPipe)
, mWriterRefCnt(0)
, mLogicalOffset(0)

View File

@ -26,7 +26,7 @@
class StringUnicharInputStream MOZ_FINAL : public nsIUnicharInputStream
{
public:
StringUnicharInputStream(const nsAString& aString) :
explicit StringUnicharInputStream(const nsAString& aString) :
mString(aString), mPos(0), mLen(aString.Length()) { }
NS_DECL_ISUPPORTS

View File

@ -29,7 +29,7 @@ class Foo MOZ_FINAL : public IFoo {
public:
Foo(int32_t aID);
explicit Foo(int32_t aID);
// nsISupports implementation
NS_DECL_ISUPPORTS

View File

@ -100,8 +100,8 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2
public:
NS_DECL_ISUPPORTS
ScopedXPCOM(const char* testName,
nsIDirectoryServiceProvider *dirSvcProvider = nullptr)
explicit ScopedXPCOM(const char* testName,
nsIDirectoryServiceProvider *dirSvcProvider = nullptr)
: mDirSvcProvider(dirSvcProvider)
{
mTestName = testName;

View File

@ -21,7 +21,7 @@ namespace TestHashtables {
class TestUniChar // for nsClassHashtable
{
public:
TestUniChar(uint32_t aWord)
explicit TestUniChar(uint32_t aWord)
{
printf(" TestUniChar::TestUniChar() %u\n", aWord);
mWord = aWord;
@ -70,7 +70,7 @@ public:
typedef const char* KeyType;
typedef const char* KeyTypePointer;
EntityToUnicodeEntry(const char* aKey) { mNode = nullptr; }
explicit EntityToUnicodeEntry(const char* aKey) { mNode = nullptr; }
EntityToUnicodeEntry(const EntityToUnicodeEntry& aEntry) { mNode = aEntry.mNode; }
~EntityToUnicodeEntry() { }

View File

@ -34,7 +34,7 @@ class TestObserver MOZ_FINAL : public nsIObserver,
public nsSupportsWeakReference
{
public:
TestObserver( const nsAString &name )
explicit TestObserver( const nsAString &name )
: mName( name ) {
}
NS_DECL_ISUPPORTS

View File

@ -67,7 +67,7 @@ bool gMainThreadWaiting = false;
class AutoCreateAndDestroyReentrantMonitor
{
public:
AutoCreateAndDestroyReentrantMonitor(ReentrantMonitor** aReentrantMonitorPtr)
explicit AutoCreateAndDestroyReentrantMonitor(ReentrantMonitor** aReentrantMonitorPtr)
: mReentrantMonitorPtr(aReentrantMonitorPtr) {
*aReentrantMonitorPtr =
new ReentrantMonitor("TestRacingServiceManager::AutoMon");

View File

@ -115,7 +115,7 @@ Listener::OnThreadShuttingDown()
class AutoCreateAndDestroyReentrantMonitor
{
public:
AutoCreateAndDestroyReentrantMonitor(ReentrantMonitor** aReentrantMonitorPtr)
explicit AutoCreateAndDestroyReentrantMonitor(ReentrantMonitor** aReentrantMonitorPtr)
: mReentrantMonitorPtr(aReentrantMonitorPtr) {
*aReentrantMonitorPtr = new ReentrantMonitor("TestThreadPoolListener::AutoMon");
TEST_ASSERTION(*aReentrantMonitorPtr, "Out of memory!");

View File

@ -51,7 +51,7 @@ namespace {
class TimerObserverRunnable : public nsRunnable
{
public:
TimerObserverRunnable(nsIObserver* aObserver)
explicit TimerObserverRunnable(nsIObserver* aObserver)
: mObserver(aObserver)
{
}

View File

@ -243,7 +243,7 @@ struct nsThreadShutdownContext
class nsThreadShutdownAckEvent : public nsRunnable
{
public:
nsThreadShutdownAckEvent(nsThreadShutdownContext* aCtx)
explicit nsThreadShutdownAckEvent(nsThreadShutdownContext* aCtx)
: mShutdownContext(aCtx)
{
}