Bug 1061061 - Fix more bad implicit constructors in misc. code; r=bsmedberg
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Sep 2014 18:24:24 -0400
changeset 203288 adfa67ea01c6808d7761e80313283a55923fe390
parent 203287 df899ce52dea6d608362efd29e1c19ef0bc4a3a7
child 203289 bd5d9e067035b947b9c86b7a3af75b6d30bf1178
push id27425
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 20:38:59 +0000
treeherdermozilla-central@acbdce59da2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1061061
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1061061 - Fix more bad implicit constructors in misc. code; r=bsmedberg
extensions/auth/nsAuthGSSAPI.h
modules/libjar/nsJAR.h
modules/libjar/zipwriter/nsDeflateConverter.h
modules/libpref/Preferences.cpp
modules/libpref/nsPrefBranch.h
profile/dirserviceprovider/nsProfileDirServiceProvider.h
security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.cpp
toolkit/components/downloads/ApplicationReputation.cpp
toolkit/components/osfile/NativeOSFileInternals.cpp
toolkit/components/startup/nsAppStartup.cpp
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/url-classifier/HashStore.h
toolkit/components/url-classifier/nsUrlClassifierProxies.h
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/profile/nsToolkitProfileService.cpp
toolkit/xre/nsAppRunner.cpp
xpcom/tests/TestDeadlockDetector.cpp
xpfe/appshell/nsContentTreeOwner.cpp
xpfe/appshell/nsContentTreeOwner.h
xpfe/appshell/nsWebShellWindow.cpp
xpfe/appshell/nsWebShellWindow.h
xpfe/appshell/nsXULWindow.h
xpfe/components/directory/nsDirectoryViewer.h
--- a/extensions/auth/nsAuthGSSAPI.h
+++ b/extensions/auth/nsAuthGSSAPI.h
@@ -36,17 +36,17 @@
  */
 
 class nsAuthGSSAPI MOZ_FINAL : public nsIAuthModule
 {
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIAUTHMODULE
 
-    nsAuthGSSAPI(pType package);
+    explicit nsAuthGSSAPI(pType package);
 
     static void Shutdown();
 
 private:
     ~nsAuthGSSAPI() { Reset(); }
 
     void    Reset();
     gss_OID GetOID() { return mMechOID; }
--- a/modules/libjar/nsJAR.h
+++ b/modules/libjar/nsJAR.h
@@ -135,17 +135,17 @@ class nsJAR MOZ_FINAL : public nsIZipRea
  * supplied pattern are returned in a nsJAREnumerator.
  */
 class nsJARItem : public nsIZipEntry
 {
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIZIPENTRY
 
-    nsJARItem(nsZipItem* aZipItem);
+    explicit nsJARItem(nsZipItem* aZipItem);
 
 private:
     virtual ~nsJARItem() {}
 
     uint32_t     mSize;             /* size in original file */
     uint32_t     mRealsize;         /* inflated size */
     uint32_t     mCrc32;
     PRTime       mLastModTime;
@@ -162,17 +162,17 @@ private:
  * (based on a pattern match in its member nsZipFind).
  */
 class nsJAREnumerator MOZ_FINAL : public nsIUTF8StringEnumerator
 {
 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.");
     }
 
 private:
     nsZipFind    *mFind;
     const char*   mName;    // pointer to an name owned by mArchive -- DON'T delete
     uint16_t      mNameLen;
 
--- a/modules/libjar/zipwriter/nsDeflateConverter.h
+++ b/modules/libjar/zipwriter/nsDeflateConverter.h
@@ -26,17 +26,17 @@ public:
     NS_DECL_NSISTREAMCONVERTER
 
     nsDeflateConverter()
     {
         // 6 is Z_DEFAULT_COMPRESSION but we need the actual value
         mLevel = 6;
     }
 
-    nsDeflateConverter(int32_t level)
+    explicit nsDeflateConverter(int32_t level)
     {
         mLevel = level;
     }
 
 private:
 
     ~nsDeflateConverter()
     {
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -100,17 +100,17 @@ public:
   {
     PLDHashNumber hash = HashString(aKey->mPrefName);
     return AddToHash(hash, aKey->mCallback);
   }
 
   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)
   { }
 
   bool KeyEquals(const ValueObserverHashKey *aOther) const
   {
     return mCallback == aOther->mCallback && mPrefName == aOther->mPrefName;
   }
 
--- a/modules/libpref/nsPrefBranch.h
+++ b/modules/libpref/nsPrefBranch.h
@@ -73,17 +73,17 @@ class PrefCallback : public PLDHashEntry
         mStrongRef(nullptr)
     {
       MOZ_COUNT_CTOR(PrefCallback);
       nsCOMPtr<nsISupports> canonical = do_QueryInterface(aObserver);
       mCanonical = canonical;
     }
 
     // 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),
         mStrongRef(aCopy->mStrongRef),
         mCanonical(aCopy->mCanonical)
     {
       MOZ_COUNT_CTOR(PrefCallback);
     }
--- a/profile/dirserviceprovider/nsProfileDirServiceProvider.h
+++ b/profile/dirserviceprovider/nsProfileDirServiceProvider.h
@@ -66,17 +66,17 @@ public:
    * This method must be called before shutting down XPCOM if this object
    * was created with aNotifyObservers == true. If this object was
    * created with aNotifyObservers == false, this method is a no-op.
    */
 
   virtual nsresult         Shutdown();
 
 protected:
-                           nsProfileDirServiceProvider(bool aNotifyObservers = true);
+                           explicit nsProfileDirServiceProvider(bool aNotifyObservers = true);
    virtual                 ~nsProfileDirServiceProvider();
 
   nsresult                 Initialize();
   nsresult                 InitProfileDir(nsIFile* profileDir);
   nsresult                 InitNonSharedProfileDir();
   nsresult                 EnsureProfileFileExists(nsIFile *aFile, nsIFile *destDir);
   nsresult                 UndefineFileLocations();
 
--- a/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.cpp
+++ b/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.cpp
@@ -24,17 +24,17 @@ uint16_t gCallbackPort = 0;
 
 const char DEFAULT_CERT_NICKNAME[] = "localhostAndExampleCom";
 
 struct Connection
 {
   PRFileDesc *mSocket;
   char mByte;
 
-  Connection(PRFileDesc *aSocket);
+  explicit Connection(PRFileDesc *aSocket);
   ~Connection();
 };
 
 Connection::Connection(PRFileDesc *aSocket)
 : mSocket(aSocket)
 , mByte(0)
 {}
 
--- a/toolkit/components/downloads/ApplicationReputation.cpp
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -207,17 +207,17 @@ private:
 // class is private to PendingLookup.
 class PendingDBLookup MOZ_FINAL : public nsIUrlClassifierCallback
 {
 public:
   NS_DECL_ISUPPORTS
   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
   // PendingLookup::OnComplete. Otherwise, call PendingLookup::LookupNext.
   nsresult LookupSpec(const nsACString& aSpec, bool aAllowlistOnly);
 
 private:
   ~PendingDBLookup();
--- a/toolkit/components/osfile/NativeOSFileInternals.cpp
+++ b/toolkit/components/osfile/NativeOSFileInternals.cpp
@@ -87,20 +87,20 @@ struct ScopedArrayBufferContentsTraits {
   const static void release(type ptr) {
     js_free(ptr.data);
     ptr.data = nullptr;
     ptr.nbytes = 0;
   }
 };
 
 struct ScopedArrayBufferContents: public Scoped<ScopedArrayBufferContentsTraits> {
-  ScopedArrayBufferContents(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM):
+  explicit ScopedArrayBufferContents(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM):
     Scoped<ScopedArrayBufferContentsTraits>(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)
   { }
-  ScopedArrayBufferContents(const ArrayBufferContents& v
+  explicit ScopedArrayBufferContents(const ArrayBufferContents& v
                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM):
     Scoped<ScopedArrayBufferContentsTraits>(v MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
   { }
   ScopedArrayBufferContents& operator=(ArrayBufferContents ptr) {
     Scoped<ScopedArrayBufferContentsTraits>::operator=(ptr);
     return *this;
   }
 
@@ -166,17 +166,17 @@ public:
 
   /**
    * Construct the result object. Must be called on the main thread
    * as the AbstractResult is cycle-collected.
    *
    * @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());
     mozilla::HoldJSObjects(this);
   }
 
   /**
    * Setup the AbstractResult once data is available.
@@ -272,17 +272,17 @@ AbstractResult::GetResult(JSContext *cx,
  * Return a result as a string.
  *
  * In this implementation, attribute |result| is a string. Strings are
  * passed to JS without copy.
  */
 class StringResult MOZ_FINAL : public AbstractResult
 {
 public:
-  StringResult(TimeStamp aStartDate)
+  explicit StringResult(TimeStamp aStartDate)
     : AbstractResult(aStartDate)
   {
   }
 
   /**
    * Initialize the object once the contents of the result as available.
    *
    * @param aContents The string to pass to JavaScript. Ownership of the
@@ -323,17 +323,17 @@ StringResult::GetCacheableResult(JSConte
  * Return a result as a Uint8Array.
  *
  * In this implementation, attribute |result| is a Uint8Array. The array
  * is passed to JS without memory copy.
  */
 class TypedArrayResult MOZ_FINAL : public AbstractResult
 {
 public:
-  TypedArrayResult(TimeStamp aStartDate)
+  explicit TypedArrayResult(TimeStamp aStartDate)
     : AbstractResult(aStartDate)
   {
   }
 
   /**
    * @param aContents The contents to pass to JS. Calling this method.
    * transmits ownership of the ArrayBufferContents to the TypedArrayResult.
    * Do not reuse this value anywhere else.
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -96,17 +96,17 @@ using namespace mozilla;
 
 uint32_t gRestartMode = 0;
 
 class nsAppExitEvent : public nsRunnable {
 private:
   nsRefPtr<nsAppStartup> mService;
 
 public:
-  nsAppExitEvent(nsAppStartup *service) : mService(service) {}
+  explicit nsAppExitEvent(nsAppStartup *service) : mService(service) {}
 
   NS_IMETHOD Run() {
     // Tell the appshell to exit
     mService->mAppShell->Exit();
 
     mService->mRunning = false;
     return NS_OK;
   }
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -72,17 +72,17 @@ namespace {
 
 using namespace base;
 using namespace mozilla;
 
 template<class EntryType>
 class AutoHashtable : public nsTHashtable<EntryType>
 {
 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<JSObject*> obj);
   bool ReflectIntoJS(ReflectEntryFunc entryFunc, JSContext *cx, JS::Handle<JSObject*> obj);
 private:
   struct EnumeratorArgs {
     JSContext *cx;
     JS::Handle<JSObject*> obj;
     ReflectEntryFunc entryFunc;
   };
@@ -301,17 +301,17 @@ class TelemetryIOInterposeObserver : pub
       return mPath.SizeOfExcludingThisIfUnshared(aMallocSizeOf) +
              mSubstName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
     }
     nsString  mPath;        /** Path to the directory */
     nsString  mSubstName;   /** Name to substitute with */
   };
 
 public:
-  TelemetryIOInterposeObserver(nsIFile* aXreDir);
+  explicit TelemetryIOInterposeObserver(nsIFile* aXreDir);
 
   /**
    * An implementation of Observe that records statistics of all
    * file IO operations.
    */
   void Observe(Observation& aOb);
 
   /**
--- a/toolkit/components/url-classifier/HashStore.h
+++ b/toolkit/components/url-classifier/HashStore.h
@@ -17,17 +17,17 @@
 namespace mozilla {
 namespace safebrowsing {
 
 // A table update is built from a single update chunk from the server. As the
 // protocol parser processes each chunk, it constructs a table update with the
 // new hashes.
 class TableUpdate {
 public:
-  TableUpdate(const nsACString& aTable)
+  explicit TableUpdate(const nsACString& aTable)
       : mTable(aTable), mLocalUpdate(false) {}
   const nsCString& TableName() const { return mTable; }
 
   bool Empty() const {
     return mAddChunks.Length() == 0 &&
       mSubChunks.Length() == 0 &&
       mAddExpirations.Length() == 0 &&
       mSubExpirations.Length() == 0 &&
--- a/toolkit/components/url-classifier/nsUrlClassifierProxies.h
+++ b/toolkit/components/url-classifier/nsUrlClassifierProxies.h
@@ -16,17 +16,17 @@
 
 /**
  * Thread proxy from the main thread to the worker thread.
  */
 class UrlClassifierDBServiceWorkerProxy MOZ_FINAL :
   public nsIUrlClassifierDBServiceWorker
 {
 public:
-  UrlClassifierDBServiceWorkerProxy(nsIUrlClassifierDBServiceWorker* aTarget)
+  explicit UrlClassifierDBServiceWorkerProxy(nsIUrlClassifierDBServiceWorker* aTarget)
     : mTarget(aTarget)
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURLCLASSIFIERDBSERVICE
   NS_DECL_NSIURLCLASSIFIERDBSERVICEWORKER
 
   class LookupRunnable : public nsRunnable
@@ -157,17 +157,17 @@ private:
 };
 
 // The remaining classes here are all proxies to the main thread
 
 class UrlClassifierLookupCallbackProxy MOZ_FINAL :
   public nsIUrlClassifierLookupCallback
 {
 public:
-  UrlClassifierLookupCallbackProxy(nsIUrlClassifierLookupCallback* aTarget)
+  explicit UrlClassifierLookupCallbackProxy(nsIUrlClassifierLookupCallback* aTarget)
     : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierLookupCallback>(aTarget))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURLCLASSIFIERLOOKUPCALLBACK
 
   class LookupCompleteRunnable : public nsRunnable
   {
@@ -189,17 +189,17 @@ private:
   ~UrlClassifierLookupCallbackProxy() {}
 
   nsMainThreadPtrHandle<nsIUrlClassifierLookupCallback> mTarget;
 };
 
 class UrlClassifierCallbackProxy MOZ_FINAL : public nsIUrlClassifierCallback
 {
 public:
-  UrlClassifierCallbackProxy(nsIUrlClassifierCallback* aTarget)
+  explicit UrlClassifierCallbackProxy(nsIUrlClassifierCallback* aTarget)
     : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierCallback>(aTarget))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURLCLASSIFIERCALLBACK
 
   class HandleEventRunnable : public nsRunnable
   {
@@ -222,17 +222,17 @@ private:
 
   nsMainThreadPtrHandle<nsIUrlClassifierCallback> mTarget;
 };
 
 class UrlClassifierUpdateObserverProxy MOZ_FINAL :
   public nsIUrlClassifierUpdateObserver
 {
 public:
-  UrlClassifierUpdateObserverProxy(nsIUrlClassifierUpdateObserver* aTarget)
+  explicit UrlClassifierUpdateObserverProxy(nsIUrlClassifierUpdateObserver* aTarget)
     : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierUpdateObserver>(aTarget))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURLCLASSIFIERUPDATEOBSERVER
 
   class UpdateUrlRequestedRunnable : public nsRunnable
   {
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -290,17 +290,17 @@ static int clientSocketFd = -1;
 static const int kMagicChildCrashReportFd = 4;
 
 #  endif
 
 // |dumpMapLock| must protect all access to |pidToMinidump|.
 static Mutex* dumpMapLock;
 struct ChildProcessData : public nsUint32HashKey
 {
-  ChildProcessData(KeyTypePointer aKey)
+  explicit ChildProcessData(KeyTypePointer aKey)
     : nsUint32HashKey(aKey)
     , sequence(0)
 #ifdef MOZ_CRASHREPORTER_INJECTOR
     , callback(nullptr)
 #endif
   { }
 
   nsCOMPtr<nsIFile> minidump;
@@ -318,17 +318,17 @@ static uint32_t crashSequence;
 static bool OOPInitialized();
 
 #ifdef MOZ_CRASHREPORTER_INJECTOR
 static nsIThread* sInjectorThread;
 
 class ReportInjectedCrash : public nsRunnable
 {
 public:
-  ReportInjectedCrash(uint32_t pid) : mPID(pid) { }
+  explicit ReportInjectedCrash(uint32_t pid) : mPID(pid) { }
 
   NS_IMETHOD Run();
 
 private:
   uint32_t mPID;
 };
 #endif // MOZ_CRASHREPORTER_INJECTOR
 
@@ -1705,17 +1705,17 @@ EscapeAnnotation(const nsACString& key, 
 #endif
 
 class DelayedNote
 {
  public:
   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()
   {
     if (mType == Annotation) {
       AnnotateCrashReport(mKey, mData);
     } else {
       AppendAppNotesToCrashReport(mData);
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -149,17 +149,17 @@ private:
     static nsToolkitProfileService *gService;
 
     class ProfileEnumerator MOZ_FINAL : public nsISimpleEnumerator
     {
     public:
         NS_DECL_ISUPPORTS
         NS_DECL_NSISIMPLEENUMERATOR
 
-        ProfileEnumerator(nsToolkitProfile *first)
+        explicit ProfileEnumerator(nsToolkitProfile *first)
           { mCurrent = first; }
     private:
         ~ProfileEnumerator() { }
         nsRefPtr<nsToolkitProfile> mCurrent;
     };
 };
 
 nsToolkitProfile::nsToolkitProfile(const nsACString& aName,
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1325,17 +1325,17 @@ ScopedXPCOMStartup::Initialize()
  * for the nativeappsupport object.
  */
 class nsSingletonFactory MOZ_FINAL : public nsIFactory
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIFACTORY
 
-  nsSingletonFactory(nsISupports* aSingleton);
+  explicit nsSingletonFactory(nsISupports* aSingleton);
 
 private:
   ~nsSingletonFactory() { }
   nsCOMPtr<nsISupports> mSingleton;
 };
 
 nsSingletonFactory::nsSingletonFactory(nsISupports* aSingleton)
   : mSingleton(aSingleton)
--- a/xpcom/tests/TestDeadlockDetector.cpp
+++ b/xpcom/tests/TestDeadlockDetector.cpp
@@ -53,17 +53,17 @@ static const char* sAssertBehaviorEnv = 
 class Subprocess
 {
 public:
     // not available until process finishes
     int32_t mExitCode;
     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;
         PRFileDesc* readStderr; PRFileDesc* writeStderr;
         PRProcessAttr* pattr = PR_NewProcessAttr();
 
         NS_ASSERTION(pattr, "couldn't allocate process attrs");
 
--- a/xpfe/appshell/nsContentTreeOwner.cpp
+++ b/xpfe/appshell/nsContentTreeOwner.cpp
@@ -53,17 +53,17 @@ using namespace mozilla;
 
 //*****************************************************************************
 //*** nsSiteWindow declaration
 //*****************************************************************************
 
 class nsSiteWindow : public nsIEmbeddingSiteWindow
 {
 public:
-  nsSiteWindow(nsContentTreeOwner *aAggregator);
+  explicit nsSiteWindow(nsContentTreeOwner *aAggregator);
   virtual ~nsSiteWindow();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIEMBEDDINGSITEWINDOW
 
 private:
   nsContentTreeOwner *mAggregator;
 };
--- a/xpfe/appshell/nsContentTreeOwner.h
+++ b/xpfe/appshell/nsContentTreeOwner.h
@@ -38,17 +38,17 @@ public:
    NS_DECL_NSIDOCSHELLTREEOWNER
    NS_DECL_NSIINTERFACEREQUESTOR
    NS_DECL_NSIWEBBROWSERCHROME
    NS_DECL_NSIWEBBROWSERCHROME2
    NS_DECL_NSIWEBBROWSERCHROME3
    NS_DECL_NSIWINDOWPROVIDER
 
 protected:
-   nsContentTreeOwner(bool fPrimary);
+   explicit nsContentTreeOwner(bool fPrimary);
    virtual ~nsContentTreeOwner();
 
    void XULWindow(nsXULWindow* aXULWindow);
    nsXULWindow* XULWindow();
 
 protected:
    nsXULWindow      *mXULWindow;
    nsSiteWindow    *mSiteWindow;
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -439,17 +439,17 @@ static void LoadNativeMenus(nsIDOMDocume
 }
 #endif
 
 namespace mozilla {
 
 class WebShellWindowTimerCallback MOZ_FINAL : public nsITimerCallback
 {
 public:
-  WebShellWindowTimerCallback(nsWebShellWindow* aWindow)
+  explicit WebShellWindowTimerCallback(nsWebShellWindow* aWindow)
     : mWindow(aWindow)
   {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   NS_IMETHOD Notify(nsITimer* aTimer)
   {
     // Although this object participates in a refcount cycle (this -> mWindow
--- a/xpfe/appshell/nsWebShellWindow.h
+++ b/xpfe/appshell/nsWebShellWindow.h
@@ -23,17 +23,17 @@ namespace mozilla {
 class WebShellWindowTimerCallback;
 } // namespace mozilla
 
 class nsWebShellWindow MOZ_FINAL : public nsXULWindow,
                                    public nsIWebProgressListener,
                                    public nsIWidgetListener
 {
 public:
-  nsWebShellWindow(uint32_t aChromeFlags);
+  explicit nsWebShellWindow(uint32_t aChromeFlags);
 
   // nsISupports interface...
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsWebShellWindow methods...
   nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
                       nsIURI* aUrl,
                       int32_t aInitialWidth, int32_t aInitialHeight,
--- a/xpfe/appshell/nsXULWindow.h
+++ b/xpfe/appshell/nsXULWindow.h
@@ -75,17 +75,17 @@ public:
 
 protected:
    enum persistentAttributes {
      PAD_MISC =         0x1,
      PAD_POSITION =     0x2,
      PAD_SIZE =         0x4
    };
 
-   nsXULWindow(uint32_t aChromeFlags);
+   explicit nsXULWindow(uint32_t aChromeFlags);
    virtual ~nsXULWindow();
 
    NS_IMETHOD EnsureChromeTreeOwner();
    NS_IMETHOD EnsureContentTreeOwner();
    NS_IMETHOD EnsurePrimaryContentTreeOwner();
    NS_IMETHOD EnsurePrompter();
    NS_IMETHOD EnsureAuthPrompter();
 
--- a/xpfe/components/directory/nsDirectoryViewer.h
+++ b/xpfe/components/directory/nsDirectoryViewer.h
@@ -74,17 +74,17 @@ protected:
     nsCOMPtr<nsITimer>           mTimer;
     nsCOMPtr<nsIDirIndexParser>  mParser;
     nsCString mBaseURL;
     nsCString                    mEncoding;
     bool                         mBindToGlobalObject;
     nsIInterfaceRequestor*       mRequestor; // WEAK
     nsCOMPtr<nsIRDFResource>     mDirectory;
 
-    nsHTTPIndex(nsIInterfaceRequestor* aRequestor);
+    explicit nsHTTPIndex(nsIInterfaceRequestor* aRequestor);
     nsresult CommonInit(void);
     nsresult Init(nsIURI* aBaseURL);
     void        GetDestination(nsIRDFResource* r, nsXPIDLCString& dest);
     bool        isWellknownContainerURI(nsIRDFResource *r);
     nsresult    AddElement(nsIRDFResource *parent, nsIRDFResource *prop,
                            nsIRDFNode *child);
 
     static void FireTimer(nsITimer* aTimer, void* aClosure);