Bug 1109746 - Fix more bad implicit constructors in some random code across the tree
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 13 Dec 2014 14:17:04 -0500
changeset 236392 630ce3c3fa314d84832a48105702215406f189f6
parent 236391 88fbef622ae38da7f8a505ccacf63812ff466c28
child 236393 30a3399193a89ac47004de3dce13f87a76146ccc
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1109746
milestone37.0a1
Bug 1109746 - Fix more bad implicit constructors in some random code across the tree
accessible/ipc/ProxyAccessible.h
dom/base/WebSocket.cpp
dom/indexedDB/ActorsChild.h
dom/indexedDB/ActorsParent.cpp
embedding/components/printingui/ipc/PrintDataUtils.h
memory/replace/logalloc/replay/Replay.cpp
toolkit/components/terminator/nsTerminator.cpp
xpcom/io/SnappyCompressOutputStream.h
xpcom/io/SnappyUncompressInputStream.h
--- a/accessible/ipc/ProxyAccessible.h
+++ b/accessible/ipc/ProxyAccessible.h
@@ -81,17 +81,17 @@ public:
   void SetWrapper(uintptr_t aWrapper) { mWrapper = aWrapper; }
 
   /*
    * Return the ID of the accessible being proxied.
    */
   uint64_t ID() const { return mID; }
 
 protected:
-  ProxyAccessible(DocAccessibleParent* aThisAsDoc) :
+  explicit ProxyAccessible(DocAccessibleParent* aThisAsDoc) :
     mParent(nullptr), mDoc(aThisAsDoc), mWrapper(0), mID(0),
     mRole(roles::DOCUMENT)
   { MOZ_COUNT_CTOR(ProxyAccessible); }
 
 protected:
   ProxyAccessible* mParent;
 
 private:
