Bug 1061254 - Fix more bad implicit constructors in misc. components; r=bsmedberg
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Sep 2014 18:24:49 -0400
changeset 203289 bd5d9e067035b947b9c86b7a3af75b6d30bf1178
parent 203288 adfa67ea01c6808d7761e80313283a55923fe390
child 203290 a5d98477ddc917c9f0a85c6eab2f9ae8bb649220
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
bugs1061254
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 1061254 - Fix more bad implicit constructors in misc. components; r=bsmedberg
embedding/components/printingui/unixshared/nsPrintProgress.h
extensions/gio/nsGIOProtocolHandler.cpp
ipc/glue/SharedMemorySysV.h
netwerk/wifi/nsWifiScannerDBus.h
storage/test/test_deadlock_detector.cpp
toolkit/system/gnome/nsGIOService.cpp
toolkit/system/gnome/nsGSettingsService.cpp
uriloader/exthandler/unix/nsMIMEInfoUnix.h
xpcom/base/SystemMemoryReporter.cpp
--- a/embedding/components/printingui/unixshared/nsPrintProgress.h
+++ b/embedding/components/printingui/unixshared/nsPrintProgress.h
@@ -19,17 +19,17 @@
 class nsPrintProgress : public nsIPrintProgress, public nsIPrintStatusFeedback
 {
 public: 
 	NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIPRINTPROGRESS
   NS_DECL_NSIWEBPROGRESSLISTENER
   NS_DECL_NSIPRINTSTATUSFEEDBACK
 
-	nsPrintProgress(nsIPrintSettings* aPrintSettings);
+  explicit nsPrintProgress(nsIPrintSettings* aPrintSettings);
 
 protected:
 	virtual ~nsPrintProgress();
 
 private:
   nsresult ReleaseListeners();
 
   bool                              m_closeProgress;
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -138,17 +138,17 @@ static void mount_operation_ask_password
 class nsGIOInputStream MOZ_FINAL : public nsIInputStream
 {
    ~nsGIOInputStream() { Close(); }
 
   public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIINPUTSTREAM
 
-    nsGIOInputStream(const nsCString &uriSpec)
+    explicit nsGIOInputStream(const nsCString &uriSpec)
       : mSpec(uriSpec)
       , mChannel(nullptr)
       , mHandle(nullptr)
       , mStream(nullptr)
       , mBytesRemaining(UINT64_MAX)
       , mStatus(NS_OK)
       , mDirList(nullptr)
       , mDirListPtr(nullptr)
--- a/ipc/glue/SharedMemorySysV.h
+++ b/ipc/glue/SharedMemorySysV.h
@@ -41,17 +41,17 @@ public:
   typedef int Handle;
 
   SharedMemorySysV() :
     mHandle(-1),
     mData(nullptr)
   {
   }
 
-  SharedMemorySysV(Handle aHandle) :
+  explicit SharedMemorySysV(Handle aHandle) :
     mHandle(aHandle),
     mData(nullptr)
   {
   }
 
   virtual ~SharedMemorySysV()
   {
     shmdt(mData);
--- a/netwerk/wifi/nsWifiScannerDBus.h
+++ b/netwerk/wifi/nsWifiScannerDBus.h
@@ -12,17 +12,17 @@
 
 class nsWifiAccessPoint;
 
 namespace mozilla {
 
 class nsWifiScannerDBus MOZ_FINAL
 {
 public:
-  nsWifiScannerDBus(nsCOMArray<nsWifiAccessPoint>* aAccessPoints);
+  explicit nsWifiScannerDBus(nsCOMArray<nsWifiAccessPoint>* aAccessPoints);
   ~nsWifiScannerDBus();
 
   nsresult Scan();
 
 private:
   nsresult SendMessage(const char* aInterface,
                        const char* aPath,
                        const char* aFuncCall);
--- a/storage/test/test_deadlock_detector.cpp
+++ b/storage/test/test_deadlock_detector.cpp
@@ -26,17 +26,17 @@ using namespace mozilla;
 
 /**
  * Helper class to allocate a sqlite3_mutex for our SQLiteMutex.  Also makes
  * keeping the test files in sync easier.
  */
 class TestMutex : public mozilla::storage::SQLiteMutex
 {
 public:
-    TestMutex(const char* aName)
+    explicit TestMutex(const char* aName)
     : mozilla::storage::SQLiteMutex(aName)
     , mInner(sqlite3_mutex_alloc(SQLITE_MUTEX_FAST))
     {
         NS_ASSERTION(mInner, "could not allocate a sqlite3_mutex");
         initWithMutex(mInner);
     }
 
     ~TestMutex()
@@ -89,17 +89,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/toolkit/system/gnome/nsGIOService.cpp
+++ b/toolkit/system/gnome/nsGIOService.cpp
@@ -41,17 +41,17 @@ get_content_type_from_mime_type(const ch
 }
 
 class nsGIOMimeApp MOZ_FINAL : public nsIGIOMimeApp
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIGIOMIMEAPP
 
-  nsGIOMimeApp(GAppInfo* aApp) : mApp(aApp) {}
+  explicit nsGIOMimeApp(GAppInfo* aApp) : mApp(aApp) {}
 
 private:
   ~nsGIOMimeApp() { g_object_unref(mApp); }
 
   GAppInfo *mApp;
 };
 
 NS_IMPL_ISUPPORTS(nsGIOMimeApp, nsIGIOMimeApp)
--- a/toolkit/system/gnome/nsGSettingsService.cpp
+++ b/toolkit/system/gnome/nsGSettingsService.cpp
@@ -78,18 +78,18 @@ GSETTINGS_FUNCTIONS
 static PRLibrary *gioLib = nullptr;
 
 class nsGSettingsCollection MOZ_FINAL : public nsIGSettingsCollection
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIGSETTINGSCOLLECTION
 
-  nsGSettingsCollection(GSettings* aSettings) : mSettings(aSettings),
-                                                mKeys(nullptr) {}
+  explicit nsGSettingsCollection(GSettings* aSettings) : mSettings(aSettings),
+                                                         mKeys(nullptr) {}
 private:
   ~nsGSettingsCollection();
 
   bool KeyExists(const nsACString& aKey);
   bool SetValue(const nsACString& aKey,
                   GVariant *aValue);
 
   GSettings *mSettings;
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.h
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.h
@@ -7,18 +7,18 @@
 #ifndef nsMIMEInfoUnix_h_
 #define nsMIMEInfoUnix_h_
 
 #include "nsMIMEInfoImpl.h"
 
 class nsMIMEInfoUnix : public nsMIMEInfoImpl
 {
 public:
-  nsMIMEInfoUnix(const char *aMIMEType = "") : nsMIMEInfoImpl(aMIMEType) {}
-  nsMIMEInfoUnix(const nsACString& aMIMEType) : nsMIMEInfoImpl(aMIMEType) {}
+  explicit nsMIMEInfoUnix(const char *aMIMEType = "") : nsMIMEInfoImpl(aMIMEType) {}
+  explicit nsMIMEInfoUnix(const nsACString& aMIMEType) : nsMIMEInfoImpl(aMIMEType) {}
   nsMIMEInfoUnix(const nsACString& aType, HandlerClass aClass) :
     nsMIMEInfoImpl(aType, aClass) {}
   static bool HandlerExists(const char *aProtocolScheme);
 
 protected:
   NS_IMETHOD GetHasDefaultHandler(bool *_retval);
 
   virtual nsresult LoadUriInternal(nsIURI *aURI);
--- a/xpcom/base/SystemMemoryReporter.cpp
+++ b/xpcom/base/SystemMemoryReporter.cpp
@@ -47,27 +47,27 @@ namespace SystemMemoryReporter {
 #error "This won't work if we're not on Linux."
 #endif
 
 /**
  * RAII helper that will close an open DIR handle.
  */
 struct MOZ_STACK_CLASS AutoDir
 {
-  AutoDir(DIR* aDir) : mDir(aDir) {}
+  explicit AutoDir(DIR* aDir) : mDir(aDir) {}
   ~AutoDir() { if (mDir) closedir(mDir); };
   DIR* mDir;
 };
 
 /**
  * RAII helper that will close an open FILE handle.
  */
 struct MOZ_STACK_CLASS AutoFile
 {
-  AutoFile(FILE* aFile) : mFile(aFile) {}
+  explicit AutoFile(FILE* aFile) : mFile(aFile) {}
   ~AutoFile() { if (mFile) fclose(mFile); }
   FILE* mFile;
 };
 
 static bool
 EndsWithLiteral(const nsCString& aHaystack, const char* aNeedle)
 {
   int32_t idx = aHaystack.RFind(aNeedle);