Bug 1109694 - Fix more bad implicit constructors in dom/media. r=baku, a=sledru
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 07 Jan 2015 09:18:00 -0500
changeset 232047 47c66f96853d93351945c1c8d818acff4c56953c
parent 232046 4d7e491441c0e4d99f9ee8a8d77c30fd1020f253
child 232048 daaeccd4975e4b06a4c2dbb9b5b78cbbfa4df079
push id6
push userryanvm@gmail.com
push dateMon, 12 Jan 2015 22:04:06 +0000
treeherdermozilla-b2g37_v2_2@895c8fc7b734 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, sledru
bugs1109694
milestone36.0a2
Bug 1109694 - Fix more bad implicit constructors in dom/media. r=baku, a=sledru
dom/media/MediaDevices.h
dom/media/MediaPromise.h
dom/media/MediaStreamError.h
dom/media/MediaStreamGraph.h
dom/media/MediaTaskQueue.h
dom/media/fmp4/SharedDecoderManager.cpp
dom/media/gmp-plugin/gmp-test-decryptor.h
dom/media/gmp/GMPChild.cpp
dom/media/gmp/GMPStorageChild.cpp
dom/media/webm/SoftwareWebMVideoDecoder.h
--- a/dom/media/MediaDevices.h
+++ b/dom/media/MediaDevices.h
@@ -19,17 +19,18 @@ struct MediaStreamConstraints;
 
 #define MOZILLA_DOM_MEDIADEVICES_IMPLEMENTATION_IID \
 { 0x2f784d8a, 0x7485, 0x4280, \
  { 0x9a, 0x36, 0x74, 0xa4, 0xd6, 0x71, 0xa6, 0xc8 } }
 
 class MediaDevices MOZ_FINAL : public DOMEventTargetHelper
 {
 public:
-  MediaDevices(nsPIDOMWindow* aWindow) : DOMEventTargetHelper(aWindow) {}
+  explicit MediaDevices(nsPIDOMWindow* aWindow) :
+    DOMEventTargetHelper(aWindow) {}
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIADEVICES_IMPLEMENTATION_IID)
 
   JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE;
 
   already_AddRefed<Promise>
   GetUserMedia(const MediaStreamConstraints& aConstraints, ErrorResult &aRv);
--- a/dom/media/MediaPromise.h
+++ b/dom/media/MediaPromise.h
@@ -53,17 +53,17 @@ template<typename T> class MediaPromiseH
 template<typename ResolveValueT, typename RejectValueT>
 class MediaPromise
 {
 public:
   typedef ResolveValueT ResolveValueType;
   typedef RejectValueT RejectValueType;
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaPromise)
-  MediaPromise(const char* aCreationSite)
+  explicit MediaPromise(const char* aCreationSite)
     : mCreationSite(aCreationSite)
     , mMutex("MediaPromise Mutex")
   {
     MOZ_COUNT_CTOR(MediaPromise);
     PROMISE_LOG("%s creating MediaPromise (%p)", mCreationSite, this);
   }
 
 protected:
@@ -134,17 +134,17 @@ protected:
         return NS_OK;
       }
 
     private:
       ThenValueBase* mThenValue;
       RejectValueType mRejectValue;
     };
 
-    ThenValueBase(const char* aCallSite) : mCallSite(aCallSite)
+    explicit ThenValueBase(const char* aCallSite) : mCallSite(aCallSite)
     {
       MOZ_COUNT_CTOR(ThenValueBase);
     }
 
     virtual void Dispatch(MediaPromise *aPromise) = 0;
 
   protected:
     // This may only be deleted by {Resolve,Reject}Runnable::Run.
--- a/dom/media/MediaStreamError.h
+++ b/dom/media/MediaStreamError.h
@@ -39,19 +39,19 @@ protected:
   nsString mMessage;
   const nsString mConstraintName;
 };
 
 class MediaMgrError MOZ_FINAL : public nsISupports,
                                 public BaseMediaMgrError
 {
 public:
-  MediaMgrError(const nsAString& aName,
-                const nsAString& aMessage =  EmptyString(),
-                const nsAString& aConstraintName =  EmptyString())
+  explicit MediaMgrError(const nsAString& aName,
+                         const nsAString& aMessage =  EmptyString(),
+                         const nsAString& aConstraintName =  EmptyString())
   : BaseMediaMgrError(aName, aMessage, aConstraintName) {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
 private:
   ~MediaMgrError() {}
 };
 
--- a/dom/media/MediaStreamGraph.h
+++ b/dom/media/MediaStreamGraph.h
@@ -1224,17 +1224,17 @@ public:
   }
 
   /**
    * Returns graph sample rate in Hz.
    */
   TrackRate GraphRate() const { return mSampleRate; }
 
 protected:
-  MediaStreamGraph(TrackRate aSampleRate)
+  explicit MediaStreamGraph(TrackRate aSampleRate)
     : mNextGraphUpdateIndex(1)
     , mSampleRate(aSampleRate)
   {
     MOZ_COUNT_CTOR(MediaStreamGraph);
   }
   virtual ~MediaStreamGraph()
   {
     MOZ_COUNT_DTOR(MediaStreamGraph);
--- a/dom/media/MediaTaskQueue.h
+++ b/dom/media/MediaTaskQueue.h
@@ -87,17 +87,18 @@ private:
 
   // Monitor that protects the queue and mIsRunning;
   Monitor mQueueMonitor;
 
   struct TaskQueueEntry {
     RefPtr<nsIRunnable> mRunnable;
     bool mForceDispatch;
 
-    TaskQueueEntry(TemporaryRef<nsIRunnable> aRunnable, bool aForceDispatch = false)
+    explicit TaskQueueEntry(TemporaryRef<nsIRunnable> aRunnable,
+                            bool aForceDispatch = false)
       : mRunnable(aRunnable), mForceDispatch(aForceDispatch) {}
   };
 
   // Queue of tasks to run.
   std::queue<TaskQueueEntry> mTasks;
 
   // The thread currently running the task queue. We store a reference
   // to this so that IsCurrentThreadIn() can tell if the current thread
--- a/dom/media/fmp4/SharedDecoderManager.cpp
+++ b/dom/media/fmp4/SharedDecoderManager.cpp
@@ -7,17 +7,17 @@
 #include "SharedDecoderManager.h"
 #include "mp4_demuxer/DecoderData.h"
 
 namespace mozilla {
 
 class SharedDecoderCallback : public MediaDataDecoderCallback
 {
 public:
-  SharedDecoderCallback(SharedDecoderManager* aManager) : mManager(aManager) {}
+  explicit SharedDecoderCallback(SharedDecoderManager* aManager) : mManager(aManager) {}
 
   virtual void Output(MediaData* aData) MOZ_OVERRIDE
   {
     if (mManager->mActiveCallback) {
       mManager->mActiveCallback->Output(aData);
     }
   }
   virtual void Error() MOZ_OVERRIDE
--- a/dom/media/gmp-plugin/gmp-test-decryptor.h
+++ b/dom/media/gmp-plugin/gmp-test-decryptor.h
@@ -9,17 +9,17 @@
 #include "gmp-decryption.h"
 #include "gmp-async-shutdown.h"
 #include <string>
 #include "mozilla/Attributes.h"
 
 class FakeDecryptor : public GMPDecryptor {
 public:
 
-  FakeDecryptor(GMPDecryptorHost* aHost);
+  explicit FakeDecryptor(GMPDecryptorHost* aHost);
 
   virtual void Init(GMPDecryptorCallback* aCallback) MOZ_OVERRIDE {
     mCallback = aCallback;
   }
 
   virtual void CreateSession(uint32_t aPromiseId,
                              const char* aInitDataType,
                              uint32_t aInitDataTypeSize,
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -354,17 +354,17 @@ GMPChild::PreLoadLibraries(const std::st
 }
 #endif
 
 #if defined(MOZ_GMP_SANDBOX)
 
 #if defined(XP_MACOSX)
 class MacOSXSandboxStarter : public SandboxStarter {
 public:
-  MacOSXSandboxStarter(GMPChild* aGMPChild)
+  explicit MacOSXSandboxStarter(GMPChild* aGMPChild)
     : mGMPChild(aGMPChild)
   {}
   virtual void Start(const char* aLibPath) MOZ_OVERRIDE {
     mGMPChild->StartMacSandbox();
   }
 private:
   GMPChild* mGMPChild;
 };
--- a/dom/media/gmp/GMPStorageChild.cpp
+++ b/dom/media/gmp/GMPStorageChild.cpp
@@ -285,17 +285,17 @@ GMPStorageChild::EnumerateRecords(RecvGM
   }
   MOZ_ASSERT(aRecvIteratorFunc);
   mPendingRecordIterators.push(RecordIteratorContext(aRecvIteratorFunc, aUserArg));
   return GMPNoErr;
 }
 
 class GMPRecordIteratorImpl : public GMPRecordIterator {
 public:
-  GMPRecordIteratorImpl(const InfallibleTArray<nsCString>& aRecordNames)
+  explicit GMPRecordIteratorImpl(const InfallibleTArray<nsCString>& aRecordNames)
     : mRecordNames(aRecordNames)
     , mIndex(0)
   {
     mRecordNames.Sort();
   }
 
   virtual GMPErr GetName(const char** aOutName, uint32_t* aOutNameLength) MOZ_OVERRIDE {
     if (!aOutName || !aOutNameLength) {
--- a/dom/media/webm/SoftwareWebMVideoDecoder.h
+++ b/dom/media/webm/SoftwareWebMVideoDecoder.h
@@ -19,17 +19,17 @@ public:
 
   virtual nsresult Init(unsigned int aWidth, unsigned int aHeight) MOZ_OVERRIDE;
 
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
                                 int64_t aTimeThreshold) MOZ_OVERRIDE;
 
   virtual void Shutdown() MOZ_OVERRIDE;
 
-  SoftwareWebMVideoDecoder(WebMReader* aReader);
+  explicit SoftwareWebMVideoDecoder(WebMReader* aReader);
   ~SoftwareWebMVideoDecoder();
 
 private:
   nsRefPtr<WebMReader> mReader;
 
   // VPx decoder state
   vpx_codec_ctx_t mVPX;
 };