--- a/dom/base/WebSocket.cpp
+++ b/dom/base/WebSocket.cpp
@@ -410,17 +410,17 @@ private:
   uint16_t mReasonCode;
   const nsACString& mReasonString;
   nsresult mRv;
 };
 
 class MOZ_STACK_CLASS MaybeDisconnect
 {
 public:
-  MaybeDisconnect(WebSocketImpl* aImpl)
+  explicit MaybeDisconnect(WebSocketImpl* aImpl)
     : mImpl(aImpl)
   {
   }
 
   ~MaybeDisconnect()
   {
     if (mImpl->mWorkerShuttingDown) {
       mImpl->Disconnect();
--- a/dom/indexedDB/ActorsChild.h
+++ b/dom/indexedDB/ActorsChild.h
@@ -120,17 +120,17 @@ public:
   GetCurrentTransaction() const
   {
     AssertIsOnOwningThread();
 
     return mCurrentTransaction;
   }
 
 private:
-  ThreadLocal(const nsID& aBackgroundChildLoggingId);
+  explicit ThreadLocal(const nsID& aBackgroundChildLoggingId);
   ~ThreadLocal();
 
   ThreadLocal() MOZ_DELETE;
   ThreadLocal(const ThreadLocal& aOther) MOZ_DELETE;
 };
 
 class BackgroundFactoryChild MOZ_FINAL
   : public PBackgroundIDBFactoryChild
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -5075,17 +5075,17 @@ class DatabaseLoggingInfo MOZ_FINAL
 #ifdef DEBUG
   // Just for potential warnings.
   friend class Factory;
 #endif
 
   LoggingInfo mLoggingInfo;
 
 public:
-  DatabaseLoggingInfo(const LoggingInfo& aLoggingInfo)
+  explicit DatabaseLoggingInfo(const LoggingInfo& aLoggingInfo)
     : mLoggingInfo(aLoggingInfo)
   {
     AssertIsOnBackgroundThread();
   }
 
   const nsID&
   Id() const
   {
--- a/embedding/components/printingui/ipc/PrintDataUtils.h
+++ b/embedding/components/printingui/ipc/PrintDataUtils.h
@@ -18,17 +18,17 @@
  */
 
 namespace mozilla {
 namespace embedding {
 
 class MockWebBrowserPrint MOZ_FINAL : public nsIWebBrowserPrint
 {
 public:
-  MockWebBrowserPrint(PrintData aData);
+  explicit MockWebBrowserPrint(PrintData aData);
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIWEBBROWSERPRINT
 
 private:
   ~MockWebBrowserPrint();
   PrintData mData;
 };
--- a/memory/replace/logalloc/replay/Replay.cpp
+++ b/memory/replace/logalloc/replay/Replay.cpp
@@ -197,17 +197,17 @@ public:
 private:
   const char* mBuf;
   size_t mLength;
 };
 
 /* Helper class to read from a file descriptor line by line. */
 class FdReader {
 public:
-  FdReader(int aFd)
+  explicit FdReader(int aFd)
     : mFd(aFd)
     , mData(&mRawBuf, 0)
     , mBuf(&mRawBuf, sizeof(mRawBuf))
   {}
 
   /* Read a line from the file descriptor and returns it as a Buffer instance */
   Buffer ReadLine()
   {
--- a/toolkit/components/terminator/nsTerminator.cpp
+++ b/toolkit/components/terminator/nsTerminator.cpp
@@ -296,17 +296,17 @@ void RunWriter(void* arg)
  * notification. The duration of a step is defined as the number of
  * ticks between the time we receive a notification and the next one.
  */
 struct ShutdownStep
 {
   char const* const mTopic;
   int mTicks;
 
-  MOZ_CONSTEXPR ShutdownStep(const char *const topic)
+  MOZ_CONSTEXPR explicit ShutdownStep(const char *const topic)
     : mTopic(topic)
     , mTicks(-1)
   {}
 
 };
 
 static ShutdownStep sShutdownSteps[] = {
   ShutdownStep("quit-application"),
--- a/xpcom/io/SnappyCompressOutputStream.h
+++ b/xpcom/io/SnappyCompressOutputStream.h
@@ -22,18 +22,18 @@ class SnappyCompressOutputStream MOZ_FIN
 public:
   // Maximum compression block size.
   static const size_t kMaxBlockSize;
 
   // Construct a new blocking output stream to compress data to
   // the given base stream.  The base stream must also be blocking.
   // The compression block size may optionally be set to a value
   // up to kMaxBlockSize.
-  SnappyCompressOutputStream(nsIOutputStream* aBaseStream,
-                             size_t aBlockSize = kMaxBlockSize);
+  explicit SnappyCompressOutputStream(nsIOutputStream* aBaseStream,
+                                      size_t aBlockSize = kMaxBlockSize);
 
   // The compression block size.  To optimize stream performance
   // try to write to the stream in segments at least this size.
   size_t BlockSize() const;
 
 private:
   virtual ~SnappyCompressOutputStream();
 
--- a/xpcom/io/SnappyUncompressInputStream.h
+++ b/xpcom/io/SnappyUncompressInputStream.h
@@ -18,17 +18,17 @@ namespace mozilla {
 
 class SnappyUncompressInputStream MOZ_FINAL : public nsIInputStream
                                             , protected detail::SnappyFrameUtils
 {
 public:
   // Construct a new blocking stream to uncompress the given base stream.  The
   // base stream must also be blocking.  The base stream does not have to be
   // buffered.
-  SnappyUncompressInputStream(nsIInputStream* aBaseStream);
+  explicit SnappyUncompressInputStream(nsIInputStream* aBaseStream);
 
 private:
   virtual ~SnappyUncompressInputStream();
 
   // Parse the next chunk of data.  This may populate mBuffer and set
   // mBufferFillSize.  This should not be called when mBuffer already
   // contains data.
   nsresult ParseNextChunk(uint32_t* aBytesReadOut);