Bug 1060980 - Fix more bad implicit constructors in the media code; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 31 Aug 2014 23:50:23 -0400
changeset 202861 2572b784a8bbd0119cd0e97119499d6654c3f0ba
parent 202860 d4435430598f14340a30c8f80d7187022aef8cb2
child 202862 588d58c76e334431389a0989af885ad2440d1306
push id27413
push userphilringnalda@gmail.com
push dateTue, 02 Sep 2014 05:46:30 +0000
treeherdermozilla-central@c360f3d1c00d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1060980
milestone34.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 1060980 - Fix more bad implicit constructors in the media code; r=roc
content/media/AbstractMediaDecoder.h
content/media/AudioCompactor.h
content/media/AudioMixer.h
content/media/AudioSegment.h
content/media/AudioStream.h
content/media/DOMMediaStream.cpp
content/media/DOMMediaStream.h
content/media/EncodedBufferCache.h
content/media/FileBlockCache.h
content/media/GraphDriver.cpp
content/media/GraphDriver.h
content/media/MP3FrameParser.h
content/media/MediaCache.cpp
content/media/MediaCache.h
content/media/MediaDecoder.h
content/media/MediaDecoderReader.h
content/media/MediaDecoderStateMachine.h
content/media/MediaRecorder.cpp
content/media/MediaResource.h
content/media/MediaSegment.h
content/media/MediaStreamGraph.cpp
content/media/MediaStreamGraph.h
content/media/MediaTaskQueue.cpp
content/media/MediaTaskQueue.h
content/media/MediaTrackList.h
content/media/RtspMediaResource.h
content/media/StreamBuffer.h
content/media/TextTrackCueList.h
content/media/TextTrackList.h
content/media/TextTrackRegion.h
content/media/TimeVarying.h
content/media/TrackUnionStream.h
content/media/VideoUtils.h
content/media/WebVTTListener.h
content/media/apple/AppleMP3Reader.h
content/media/eme/CDMProxy.h
content/media/eme/MediaEncryptedEvent.h
content/media/fmp4/MP4Reader.h
content/media/gmp/GMPAudioDecoderChild.h
content/media/gmp/GMPAudioDecoderParent.h
content/media/gmp/GMPAudioHost.h
content/media/gmp/GMPDecryptorChild.h
content/media/gmp/GMPDecryptorParent.h
content/media/gmp/GMPEncryptedBufferDataImpl.h
content/media/gmp/GMPPlatform.cpp
content/media/gmp/GMPProcessChild.h
content/media/gmp/GMPProcessParent.h
content/media/gmp/GMPService.h
content/media/gmp/GMPSharedMemManager.h
content/media/gmp/GMPStorageChild.h
content/media/gmp/GMPTimerChild.h
content/media/gmp/GMPTimerParent.h
content/media/gmp/GMPVideoDecoderChild.h
content/media/gmp/GMPVideoDecoderParent.h
content/media/gmp/GMPVideoEncodedFrameImpl.h
content/media/gmp/GMPVideoEncoderChild.h
content/media/gmp/GMPVideoEncoderParent.h
content/media/gmp/GMPVideoHost.h
content/media/gmp/GMPVideoPlaneImpl.h
content/media/gmp/GMPVideoi420FrameImpl.h
content/media/mediasource/MediaSourceDecoder.h
content/media/mediasource/MediaSourceReader.cpp
content/media/mediasource/MediaSourceReader.h
content/media/mediasource/SourceBufferResource.h
content/media/ogg/OggCodecState.h
content/media/ogg/OggReader.h
content/media/raw/RawReader.h
content/media/systemservices/LoadManager.h
content/media/systemservices/LoadMonitor.cpp
content/media/systemservices/LoadMonitor.h
content/media/wave/WaveReader.h
content/media/webaudio/AudioNodeEngine.h
content/media/webaudio/blink/DirectConvolver.h
content/media/webaudio/blink/FFTConvolver.h
content/media/webaudio/blink/HRTFDatabaseLoader.h
content/media/webaudio/blink/ReverbAccumulationBuffer.h
content/media/webaudio/blink/ReverbInputBuffer.h
content/media/webm/WebMReader.h
content/media/webm/WebMWriter.h
content/media/webrtc/MediaEngineDefault.cpp
content/media/webrtc/MediaEngineTabVideoSource.h
content/media/webrtc/MediaEngineWebRTC.h
content/media/webrtc/MediaTrackConstraints.h
content/media/webrtc/PeerIdentity.h
content/media/webspeech/recognition/SpeechGrammar.h
content/media/webspeech/recognition/SpeechGrammarList.h
content/media/webspeech/recognition/SpeechRecognition.h
content/media/webspeech/recognition/SpeechRecognitionAlternative.h
content/media/webspeech/recognition/SpeechRecognitionResult.h
content/media/webspeech/recognition/SpeechRecognitionResultList.h
content/media/webspeech/recognition/SpeechStreamListener.h
content/media/webspeech/synth/SpeechSynthesis.h
content/media/webspeech/synth/ipc/SpeechSynthesisChild.h
content/media/webspeech/synth/ipc/SpeechSynthesisParent.h
content/media/webspeech/synth/nsSpeechTask.cpp
content/media/webspeech/synth/nsSpeechTask.h
dom/media/MediaManager.h
dom/media/gmp-plugin/gmp-fake.cpp
media/libstagefright/binding/include/mp4_demuxer/MoofParser.h
media/libstagefright/binding/include/mp4_demuxer/mp4_demuxer.h
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
--- a/content/media/AbstractMediaDecoder.h
+++ b/content/media/AbstractMediaDecoder.h
@@ -176,17 +176,17 @@ class MetadataEventRunner : public nsRun
 
   // The ownership is transferred to its owning element.
   MetadataTags* mTags;
 };
 
 class RemoveMediaTracksEventRunner : public nsRunnable
 {
 public:
-  RemoveMediaTracksEventRunner(AbstractMediaDecoder* aDecoder)
+  explicit RemoveMediaTracksEventRunner(AbstractMediaDecoder* aDecoder)
     : mDecoder(aDecoder)
   {}
 
   NS_IMETHOD Run() MOZ_OVERRIDE
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     mDecoder->RemoveMediaTracks();
--- a/content/media/AudioCompactor.h
+++ b/content/media/AudioCompactor.h
@@ -10,17 +10,17 @@
 #include "MediaData.h"
 #include "VideoUtils.h"
 
 namespace mozilla {
 
 class AudioCompactor
 {
 public:
-  AudioCompactor(MediaQueue<AudioData>& aQueue)
+  explicit AudioCompactor(MediaQueue<AudioData>& aQueue)
     : mQueue(aQueue)
   { }
 
   // Push audio data into the underlying queue with minimal heap allocation
   // slop.  This method is responsible for allocating AudioDataValue[] buffers.
   // The caller must provide a functor to copy the data into the buffers.  The
   // functor must provide the following signature:
   //
--- a/content/media/AudioMixer.h
+++ b/content/media/AudioMixer.h
@@ -123,17 +123,17 @@ private:
       mMixedAudio.SetLength(mFrames* mChannels);
     }
     PodZero(mMixedAudio.Elements(), mMixedAudio.Length());
   }
 
   class MixerCallback : public LinkedListElement<MixerCallback>
   {
   public:
-    MixerCallback(MixerCallbackReceiver* aReceiver)
+    explicit MixerCallback(MixerCallbackReceiver* aReceiver)
       : mReceiver(aReceiver)
     { }
     MixerCallbackReceiver* mReceiver;
   };
 
   /* Function that is called when the mixing is done. */
   LinkedList<MixerCallback> mCallbacks;
   /* Number of frames for this mixing block. */
--- a/content/media/AudioSegment.h
+++ b/content/media/AudioSegment.h
@@ -14,17 +14,17 @@
 #include "mozilla/TimeStamp.h"
 #endif
 
 namespace mozilla {
 
 template<typename T>
 class SharedChannelArrayBuffer : public ThreadSharedObject {
 public:
-  SharedChannelArrayBuffer(nsTArray<nsTArray<T> >* aBuffers)
+  explicit SharedChannelArrayBuffer(nsTArray<nsTArray<T> >* aBuffers)
   {
     mBuffers.SwapElements(*aBuffers);
   }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
   {
     size_t amount = 0;
     amount += mBuffers.SizeOfExcludingThis(aMallocSizeOf);
--- a/content/media/AudioStream.h
+++ b/content/media/AudioStream.h
@@ -32,17 +32,17 @@ struct DefaultDelete<cubeb_stream>
 };
 
 class AudioStream;
 class FrameHistory;
 
 class AudioClock
 {
 public:
-  AudioClock(AudioStream* aStream);
+  explicit AudioClock(AudioStream* aStream);
   // Initialize the clock with the current AudioStream. Need to be called
   // before querying the clock. Called on the audio thread.
   void Init();
   // Update the number of samples that has been written in the audio backend.
   // Called on the state machine thread.
   void UpdateFrameHistory(uint32_t aServiced, uint32_t aUnderrun);
   // Get the read position of the stream, in microseconds.
   // Called on the state machine thead.
--- a/content/media/DOMMediaStream.cpp
+++ b/content/media/DOMMediaStream.cpp
@@ -54,17 +54,17 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(DOMAu
 NS_IMPL_ADDREF_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
 NS_IMPL_RELEASE_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMAudioNodeMediaStream)
 NS_INTERFACE_MAP_END_INHERITING(DOMMediaStream)
 
 class DOMMediaStream::StreamListener : public MediaStreamListener {
 public:
-  StreamListener(DOMMediaStream* aStream)
+  explicit StreamListener(DOMMediaStream* aStream)
     : mStream(aStream)
   {}
 
   // Main thread only
   void Forget() { mStream = nullptr; }
   DOMMediaStream* GetStream() { return mStream; }
 
   class TrackChange : public nsRunnable {
--- a/content/media/DOMMediaStream.h
+++ b/content/media/DOMMediaStream.h
@@ -186,17 +186,17 @@ public:
 
   // Notifications from StreamListener.
   // CreateDOMTrack should only be called when it's safe to run script.
   MediaStreamTrack* CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType);
   MediaStreamTrack* GetDOMTrackFor(TrackID aTrackID);
 
   class OnTracksAvailableCallback {
   public:
-    OnTracksAvailableCallback(uint8_t aExpectedTracks = 0)
+    explicit OnTracksAvailableCallback(uint8_t aExpectedTracks = 0)
       : mExpectedTracks(aExpectedTracks) {}
     virtual ~OnTracksAvailableCallback() {}
     virtual void NotifyTracksAvailable(DOMMediaStream* aStream) = 0;
     TrackTypeHints GetExpectedTracks() { return mExpectedTracks; }
     void SetExpectedTracks(TrackTypeHints aExpectedTracks) { mExpectedTracks = aExpectedTracks; }
   private:
     TrackTypeHints mExpectedTracks;
   };
@@ -316,17 +316,17 @@ public:
 protected:
   virtual ~DOMLocalMediaStream();
 };
 
 class DOMAudioNodeMediaStream : public DOMMediaStream
 {
   typedef dom::AudioNode AudioNode;
 public:
-  DOMAudioNodeMediaStream(AudioNode* aNode);
+  explicit DOMAudioNodeMediaStream(AudioNode* aNode);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
 
   /**
    * Create a DOMAudioNodeMediaStream whose underlying stream is a TrackUnionStream.
    */
   static already_AddRefed<DOMAudioNodeMediaStream>
--- a/content/media/EncodedBufferCache.h
+++ b/content/media/EncodedBufferCache.h
@@ -21,17 +21,17 @@ class ReentrantMonitor;
  * Data is moved into a temporary file when it grows beyond
  * the maximal size passed in the Init function.
  * The AppendBuffer and ExtractBlob methods are thread-safe and can be called on
  * different threads at the same time.
  */
 class EncodedBufferCache
 {
 public:
-  EncodedBufferCache(uint32_t aMaxMemoryStorage)
+  explicit EncodedBufferCache(uint32_t aMaxMemoryStorage)
   : mFD(nullptr),
     mMutex("EncodedBufferCache.Data.Mutex"),
     mDataSize(0),
     mMaxMemoryStorage(aMaxMemoryStorage),
     mTempFileEnabled(false) { }
   ~EncodedBufferCache()
   {
   }
--- a/content/media/FileBlockCache.h
+++ b/content/media/FileBlockCache.h
@@ -88,26 +88,26 @@ public:
   // is either a write (and the data to be written is stored in this struct)
   // or a move (and the index of the source block is stored instead).
   struct BlockChange MOZ_FINAL {
 
     NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BlockChange)
 
     // This block is waiting in memory to be written.
     // Stores a copy of the block, so we can write it asynchronously.
-    BlockChange(const uint8_t* aData)
+    explicit BlockChange(const uint8_t* aData)
       : mSourceBlockIndex(-1)
     {
       mData = new uint8_t[BLOCK_SIZE];
       memcpy(mData.get(), aData, BLOCK_SIZE);
     }
 
     // This block's contents are located in another file
     // block, i.e. this block has been moved.
-    BlockChange(int32_t aSourceBlockIndex)
+    explicit BlockChange(int32_t aSourceBlockIndex)
       : mSourceBlockIndex(aSourceBlockIndex) {}
 
     nsAutoArrayPtr<uint8_t> mData;
     const int32_t mSourceBlockIndex;
 
     bool IsMove() const {
       return mSourceBlockIndex != -1;
     }
--- a/content/media/GraphDriver.cpp
+++ b/content/media/GraphDriver.cpp
@@ -701,17 +701,17 @@ AudioCallbackDriver::DataCallback(AudioD
 {
   bool stillProcessing;
 
   if (mPauseRequested) {
     PodZero(aBuffer, aFrames * mGraphImpl->AudioChannelCount());
     return aFrames;
   }
 
-  DebugOnly<AutoInCallback> aic(this);
+  DebugOnly<AutoInCallback> aic(AutoInCallback(this));
 
   if (mStateComputedTime == 0) {
     MonitorAutoLock mon(mGraphImpl->GetMonitor());
     // Because this function is called during cubeb_stream_init (to prefill the
     // audio buffers), it can be that we don't have a message here (because this
     // driver is the first one for this graph), and the graph would exit. Simply
     // return here until we have messages.
     if (!mGraphImpl->MessagesQueued()) {
--- a/content/media/GraphDriver.h
+++ b/content/media/GraphDriver.h
@@ -67,17 +67,17 @@ class AudioCallbackDriver;
  * abstract base class. A MediaStreamGraph can be driven by an
  * OfflineClockDriver, if the graph is offline, or a SystemClockDriver, if the
  * graph is real time.
  * A MediaStreamGraph holds an owning reference to its driver.
  */
 class GraphDriver
 {
 public:
-  GraphDriver(MediaStreamGraphImpl* aGraphImpl);
+  explicit GraphDriver(MediaStreamGraphImpl* aGraphImpl);
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GraphDriver);
   /* When the graph wakes up to do an iteration, this returns the range of time
    * that will be processed. */
   virtual void GetIntervalForIteration(GraphTime& aFrom,
                                        GraphTime& aTo) = 0;
   /* Returns the current time for this graph. This is the end of the current
    * iteration. */
@@ -231,17 +231,17 @@ protected:
 class MediaStreamGraphInitThreadRunnable;
 
 /**
  * This class is a driver that manages its own thread.
  */
 class ThreadedDriver : public GraphDriver
 {
 public:
-  ThreadedDriver(MediaStreamGraphImpl* aGraphImpl);
+  explicit ThreadedDriver(MediaStreamGraphImpl* aGraphImpl);
   virtual ~ThreadedDriver();
   virtual void Start() MOZ_OVERRIDE;
   virtual void Stop() MOZ_OVERRIDE;
   virtual void Resume() MOZ_OVERRIDE;
   virtual void Revive() MOZ_OVERRIDE;
   /**
    * Runs main control loop on the graph thread. Normally a single invocation
    * of this runs for the entire lifetime of the graph thread.
@@ -257,17 +257,17 @@ protected:
 
 /**
  * A SystemClockDriver drives a MediaStreamGraph using a system clock, and waits
  * using a monitor, between each iteration.
  */
 class SystemClockDriver : public ThreadedDriver
 {
 public:
-  SystemClockDriver(MediaStreamGraphImpl* aGraphImpl);
+  explicit SystemClockDriver(MediaStreamGraphImpl* aGraphImpl);
   virtual ~SystemClockDriver();
   virtual void GetIntervalForIteration(GraphTime& aFrom,
                                        GraphTime& aTo) MOZ_OVERRIDE;
   virtual GraphTime GetCurrentTime() MOZ_OVERRIDE;
   virtual void WaitForNextIteration() MOZ_OVERRIDE;
   virtual void WakeUp() MOZ_OVERRIDE;
 
 
@@ -316,18 +316,18 @@ private:
  *   the number of frames asked for by the callback. Since for the Web Audio
  *   API, we have to do block processing at 128 frames per block, we need to
  *   keep a little spill buffer to store the extra frames.
  */
 class AudioCallbackDriver : public GraphDriver,
                             public MixerCallbackReceiver
 {
 public:
-  AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl,
-                      dom::AudioChannel aChannel = dom::AudioChannel::Normal);
+  explicit AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl,
+                               dom::AudioChannel aChannel = dom::AudioChannel::Normal);
   virtual ~AudioCallbackDriver();
 
   virtual void Destroy() MOZ_OVERRIDE;
   virtual void Start() MOZ_OVERRIDE;
   virtual void Stop() MOZ_OVERRIDE;
   virtual void Resume() MOZ_OVERRIDE;
   virtual void Revive() MOZ_OVERRIDE;
   virtual void GetIntervalForIteration(GraphTime& aFrom,
@@ -424,17 +424,17 @@ private:
    * cubeb_stream_init) and the audio thread (when switching away from this
    * driver back to a SystemClockDriver).
    * This is synchronized by the Graph's monitor.
    * */
   bool mStarted;
 
   struct AutoInCallback
   {
-    AutoInCallback(AudioCallbackDriver* aDriver);
+    explicit AutoInCallback(AudioCallbackDriver* aDriver);
     ~AutoInCallback();
     AudioCallbackDriver* mDriver;
   };
 
   /* Thread for off-main-thread initialization and
    * shutdown of the audio stream. */
   nsCOMPtr<nsIThread> mInitShutdownThread;
   dom::AudioChannel mAudioChannel;
--- a/content/media/MP3FrameParser.h
+++ b/content/media/MP3FrameParser.h
@@ -98,17 +98,17 @@ private:
 // The method GetDuration returns calculated duration of the stream, including
 // estimates for skipped ranges.
 //
 // All public methods are thread-safe.
 
 class MP3FrameParser
 {
 public:
-  MP3FrameParser(int64_t aLength=-1);
+  explicit MP3FrameParser(int64_t aLength=-1);
 
   bool IsMP3() {
     MutexAutoLock mon(mLock);
     return mIsMP3 != NOT_MP3;
   }
 
   void Parse(const char* aBuffer, uint32_t aLength, uint64_t aStreamOffset);
 
--- a/content/media/MediaCache.cpp
+++ b/content/media/MediaCache.cpp
@@ -218,17 +218,17 @@ public:
 
   /**
    * An iterator that makes it easy to iterate through all streams that
    * have a given resource ID and are not closed.
    * Can be used on the main thread or while holding the media cache lock.
    */
   class ResourceStreamIterator {
   public:
-    ResourceStreamIterator(int64_t aResourceID) :
+    explicit ResourceStreamIterator(int64_t aResourceID) :
       mResourceID(aResourceID), mNext(0) {}
     MediaCacheStream* Next()
     {
       while (mNext < gMediaCache->mStreams.Length()) {
         MediaCacheStream* stream = gMediaCache->mStreams[mNext];
         ++mNext;
         if (stream->GetResourceID() == mResourceID && !stream->IsClosed())
           return stream;
--- a/content/media/MediaCache.h
+++ b/content/media/MediaCache.h
@@ -189,17 +189,17 @@ public:
   };
   enum ReadMode {
     MODE_METADATA,
     MODE_PLAYBACK
   };
 
   // aClient provides the underlying transport that cache will use to read
   // data for this stream.
-  MediaCacheStream(ChannelMediaResource* aClient);
+  explicit MediaCacheStream(ChannelMediaResource* aClient);
   ~MediaCacheStream();
 
   // Set up this stream with the cache. Can fail on OOM. One
   // of InitAsClone or Init must be called before any other method on
   // this class. Does nothing if already initialized.
   nsresult Init();
 
   // Set up this stream with the cache, assuming it's for the same data
@@ -391,17 +391,17 @@ private:
 #else
     void Verify() {}
 #endif
 
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   private:
     struct Entry : public nsUint32HashKey {
-      Entry(KeyTypePointer aKey) : nsUint32HashKey(aKey) { }
+      explicit Entry(KeyTypePointer aKey) : nsUint32HashKey(aKey) { }
       Entry(const Entry& toCopy) : nsUint32HashKey(&toCopy.GetKey()),
         mNextBlock(toCopy.mNextBlock), mPrevBlock(toCopy.mPrevBlock) {}
 
       int32_t mNextBlock;
       int32_t mPrevBlock;
     };
     nsTHashtable<Entry> mEntries;
 
--- a/content/media/MediaDecoder.h
+++ b/content/media/MediaDecoder.h
@@ -1088,17 +1088,17 @@ protected:
   // main |DASHDecoder| object. In this case, directly accessing the
   // member variable mReentrantMonitor in |DASHRepDecoder| is wrong.
   // The wrapper |RestrictedAccessMonitor| restricts use to the getter
   // function rather than the object itself.
 private:
   class RestrictedAccessMonitor
   {
   public:
-    RestrictedAccessMonitor(const char* aName) :
+    explicit RestrictedAccessMonitor(const char* aName) :
       mReentrantMonitor(aName)
     {
       MOZ_COUNT_CTOR(RestrictedAccessMonitor);
     }
     ~RestrictedAccessMonitor()
     {
       MOZ_COUNT_DTOR(RestrictedAccessMonitor);
     }
--- a/content/media/MediaDecoderReader.h
+++ b/content/media/MediaDecoderReader.h
@@ -26,17 +26,17 @@ class MediaDecoderReader;
 // performed on a background thread, with the result being returned by
 // callback. Never hold the decoder monitor when calling into this class.
 // Unless otherwise specified, methods and fields of this class can only
 // be accessed on the decode task queue.
 class MediaDecoderReader {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaDecoderReader)
 
-  MediaDecoderReader(AbstractMediaDecoder* aDecoder);
+  explicit MediaDecoderReader(AbstractMediaDecoder* aDecoder);
 
   // Initializes the reader, returns NS_OK on success, or NS_ERROR_FAILURE
   // on failure.
   virtual nsresult Init(MediaDecoderReader* aCloneDonor) = 0;
 
   // True if this reader is waiting media resource allocation
   virtual bool IsWaitingMediaResources() { return false; }
   // True when this reader need to become dormant state
--- a/content/media/MediaDecoderStateMachine.h
+++ b/content/media/MediaDecoderStateMachine.h
@@ -359,17 +359,17 @@ protected:
 
   // Inserts MediaData* samples into their respective MediaQueues.
   // aSample must not be null.
   void Push(AudioData* aSample);
   void Push(VideoData* aSample);
 
   class WakeDecoderRunnable : public nsRunnable {
   public:
-    WakeDecoderRunnable(MediaDecoderStateMachine* aSM)
+    explicit WakeDecoderRunnable(MediaDecoderStateMachine* aSM)
       : mMutex("WakeDecoderRunnable"), mStateMachine(aSM) {}
     NS_IMETHOD Run() MOZ_OVERRIDE
     {
       nsRefPtr<MediaDecoderStateMachine> stateMachine;
       {
         // Don't let Run() (called by media stream graph thread) race with
         // Revoke() (called by decoder state machine thread)
         MutexAutoLock lock(mMutex);
--- a/content/media/MediaRecorder.cpp
+++ b/content/media/MediaRecorder.cpp
@@ -87,17 +87,17 @@ class MediaRecorder::Session: public nsI
 {
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // Main thread task.
   // Create a blob event and send back to client.
   class PushBlobRunnable : public nsRunnable
   {
   public:
-    PushBlobRunnable(Session* aSession)
+    explicit PushBlobRunnable(Session* aSession)
       : mSession(aSession)
     { }
 
     NS_IMETHODIMP Run()
     {
       LOG(PR_LOG_DEBUG, ("Session.PushBlobRunnable s=(%p)", mSession.get()));
       MOZ_ASSERT(NS_IsMainThread());
 
@@ -149,17 +149,17 @@ class MediaRecorder::Session: public nsI
     nsString mEventName;
   };
 
   // Record thread task and it run in Media Encoder thread.
   // Fetch encoded Audio/Video data from MediaEncoder.
   class ExtractRunnable : public nsRunnable
   {
   public:
-    ExtractRunnable(Session* aSession)
+    explicit ExtractRunnable(Session* aSession)
       : mSession(aSession) {}
 
     ~ExtractRunnable()
     {}
 
     NS_IMETHODIMP Run()
     {
       MOZ_ASSERT(NS_GetCurrentThread() == mSession->mReadThread);
@@ -185,17 +185,17 @@ class MediaRecorder::Session: public nsI
   private:
     nsRefPtr<Session> mSession;
   };
 
   // For Ensure recorder has tracks to record.
   class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback
   {
   public:
-    TracksAvailableCallback(Session *aSession)
+    explicit TracksAvailableCallback(Session *aSession)
      : mSession(aSession) {}
     virtual void NotifyTracksAvailable(DOMMediaStream* aStream)
     {
       uint8_t trackType = aStream->GetHintContents();
       // ToDo: GetHintContents return 0 when recording media tags.
       if (trackType == 0) {
         nsTArray<nsRefPtr<mozilla::dom::AudioStreamTrack> > audioTracks;
         aStream->GetAudioTracks(audioTracks);
@@ -215,17 +215,17 @@ class MediaRecorder::Session: public nsI
   private:
     nsRefPtr<Session> mSession;
   };
   // Main thread task.
   // To delete RecordingSession object.
   class DestroyRunnable : public nsRunnable
   {
   public:
-    DestroyRunnable(Session* aSession)
+    explicit DestroyRunnable(Session* aSession)
       : mSession(aSession) {}
 
     NS_IMETHODIMP Run()
     {
       LOG(PR_LOG_DEBUG, ("Session.DestroyRunnable session refcnt = (%d) stopIssued %d s=(%p)",
                          (int)mSession->mRefCnt, mSession->mStopIssued, mSession.get()));
       MOZ_ASSERT(NS_IsMainThread() && mSession.get());
       nsRefPtr<MediaRecorder> recorder = mSession->mRecorder;
--- a/content/media/MediaResource.h
+++ b/content/media/MediaResource.h
@@ -51,17 +51,17 @@ class MediaChannelStatistics;
  *
  * All methods take "now" as a parameter so the user of this class can
  * control the timeline used.
  */
 class MediaChannelStatistics {
 public:
   MediaChannelStatistics() { Reset(); }
 
-  MediaChannelStatistics(MediaChannelStatistics * aCopyFrom)
+  explicit MediaChannelStatistics(MediaChannelStatistics * aCopyFrom)
   {
     MOZ_ASSERT(aCopyFrom);
     mAccumulatedBytes = aCopyFrom->mAccumulatedBytes;
     mAccumulatedTime = aCopyFrom->mAccumulatedTime;
     mLastStartTime = aCopyFrom->mLastStartTime;
     mIsStarted = aCopyFrom->mIsStarted;
   }
 
@@ -131,17 +131,17 @@ public:
   MediaByteRange() : mStart(0), mEnd(0) {}
 
   MediaByteRange(int64_t aStart, int64_t aEnd)
     : mStart(aStart), mEnd(aEnd)
   {
     NS_ASSERTION(mStart < mEnd, "Range should end after start!");
   }
 
-  MediaByteRange(TimestampedMediaByteRange& aByteRange);
+  explicit MediaByteRange(TimestampedMediaByteRange& aByteRange);
 
   bool IsNull() const {
     return mStart == 0 && mEnd == 0;
   }
 
   // Clears byte range values.
   void Clear() {
     mStart = 0;
@@ -619,17 +619,17 @@ public:
   }
 
   class Listener MOZ_FINAL : public nsIStreamListener,
                              public nsIInterfaceRequestor,
                              public nsIChannelEventSink
   {
     ~Listener() {}
   public:
-    Listener(ChannelMediaResource* aResource) : mResource(aResource) {}
+    explicit Listener(ChannelMediaResource* aResource) : mResource(aResource) {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSICHANNELEVENTSINK
     NS_DECL_NSIINTERFACEREQUESTOR
 
     void Revoke() { mResource = nullptr; }
--- a/content/media/MediaSegment.h
+++ b/content/media/MediaSegment.h
@@ -111,17 +111,17 @@ public:
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
 protected:
-  MediaSegment(Type aType) : mDuration(0), mType(aType)
+  explicit MediaSegment(Type aType) : mDuration(0), mType(aType)
   {
     MOZ_COUNT_CTOR(MediaSegment);
   }
 
   TrackTicks mDuration; // total of mDurations of all chunks
   Type mType;
 };
 
@@ -215,17 +215,17 @@ public:
   virtual void Clear()
   {
     mDuration = 0;
     mChunks.Clear();
   }
 
   class ChunkIterator {
   public:
-    ChunkIterator(MediaSegmentBase<C, Chunk>& aSegment)
+    explicit ChunkIterator(MediaSegmentBase<C, Chunk>& aSegment)
       : mSegment(aSegment), mIndex(0) {}
     bool IsEnded() { return mIndex >= mSegment.mChunks.Length(); }
     void Next() { ++mIndex; }
     Chunk& operator*() { return mSegment.mChunks[mIndex]; }
     Chunk* operator->() { return &mSegment.mChunks[mIndex]; }
   private:
     MediaSegmentBase<C, Chunk>& mSegment;
     uint32_t mIndex;
@@ -252,17 +252,17 @@ public:
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
 protected:
-  MediaSegmentBase(Type aType) : MediaSegment(aType) {}
+  explicit MediaSegmentBase(Type aType) : MediaSegment(aType) {}
 
   /**
    * Appends the contents of aSource to this segment, clearing aSource.
    */
   void AppendFromInternal(MediaSegmentBase<C, Chunk>* aSource)
   {
     MOZ_ASSERT(aSource->mDuration >= 0);
     mDuration += aSource->mDuration;
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -1443,17 +1443,17 @@ MediaStreamGraphImpl::ForceShutDown()
     CurrentDriver()->EnsureNextIterationLocked();
   }
 }
 
 namespace {
 
 class MediaStreamGraphShutDownRunnable : public nsRunnable {
 public:
-  MediaStreamGraphShutDownRunnable(MediaStreamGraphImpl* aGraph)
+  explicit MediaStreamGraphShutDownRunnable(MediaStreamGraphImpl* aGraph)
     : mGraph(aGraph)
   {}
   NS_IMETHOD Run()
   {
     NS_ASSERTION(mGraph->mDetectedNotRunning,
                  "We should know the graph thread control loop isn't running!");
 
     STREAM_LOG(PR_LOG_DEBUG, ("Shutting down graph %p", mGraph.get()));
@@ -1511,17 +1511,17 @@ private:
   bool mSourceIsMSG;
 };
 
 /*
  * Control messages forwarded from main thread to graph manager thread
  */
 class CreateMessage : public ControlMessage {
 public:
-  CreateMessage(MediaStream* aStream) : ControlMessage(aStream) {}
+  explicit CreateMessage(MediaStream* aStream) : ControlMessage(aStream) {}
   virtual void Run() MOZ_OVERRIDE
   {
     mStream->GraphImpl()->AddStream(mStream);
     mStream->Init();
   }
   virtual void RunDuringShutdown() MOZ_OVERRIDE
   {
     // Make sure to run this message during shutdown too, to make sure
@@ -1901,17 +1901,17 @@ MediaStream::DestroyImpl()
 void
 MediaStream::Destroy()
 {
   // Keep this stream alive until we leave this method
   nsRefPtr<MediaStream> kungFuDeathGrip = this;
 
   class Message : public ControlMessage {
   public:
-    Message(MediaStream* aStream) : ControlMessage(aStream) {}
+    explicit Message(MediaStream* aStream) : ControlMessage(aStream) {}
     virtual void Run()
     {
       mStream->RemoveAllListenersImpl();
       auto graph = mStream->GraphImpl();
       mStream->DestroyImpl();
       graph->RemoveStream(mStream);
     }
     virtual void RunDuringShutdown()
@@ -2526,17 +2526,17 @@ MediaInputPort::GetNextInputInterval(Gra
   return result;
 }
 
 void
 MediaInputPort::Destroy()
 {
   class Message : public ControlMessage {
   public:
-    Message(MediaInputPort* aPort)
+    explicit Message(MediaInputPort* aPort)
       : ControlMessage(nullptr), mPort(aPort) {}
     virtual void Run()
     {
       mPort->Disconnect();
       --mPort->GraphImpl()->mPortCount;
       mPort->SetGraphImpl(nullptr);
       NS_RELEASE(mPort);
     }
@@ -2571,17 +2571,17 @@ MediaInputPort::SetGraphImpl(MediaStream
 already_AddRefed<MediaInputPort>
 ProcessedMediaStream::AllocateInputPort(MediaStream* aStream, uint32_t aFlags,
                                         uint16_t aInputNumber, uint16_t aOutputNumber)
 {
   // This method creates two references to the MediaInputPort: one for
   // the main thread, and one for the MediaStreamGraph.
   class Message : public ControlMessage {
   public:
-    Message(MediaInputPort* aPort)
+    explicit Message(MediaInputPort* aPort)
       : ControlMessage(aPort->GetDestination()),
         mPort(aPort) {}
     virtual void Run()
     {
       mPort->Init();
       // The graph holds its reference implicitly
       mPort->GraphImpl()->SetStreamOrderDirty();
       unused << mPort.forget();
@@ -2599,17 +2599,17 @@ ProcessedMediaStream::AllocateInputPort(
   return port.forget();
 }
 
 void
 ProcessedMediaStream::Finish()
 {
   class Message : public ControlMessage {
   public:
-    Message(ProcessedMediaStream* aStream)
+    explicit Message(ProcessedMediaStream* aStream)
       : ControlMessage(aStream) {}
     virtual void Run()
     {
       mStream->GraphImpl()->FinishStream(mStream);
     }
   };
   GraphImpl()->AppendMessage(new Message(this));
 }
@@ -2771,17 +2771,17 @@ MediaStreamGraph::DestroyNonRealtimeInst
   }
   graph->ForceShutDown();
 }
 
 NS_IMPL_ISUPPORTS(MediaStreamGraphImpl, nsIMemoryReporter)
 
 struct ArrayClearer
 {
-  ArrayClearer(nsTArray<AudioNodeSizes>& aArray) : mArray(aArray) {}
+  explicit ArrayClearer(nsTArray<AudioNodeSizes>& aArray) : mArray(aArray) {}
   ~ArrayClearer() { mArray.Clear(); }
   nsTArray<AudioNodeSizes>& mArray;
 };
 
 NS_IMETHODIMP
 MediaStreamGraphImpl::CollectReports(nsIHandleReportCallback* aHandleReport,
                                      nsISupports* aData, bool aAnonymize)
 {
--- a/content/media/MediaStreamGraph.h
+++ b/content/media/MediaStreamGraph.h
@@ -305,17 +305,17 @@ struct AudioChunk;
  * collected via cycle collection. Destroy messages will be sent
  * for those objects in arbitrary order and the MediaStreamGraph has to be able
  * to handle this.
  */
 class MediaStream : public mozilla::LinkedListElement<MediaStream> {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStream)
 
-  MediaStream(DOMMediaStream* aWrapper);
+  explicit MediaStream(DOMMediaStream* aWrapper);
 
 protected:
   // Protected destructor, to discourage deletion outside of Release():
   virtual ~MediaStream()
   {
     MOZ_COUNT_DTOR(MediaStream);
     NS_ASSERTION(mMainThreadDestroyed, "Should have been destroyed already");
     NS_ASSERTION(mMainThreadListeners.IsEmpty(),
@@ -575,17 +575,17 @@ protected:
   StreamBuffer mBuffer;
   // The time when the buffered data could be considered to have started playing.
   // This increases over time to account for time the stream was blocked before
   // mCurrentTime.
   GraphTime mBufferStartTime;
 
   // Client-set volume of this stream
   struct AudioOutput {
-    AudioOutput(void* aKey) : mKey(aKey), mVolume(1.0f) {}
+    explicit AudioOutput(void* aKey) : mKey(aKey), mVolume(1.0f) {}
     void* mKey;
     float mVolume;
   };
   nsTArray<AudioOutput> mAudioOutputs;
   nsTArray<nsRefPtr<VideoFrameContainer> > mVideoOutputs;
   // We record the last played video frame to avoid redundant setting
   // of the current video frame.
   VideoFrame mLastPlayedVideoFrame;
@@ -677,17 +677,17 @@ protected:
 /**
  * This is a stream into which a decoder can write audio and video.
  *
  * Audio and video can be written on any thread, but you probably want to
  * always write from the same thread to avoid unexpected interleavings.
  */
 class SourceMediaStream : public MediaStream {
 public:
-  SourceMediaStream(DOMMediaStream* aWrapper) :
+  explicit SourceMediaStream(DOMMediaStream* aWrapper) :
     MediaStream(aWrapper),
     mLastConsumptionState(MediaStreamListener::NOT_CONSUMED),
     mMutex("mozilla::media::SourceMediaStream"),
     mUpdateKnownTracksTime(0),
     mPullEnabled(false),
     mUpdateFinished(false)
   {}
 
@@ -1009,17 +1009,17 @@ private:
 
 /**
  * This stream processes zero or more input streams in parallel to produce
  * its output. The details of how the output is produced are handled by
  * subclasses overriding the ProcessInput method.
  */
 class ProcessedMediaStream : public MediaStream {
 public:
-  ProcessedMediaStream(DOMMediaStream* aWrapper)
+  explicit ProcessedMediaStream(DOMMediaStream* aWrapper)
     : MediaStream(aWrapper), mAutofinish(false)
   {}
 
   // Control API.
   /**
    * Allocates a new input port attached to source aStream.
    * This stream can be removed by calling MediaInputPort::Remove().
    */
--- a/content/media/MediaTaskQueue.cpp
+++ b/content/media/MediaTaskQueue.cpp
@@ -57,17 +57,17 @@ MediaTaskQueue::DispatchLocked(Temporary
   }
   mIsRunning = true;
 
   return NS_OK;
 }
 
 class MediaTaskQueueSyncRunnable : public nsRunnable {
 public:
-  MediaTaskQueueSyncRunnable(TemporaryRef<nsIRunnable> aRunnable)
+  explicit MediaTaskQueueSyncRunnable(TemporaryRef<nsIRunnable> aRunnable)
     : mRunnable(aRunnable)
     , mMonitor("MediaTaskQueueSyncRunnable")
     , mDone(false)
   {
   }
 
   NS_IMETHOD Run() {
     nsresult rv = mRunnable->Run();
--- a/content/media/MediaTaskQueue.h
+++ b/content/media/MediaTaskQueue.h
@@ -24,17 +24,17 @@ class SharedThreadPool;
 // They may be executed on different threads, and a memory barrier is used
 // to make this threadsafe for objects that aren't already threadsafe.
 class MediaTaskQueue MOZ_FINAL {
   ~MediaTaskQueue();
 
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaTaskQueue)
 
-  MediaTaskQueue(TemporaryRef<SharedThreadPool> aPool);
+  explicit MediaTaskQueue(TemporaryRef<SharedThreadPool> aPool);
 
   nsresult Dispatch(TemporaryRef<nsIRunnable> aRunnable);
 
   nsresult SyncDispatch(TemporaryRef<nsIRunnable> aRunnable);
 
   nsresult FlushAndDispatch(TemporaryRef<nsIRunnable> aRunnable);
 
   // Removes all pending tasks from the task queue, and blocks until
@@ -84,17 +84,17 @@ private:
   bool mIsRunning;
 
   // True if we've started our shutdown process.
   bool mIsShutdown;
 
   class MOZ_STACK_CLASS AutoSetFlushing
   {
   public:
-    AutoSetFlushing(MediaTaskQueue* aTaskQueue) : mTaskQueue(aTaskQueue)
+    explicit AutoSetFlushing(MediaTaskQueue* aTaskQueue) : mTaskQueue(aTaskQueue)
     {
       mTaskQueue->mQueueMonitor.AssertCurrentThreadOwns();
       mTaskQueue->mIsFlushing = true;
     }
     ~AutoSetFlushing()
     {
       mTaskQueue->mQueueMonitor.AssertCurrentThreadOwns();
       mTaskQueue->mIsFlushing = false;
@@ -104,17 +104,17 @@ private:
     MediaTaskQueue* mTaskQueue;
   };
 
   // True if we're flushing; we reject new tasks if we're flushing.
   bool mIsFlushing;
 
   class Runner : public nsRunnable {
   public:
-    Runner(MediaTaskQueue* aQueue)
+    explicit Runner(MediaTaskQueue* aQueue)
       : mQueue(aQueue)
     {
     }
     NS_METHOD Run() MOZ_OVERRIDE;
   private:
     RefPtr<MediaTaskQueue> mQueue;
   };
 };
--- a/content/media/MediaTrackList.h
+++ b/content/media/MediaTrackList.h
@@ -23,17 +23,17 @@ class MediaTrackList;
 /**
  * This is for the media resource to notify its audio track and video track,
  * when a media-resource-specific track has ended, or whether it has enabled or
  * not. All notification methods are called from the main thread.
  */
 class MediaTrackListListener
 {
 public:
-  MediaTrackListListener(MediaTrackList* aMediaTrackList)
+  explicit MediaTrackListListener(MediaTrackList* aMediaTrackList)
     : mMediaTrackList(aMediaTrackList) {};
 
   ~MediaTrackListListener()
   {
     mMediaTrackList = nullptr;
   };
 
   // Notify mMediaTrackList that a track has created by the media resource,
--- a/content/media/RtspMediaResource.h
+++ b/content/media/RtspMediaResource.h
@@ -201,17 +201,17 @@ public:
   // It holds RtspMediaResource reference to notify the connection status and
   // data arrival. The Revoke function releases the reference when
   // RtspMediaResource::OnDisconnected is called.
   class Listener MOZ_FINAL : public nsIInterfaceRequestor,
                              public nsIStreamingProtocolListener
   {
     ~Listener() {}
   public:
-    Listener(RtspMediaResource* aResource) : mResource(aResource) {}
+    explicit Listener(RtspMediaResource* aResource) : mResource(aResource) {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIINTERFACEREQUESTOR
     NS_DECL_NSISTREAMINGPROTOCOLLISTENER
 
     void Revoke();
 
   private:
--- a/content/media/StreamBuffer.h
+++ b/content/media/StreamBuffer.h
@@ -279,17 +279,17 @@ public:
 
   Track* FindTrack(TrackID aID);
 
   class TrackIter {
   public:
     /**
      * Iterate through the tracks of aBuffer in order of ID.
      */
-    TrackIter(const StreamBuffer& aBuffer) :
+    explicit TrackIter(const StreamBuffer& aBuffer) :
       mBuffer(&aBuffer.mTracks), mIndex(0), mMatchType(false) {}
     /**
      * Iterate through the tracks of aBuffer with type aType, in order of ID.
      */
     TrackIter(const StreamBuffer& aBuffer, MediaSegment::Type aType) :
       mBuffer(&aBuffer.mTracks), mIndex(0), mType(aType), mMatchType(true) { FindMatch(); }
     bool IsEnded() { return mIndex >= mBuffer->Length(); }
     void Next()
--- a/content/media/TextTrackCueList.h
+++ b/content/media/TextTrackCueList.h
@@ -21,17 +21,17 @@ class TextTrackCue;
 class TextTrackCueList MOZ_FINAL : public nsISupports
                                  , public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextTrackCueList)
 
   // TextTrackCueList WebIDL
-  TextTrackCueList(nsISupports* aParent);
+  explicit TextTrackCueList(nsISupports* aParent);
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   nsISupports* GetParentObject() const
   {
     return mParent;
   }
 
--- a/content/media/TextTrackList.h
+++ b/content/media/TextTrackList.h
@@ -21,17 +21,17 @@ class TrackEvent;
 class TrackEventRunner;
 
 class TextTrackList MOZ_FINAL : public DOMEventTargetHelper
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TextTrackList, DOMEventTargetHelper)
 
-  TextTrackList(nsPIDOMWindow* aOwnerWindow);
+  explicit TextTrackList(nsPIDOMWindow* aOwnerWindow);
   TextTrackList(nsPIDOMWindow* aOwnerWindow, TextTrackManager* aTextTrackManager);
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   uint32_t Length() const
   {
     return mTextTracks.Length();
   }
--- a/content/media/TextTrackRegion.h
+++ b/content/media/TextTrackRegion.h
@@ -37,17 +37,17 @@ public:
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   nsISupports* GetParentObject() const
   {
     return mParent;
   }
 
-  TextTrackRegion(nsISupports* aGlobal);
+  explicit TextTrackRegion(nsISupports* aGlobal);
 
   /** WebIDL Methods. */
 
   static already_AddRefed<TextTrackRegion>
   Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
 
   double Lines() const
   {
--- a/content/media/TimeVarying.h
+++ b/content/media/TimeVarying.h
@@ -46,17 +46,17 @@ protected:
  * new value for each change time. This is a simple but dumb implementation.
  * We maintain the invariant that each change entry in the array must have
  * a different value to the value in the previous change entry (or, for
  * the first change entry, mCurrent).
  */
 template <typename Time, typename T, uint32_t ReservedChanges>
 class TimeVarying : public TimeVaryingBase {
 public:
-  TimeVarying(const T& aInitial) : mCurrent(aInitial) {}
+  explicit TimeVarying(const T& aInitial) : mCurrent(aInitial) {}
   /**
    * This constructor can only be called if mCurrent has a no-argument
    * constructor.
    */
   TimeVarying() : mCurrent() {}
 
   /**
    * Sets the value for all times >= aTime to aValue.
--- a/content/media/TrackUnionStream.h
+++ b/content/media/TrackUnionStream.h
@@ -19,17 +19,17 @@ namespace mozilla {
 
 /**
  * See MediaStreamGraph::CreateTrackUnionStream.
  * This file is only included by MediaStreamGraph.cpp so it's OK to put the
  * entire implementation in this header file.
  */
 class TrackUnionStream : public ProcessedMediaStream {
 public:
-  TrackUnionStream(DOMMediaStream* aWrapper) :
+  explicit TrackUnionStream(DOMMediaStream* aWrapper) :
     ProcessedMediaStream(aWrapper),
     mFilterCallback(nullptr)
   {}
 
   virtual void RemoveInput(MediaInputPort* aPort) MOZ_OVERRIDE
   {
     for (int32_t i = mTrackMap.Length() - 1; i >= 0; --i) {
       if (mTrackMap[i].mInputPort == aPort) {
--- a/content/media/VideoUtils.h
+++ b/content/media/VideoUtils.h
@@ -77,31 +77,31 @@ private:
 
   ReentrantMonitor* mReentrantMonitor;
 };
 
 // Shuts down a thread asynchronously.
 class ShutdownThreadEvent : public nsRunnable
 {
 public:
-  ShutdownThreadEvent(nsIThread* aThread) : mThread(aThread) {}
+  explicit ShutdownThreadEvent(nsIThread* aThread) : mThread(aThread) {}
   ~ShutdownThreadEvent() {}
   NS_IMETHOD Run() MOZ_OVERRIDE {
     mThread->Shutdown();
     mThread = nullptr;
     return NS_OK;
   }
 private:
   nsCOMPtr<nsIThread> mThread;
 };
 
 template<class T>
 class DeleteObjectTask: public nsRunnable {
 public:
-  DeleteObjectTask(nsAutoPtr<T>& aObject)
+  explicit DeleteObjectTask(nsAutoPtr<T>& aObject)
     : mObject(aObject)
   {
   }
   NS_IMETHOD Run() {
     NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
     mObject = nullptr;
     return NS_OK;
   }
--- a/content/media/WebVTTListener.h
+++ b/content/media/WebVTTListener.h
@@ -31,17 +31,17 @@ class WebVTTListener MOZ_FINAL : public 
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSICHANNELEVENTSINK
   NS_DECL_NSIINTERFACEREQUESTOR
 
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(WebVTTListener,
                                            nsIStreamListener)
 
 public:
-  WebVTTListener(HTMLTrackElement* aElement);
+  explicit WebVTTListener(HTMLTrackElement* aElement);
 
   /**
    * Loads the WebVTTListener. Must call this in order for the listener to be
    * ready to parse data that is passed to it.
    */
   nsresult LoadResource();
 
 private:
--- a/content/media/apple/AppleMP3Reader.h
+++ b/content/media/apple/AppleMP3Reader.h
@@ -11,17 +11,17 @@
 
 #include <AudioToolbox/AudioToolbox.h>
 
 namespace mozilla {
 
 class AppleMP3Reader : public MediaDecoderReader
 {
 public:
-  AppleMP3Reader(AbstractMediaDecoder *aDecoder);
+  explicit AppleMP3Reader(AbstractMediaDecoder *aDecoder);
   virtual ~AppleMP3Reader() MOZ_OVERRIDE;
 
   virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
 
   nsresult PushDataToDemuxer();
 
   virtual bool DecodeAudioData() MOZ_OVERRIDE;
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
--- a/content/media/eme/CDMProxy.h
+++ b/content/media/eme/CDMProxy.h
@@ -243,17 +243,17 @@ private:
   };
 
   ~CDMProxy();
 
   // Helper to enforce that a raw pointer is only accessed on the main thread.
   template<class Type>
   class MainThreadOnlyRawPtr {
   public:
-    MainThreadOnlyRawPtr(Type* aPtr)
+    explicit MainThreadOnlyRawPtr(Type* aPtr)
       : mPtr(aPtr)
     {
       MOZ_ASSERT(NS_IsMainThread());
     }
 
     bool IsNull() const {
       MOZ_ASSERT(NS_IsMainThread());
       return !mPtr;
--- a/content/media/eme/MediaEncryptedEvent.h
+++ b/content/media/eme/MediaEncryptedEvent.h
@@ -24,17 +24,17 @@ namespace dom {
 
 class MediaEncryptedEvent MOZ_FINAL : public Event
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MediaEncryptedEvent, Event)
 protected:
   virtual ~MediaEncryptedEvent();
-  MediaEncryptedEvent(EventTarget* aOwner);
+  explicit MediaEncryptedEvent(EventTarget* aOwner);
 
   nsString mInitDataType;
   JS::Heap<JSObject*> mInitData;
 
 public:
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
--- a/content/media/fmp4/MP4Reader.h
+++ b/content/media/fmp4/MP4Reader.h
@@ -24,17 +24,17 @@ class TimeRanges;
 
 typedef std::deque<mp4_demuxer::MP4Sample*> MP4SampleQueue;
 
 class MP4Stream;
 
 class MP4Reader : public MediaDecoderReader
 {
 public:
-  MP4Reader(AbstractMediaDecoder* aDecoder);
+  explicit MP4Reader(AbstractMediaDecoder* aDecoder);
 
   virtual ~MP4Reader();
 
   virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
 
   virtual bool DecodeAudioData() MOZ_OVERRIDE;
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
                                 int64_t aTimeThreshold) MOZ_OVERRIDE;
--- a/content/media/gmp/GMPAudioDecoderChild.h
+++ b/content/media/gmp/GMPAudioDecoderChild.h
@@ -14,17 +14,17 @@ namespace mozilla {
 namespace gmp {
 
 class GMPChild;
 
 class GMPAudioDecoderChild : public PGMPAudioDecoderChild,
                              public GMPAudioDecoderCallback
 {
 public:
-  GMPAudioDecoderChild(GMPChild* aPlugin);
+  explicit GMPAudioDecoderChild(GMPChild* aPlugin);
   virtual ~GMPAudioDecoderChild();
 
   void Init(GMPAudioDecoder* aDecoder);
   GMPAudioHostImpl& Host();
 
   // GMPAudioDecoderCallback
   virtual void Decoded(GMPAudioSamples* aEncodedSamples) MOZ_OVERRIDE;
   virtual void InputDataExhausted() MOZ_OVERRIDE;
--- a/content/media/gmp/GMPAudioDecoderParent.h
+++ b/content/media/gmp/GMPAudioDecoderParent.h
@@ -19,17 +19,17 @@ namespace gmp {
 class GMPParent;
 
 class GMPAudioDecoderParent MOZ_FINAL : public GMPAudioDecoderProxy
                                       , public PGMPAudioDecoderParent
 {
 public:
   NS_INLINE_DECL_REFCOUNTING(GMPAudioDecoderParent)
 
-  GMPAudioDecoderParent(GMPParent *aPlugin);
+  explicit GMPAudioDecoderParent(GMPParent *aPlugin);
 
   nsresult Shutdown();
 
   // GMPAudioDecoderProxy
   virtual nsresult InitDecode(GMPAudioCodecType aCodecType,
                               uint32_t aChannelCount,
                               uint32_t aBitsPerChannel,
                               uint32_t aSamplesPerSecond,
--- a/content/media/gmp/GMPAudioHost.h
+++ b/content/media/gmp/GMPAudioHost.h
@@ -15,18 +15,18 @@
 #include "GMPEncryptedBufferDataImpl.h"
 #include "mozilla/gmp/GMPTypes.h"
 
 namespace mozilla {
 namespace gmp {
 
 class GMPAudioSamplesImpl : public GMPAudioSamples {
 public:
-  GMPAudioSamplesImpl(GMPAudioFormat aFormat);
-  GMPAudioSamplesImpl(const GMPAudioEncodedSampleData& aData);
+  explicit GMPAudioSamplesImpl(GMPAudioFormat aFormat);
+  explicit GMPAudioSamplesImpl(const GMPAudioEncodedSampleData& aData);
   GMPAudioSamplesImpl(mp4_demuxer::MP4Sample* aSample,
                       uint32_t aChannels,
                       uint32_t aRate);
   virtual ~GMPAudioSamplesImpl();
 
   virtual GMPAudioFormat GetFormat() MOZ_OVERRIDE;
   virtual void Destroy() MOZ_OVERRIDE;
   virtual GMPErr SetBufferSize(uint32_t aSize) MOZ_OVERRIDE;
--- a/content/media/gmp/GMPDecryptorChild.h
+++ b/content/media/gmp/GMPDecryptorChild.h
@@ -16,17 +16,17 @@ namespace gmp {
 
 class GMPChild;
 
 class GMPDecryptorChild : public GMPDecryptorCallback
                         , public GMPDecryptorHost
                         , public PGMPDecryptorChild
 {
 public:
-  GMPDecryptorChild(GMPChild* aPlugin);
+  explicit GMPDecryptorChild(GMPChild* aPlugin);
   ~GMPDecryptorChild();
 
   void Init(GMPDecryptor* aSession);
 
   // GMPDecryptorCallback
   virtual void ResolveNewSessionPromise(uint32_t aPromiseId,
                                         const char* aSessionId,
                                         uint32_t aSessionIdLength) MOZ_OVERRIDE;
--- a/content/media/gmp/GMPDecryptorParent.h
+++ b/content/media/gmp/GMPDecryptorParent.h
@@ -20,17 +20,17 @@ namespace gmp {
 class GMPParent;
 
 class GMPDecryptorParent MOZ_FINAL : public GMPDecryptorProxy
                                    , public PGMPDecryptorParent
 {
 public:
   NS_INLINE_DECL_REFCOUNTING(GMPDecryptorParent)
 
-  GMPDecryptorParent(GMPParent *aPlugin);
+  explicit GMPDecryptorParent(GMPParent *aPlugin);
 
   // GMPDecryptorProxy
   virtual nsresult Init(GMPDecryptorProxyCallback* aCallback) MOZ_OVERRIDE;
 
   virtual void CreateSession(uint32_t aPromiseId,
                              const nsCString& aInitDataType,
                              const nsTArray<uint8_t>& aInitData,
                              GMPSessionType aSessionType) MOZ_OVERRIDE;
--- a/content/media/gmp/GMPEncryptedBufferDataImpl.h
+++ b/content/media/gmp/GMPEncryptedBufferDataImpl.h
@@ -13,18 +13,18 @@
 
 namespace mozilla {
 namespace gmp {
 
 class GMPEncryptedBufferDataImpl : public GMPEncryptedBufferMetadata {
 private:
   typedef mp4_demuxer::CryptoSample CryptoSample;
 public:
-  GMPEncryptedBufferDataImpl(const CryptoSample& aCrypto);
-  GMPEncryptedBufferDataImpl(const GMPDecryptionData& aData);
+  explicit GMPEncryptedBufferDataImpl(const CryptoSample& aCrypto);
+  explicit GMPEncryptedBufferDataImpl(const GMPDecryptionData& aData);
   virtual ~GMPEncryptedBufferDataImpl();
 
   void RelinquishData(GMPDecryptionData& aData);
 
   virtual const uint8_t* KeyId() const MOZ_OVERRIDE;
   virtual uint32_t KeyIdSize() const MOZ_OVERRIDE;
   virtual const uint8_t* IV() const MOZ_OVERRIDE;
   virtual uint32_t IVSize() const MOZ_OVERRIDE;
--- a/content/media/gmp/GMPPlatform.cpp
+++ b/content/media/gmp/GMPPlatform.cpp
@@ -24,17 +24,17 @@ IsOnChildMainThread()
 }
 
 // We just need a refcounted wrapper for GMPTask objects.
 class Runnable MOZ_FINAL
 {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Runnable)
 
-  Runnable(GMPTask* aTask)
+  explicit Runnable(GMPTask* aTask)
   : mTask(aTask)
   {
     MOZ_ASSERT(mTask);
   }
 
   void Run()
   {
     mTask->Run();
--- a/content/media/gmp/GMPProcessChild.h
+++ b/content/media/gmp/GMPProcessChild.h
@@ -12,17 +12,17 @@
 namespace mozilla {
 namespace gmp {
 
 class GMPProcessChild MOZ_FINAL : public mozilla::ipc::ProcessChild {
 protected:
   typedef mozilla::ipc::ProcessChild ProcessChild;
 
 public:
-  GMPProcessChild(ProcessHandle parentHandle);
+  explicit GMPProcessChild(ProcessHandle parentHandle);
   ~GMPProcessChild();
 
   virtual bool Init() MOZ_OVERRIDE;
   virtual void CleanUp() MOZ_OVERRIDE;
 
 private:
   GMPChild mPlugin;
 
--- a/content/media/gmp/GMPProcessParent.h
+++ b/content/media/gmp/GMPProcessParent.h
@@ -17,17 +17,17 @@
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 
 namespace mozilla {
 namespace gmp {
 
 class GMPProcessParent MOZ_FINAL : public mozilla::ipc::GeckoChildProcessHost
 {
 public:
-  GMPProcessParent(const std::string& aGMPPath);
+  explicit GMPProcessParent(const std::string& aGMPPath);
   ~GMPProcessParent();
 
   // Synchronously launch the plugin process. If the process fails to launch
   // after timeoutMs, this method will return false.
   bool Launch(int32_t aTimeoutMs);
 
   void Delete();
 
--- a/content/media/gmp/GMPService.h
+++ b/content/media/gmp/GMPService.h
@@ -5,16 +5,17 @@
 
 #ifndef GMPService_h_
 #define GMPService_h_
 
 #include "nsString.h"
 #include "mozIGeckoMediaPluginService.h"
 #include "nsIObserver.h"
 #include "nsTArray.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/Monitor.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsIThread.h"
 #include "nsThreadUtils.h"
 #include "nsITimer.h"
 
 template <class> struct already_AddRefed;
@@ -88,17 +89,17 @@ private:
   nsTArray<nsRefPtr<GMPParent>> mPlugins;
   nsCOMPtr<nsIThread> mGMPThread;
   bool mShuttingDown;
   bool mShuttingDownOnGMPThread;
 
   template<typename T>
   class MainThreadOnly {
   public:
-    MainThreadOnly(T aValue)
+    MOZ_IMPLICIT MainThreadOnly(T aValue)
       : mValue(aValue)
     {}
     operator T&() {
       MOZ_ASSERT(NS_IsMainThread());
       return mValue;
     }
 
   private:
--- a/content/media/gmp/GMPSharedMemManager.h
+++ b/content/media/gmp/GMPSharedMemManager.h
@@ -46,17 +46,17 @@ protected:
 
   nsTArray<ipc::Shmem> mGmpFreelist[GMPSharedMem::kGMPNumTypes];
   uint32_t mGmpAllocated[GMPSharedMem::kGMPNumTypes];
 };
 
 class GMPSharedMemManager
 {
 public:
-  GMPSharedMemManager(GMPSharedMem *aData) : mData(aData) {}
+  explicit GMPSharedMemManager(GMPSharedMem *aData) : mData(aData) {}
   virtual ~GMPSharedMemManager() {}
 
   virtual bool MgrAllocShmem(GMPSharedMem::GMPMemoryClasses aClass, size_t aSize,
                              ipc::Shmem::SharedMemory::SharedMemoryType aType,
                              ipc::Shmem* aMem);
   virtual bool MgrDeallocShmem(GMPSharedMem::GMPMemoryClasses aClass, ipc::Shmem& aMem);
 
   // So we can know if data is "piling up" for the plugin - I.e. it's hung or crashed
--- a/content/media/gmp/GMPStorageChild.h
+++ b/content/media/gmp/GMPStorageChild.h
@@ -49,17 +49,17 @@ private:
   bool mIsClosed;
 };
 
 class GMPStorageChild : public PGMPStorageChild
 {
 public:
   NS_INLINE_DECL_REFCOUNTING(GMPStorageChild)
 
-  GMPStorageChild(GMPChild* aPlugin);
+  explicit GMPStorageChild(GMPChild* aPlugin);
 
   GMPErr CreateRecord(const nsCString& aRecordName,
                       GMPRecord** aOutRecord,
                       GMPRecordClient* aClient);
 
   GMPErr Open(GMPRecordImpl* aRecord);
 
   GMPErr Read(GMPRecordImpl* aRecord);
--- a/content/media/gmp/GMPTimerChild.h
+++ b/content/media/gmp/GMPTimerChild.h
@@ -18,17 +18,17 @@ namespace gmp {
 
 class GMPChild;
 
 class GMPTimerChild : public PGMPTimerChild
 {
 public:
   NS_INLINE_DECL_REFCOUNTING(GMPTimerChild)
 
-  GMPTimerChild(GMPChild* aPlugin);
+  explicit GMPTimerChild(GMPChild* aPlugin);
 
   GMPErr SetTimer(GMPTask* aTask, int64_t aTimeoutMS);
 
 protected:
   // GMPTimerChild
   virtual bool RecvTimerExpired(const uint32_t& aTimerId) MOZ_OVERRIDE;
 
 private:
--- a/content/media/gmp/GMPTimerParent.h
+++ b/content/media/gmp/GMPTimerParent.h
@@ -16,17 +16,17 @@
 #include "nsIThread.h"
 
 namespace mozilla {
 namespace gmp {
 
 class GMPTimerParent : public PGMPTimerParent {
 public:
   NS_INLINE_DECL_REFCOUNTING(GMPTimerParent)
-  GMPTimerParent(nsIThread* aGMPThread);
+  explicit GMPTimerParent(nsIThread* aGMPThread);
 
   void Shutdown();
 
 protected:
   virtual bool RecvSetTimer(const uint32_t& aTimerId,
                             const uint32_t& aTimeoutMs) MOZ_OVERRIDE;
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
--- a/content/media/gmp/GMPVideoDecoderChild.h
+++ b/content/media/gmp/GMPVideoDecoderChild.h
@@ -18,17 +18,17 @@ namespace gmp {
 
 class GMPChild;
 
 class GMPVideoDecoderChild : public PGMPVideoDecoderChild,
                              public GMPVideoDecoderCallback,
                              public GMPSharedMemManager
 {
 public:
-  GMPVideoDecoderChild(GMPChild* aPlugin);
+  explicit GMPVideoDecoderChild(GMPChild* aPlugin);
   virtual ~GMPVideoDecoderChild();
 
   void Init(GMPVideoDecoder* aDecoder);
   GMPVideoHostImpl& Host();
 
   // GMPVideoDecoderCallback
   virtual void Decoded(GMPVideoi420Frame* decodedFrame) MOZ_OVERRIDE;
   virtual void ReceivedDecodedReferenceFrame(const uint64_t pictureId) MOZ_OVERRIDE;
--- a/content/media/gmp/GMPVideoDecoderParent.h
+++ b/content/media/gmp/GMPVideoDecoderParent.h
@@ -21,17 +21,17 @@ class GMPParent;
 
 class GMPVideoDecoderParent MOZ_FINAL : public PGMPVideoDecoderParent
                                       , public GMPVideoDecoderProxy
                                       , public GMPSharedMemManager
 {
 public:
   NS_INLINE_DECL_REFCOUNTING(GMPVideoDecoderParent)
 
-  GMPVideoDecoderParent(GMPParent *aPlugin);
+  explicit GMPVideoDecoderParent(GMPParent *aPlugin);
 
   GMPVideoHostImpl& Host();
   nsresult Shutdown();
 
   // GMPVideoDecoder
   virtual void Close() MOZ_OVERRIDE;
   virtual nsresult InitDecode(const GMPVideoCodec& aCodecSettings,
                               const nsTArray<uint8_t>& aCodecSpecific,
--- a/content/media/gmp/GMPVideoEncodedFrameImpl.h
+++ b/content/media/gmp/GMPVideoEncodedFrameImpl.h
@@ -45,17 +45,17 @@ namespace gmp {
 class GMPVideoHostImpl;
 class GMPVideoEncodedFrameData;
 class GMPEncryptedBufferDataImpl;
 
 class GMPVideoEncodedFrameImpl: public GMPVideoEncodedFrame
 {
   friend struct IPC::ParamTraits<mozilla::gmp::GMPVideoEncodedFrameImpl>;
 public:
-  GMPVideoEncodedFrameImpl(GMPVideoHostImpl* aHost);
+  explicit GMPVideoEncodedFrameImpl(GMPVideoHostImpl* aHost);
   GMPVideoEncodedFrameImpl(const GMPVideoEncodedFrameData& aFrameData, GMPVideoHostImpl* aHost);
   virtual ~GMPVideoEncodedFrameImpl();
 
   void InitCrypto(const mp4_demuxer::CryptoSample& aCrypto);
 
   // This is called during a normal destroy sequence, which is
   // when a consumer is finished or during XPCOM shutdown.
   void DoneWithAPI();
--- a/content/media/gmp/GMPVideoEncoderChild.h
+++ b/content/media/gmp/GMPVideoEncoderChild.h
@@ -17,17 +17,17 @@ namespace gmp {
 
 class GMPChild;
 
 class GMPVideoEncoderChild : public PGMPVideoEncoderChild,
                              public GMPVideoEncoderCallback,
                              public GMPSharedMemManager
 {
 public:
-  GMPVideoEncoderChild(GMPChild* aPlugin);
+  explicit GMPVideoEncoderChild(GMPChild* aPlugin);
   virtual ~GMPVideoEncoderChild();
 
   void Init(GMPVideoEncoder* aEncoder);
   GMPVideoHostImpl& Host();
 
   // GMPVideoEncoderCallback
   virtual void Encoded(GMPVideoEncodedFrame* aEncodedFrame,
                        const uint8_t* aCodecSpecificInfo,
--- a/content/media/gmp/GMPVideoEncoderParent.h
+++ b/content/media/gmp/GMPVideoEncoderParent.h
@@ -21,17 +21,17 @@ class GMPParent;
 
 class GMPVideoEncoderParent : public GMPVideoEncoderProxy,
                               public PGMPVideoEncoderParent,
                               public GMPSharedMemManager
 {
 public:
   NS_INLINE_DECL_REFCOUNTING(GMPVideoEncoderParent)
 
-  GMPVideoEncoderParent(GMPParent *aPlugin);
+  explicit GMPVideoEncoderParent(GMPParent *aPlugin);
 
   GMPVideoHostImpl& Host();
   void Shutdown();
 
   // GMPVideoEncoderProxy
   virtual void Close() MOZ_OVERRIDE;
   virtual GMPErr InitEncode(const GMPVideoCodec& aCodecSettings,
                             const nsTArray<uint8_t>& aCodecSpecific,
--- a/content/media/gmp/GMPVideoHost.h
+++ b/content/media/gmp/GMPVideoHost.h
@@ -17,17 +17,17 @@ namespace gmp {
 
 class GMPSharedMemManager;
 class GMPPlaneImpl;
 class GMPVideoEncodedFrameImpl;
 
 class GMPVideoHostImpl : public GMPVideoHost
 {
 public:
-  GMPVideoHostImpl(GMPSharedMemManager* aSharedMemMgr);
+  explicit GMPVideoHostImpl(GMPSharedMemManager* aSharedMemMgr);
   virtual ~GMPVideoHostImpl();
 
   // Used for shared memory allocation and deallocation.
   GMPSharedMemManager* SharedMemMgr();
   void DoneWithAPI();
   void ActorDestroyed();
   void PlaneCreated(GMPPlaneImpl* aPlane);
   void PlaneDestroyed(GMPPlaneImpl* aPlane);
--- a/content/media/gmp/GMPVideoPlaneImpl.h
+++ b/content/media/gmp/GMPVideoPlaneImpl.h
@@ -14,17 +14,17 @@ namespace gmp {
 
 class GMPVideoHostImpl;
 class GMPPlaneData;
 
 class GMPPlaneImpl : public GMPPlane
 {
   friend struct IPC::ParamTraits<mozilla::gmp::GMPPlaneImpl>;
 public:
-  GMPPlaneImpl(GMPVideoHostImpl* aHost);
+  explicit GMPPlaneImpl(GMPVideoHostImpl* aHost);
   GMPPlaneImpl(const GMPPlaneData& aPlaneData, GMPVideoHostImpl* aHost);
   virtual ~GMPPlaneImpl();
 
   // This is called during a normal destroy sequence, which is
   // when a consumer is finished or during XPCOM shutdown.
   void DoneWithAPI();
   // This is called when something has gone wrong - specicifically,
   // a child process has crashed. Does not attempt to release Shmem,
--- a/content/media/gmp/GMPVideoi420FrameImpl.h
+++ b/content/media/gmp/GMPVideoi420FrameImpl.h
@@ -15,17 +15,17 @@ namespace mozilla {
 namespace gmp {
 
 class GMPVideoi420FrameData;
 
 class GMPVideoi420FrameImpl : public GMPVideoi420Frame
 {
   friend struct IPC::ParamTraits<mozilla::gmp::GMPVideoi420FrameImpl>;
 public:
-  GMPVideoi420FrameImpl(GMPVideoHostImpl* aHost);
+  explicit GMPVideoi420FrameImpl(GMPVideoHostImpl* aHost);
   GMPVideoi420FrameImpl(const GMPVideoi420FrameData& aFrameData, GMPVideoHostImpl* aHost);
   virtual ~GMPVideoi420FrameImpl();
 
   bool InitFrameData(GMPVideoi420FrameData& aFrameData);
   const GMPPlaneImpl* GetPlane(GMPPlaneType aType) const;
   GMPPlaneImpl* GetPlane(GMPPlaneType aType);
 
   // GMPVideoFrame
--- a/content/media/mediasource/MediaSourceDecoder.h
+++ b/content/media/mediasource/MediaSourceDecoder.h
@@ -26,17 +26,17 @@ namespace dom {
 class HTMLMediaElement;
 class MediaSource;
 
 } // namespace dom
 
 class MediaSourceDecoder : public MediaDecoder
 {
 public:
-  MediaSourceDecoder(dom::HTMLMediaElement* aElement);
+  explicit MediaSourceDecoder(dom::HTMLMediaElement* aElement);
 
   virtual MediaDecoder* Clone() MOZ_OVERRIDE;
   virtual MediaDecoderStateMachine* CreateStateMachine() MOZ_OVERRIDE;
   virtual nsresult Load(nsIStreamListener**, MediaDecoder*) MOZ_OVERRIDE;
   virtual nsresult GetSeekable(dom::TimeRanges* aSeekable) MOZ_OVERRIDE;
 
   virtual void Shutdown() MOZ_OVERRIDE;
 
--- a/content/media/mediasource/MediaSourceReader.cpp
+++ b/content/media/mediasource/MediaSourceReader.cpp
@@ -250,17 +250,17 @@ MediaSourceReader::SwitchReaders(SwitchT
     }
   }
 
   return didSwitch;
 }
 
 class ReleaseDecodersTask : public nsRunnable {
 public:
-  ReleaseDecodersTask(nsTArray<nsRefPtr<SourceBufferDecoder>>& aDecoders)
+  explicit ReleaseDecodersTask(nsTArray<nsRefPtr<SourceBufferDecoder>>& aDecoders)
   {
     mDecoders.SwapElements(aDecoders);
   }
 
   NS_IMETHOD Run() MOZ_OVERRIDE MOZ_FINAL {
     mDecoders.Clear();
     return NS_OK;
   }
@@ -370,17 +370,17 @@ MediaSourceReader::CreateSubDecoder(cons
   }
   mDecoder->NotifyWaitingForResourcesStatusChanged();
   return decoder.forget();
 }
 
 namespace {
 class ChangeToHaveMetadata : public nsRunnable {
 public:
-  ChangeToHaveMetadata(AbstractMediaDecoder* aDecoder) :
+  explicit ChangeToHaveMetadata(AbstractMediaDecoder* aDecoder) :
     mDecoder(aDecoder)
   {
   }
 
   NS_IMETHOD Run() MOZ_OVERRIDE MOZ_FINAL {
     auto owner = mDecoder->GetOwner();
     if (owner) {
       owner->UpdateReadyStateForData(MediaDecoderOwner::NEXT_FRAME_WAIT_FOR_MSE_DATA);
--- a/content/media/mediasource/MediaSourceReader.h
+++ b/content/media/mediasource/MediaSourceReader.h
@@ -24,17 +24,17 @@ namespace dom {
 
 class MediaSource;
 
 } // namespace dom
 
 class MediaSourceReader : public MediaDecoderReader
 {
 public:
-  MediaSourceReader(MediaSourceDecoder* aDecoder);
+  explicit MediaSourceReader(MediaSourceDecoder* aDecoder);
 
   nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE
   {
     // Although we technically don't implement anything here, we return NS_OK
     // so that when the state machine initializes and calls this function
     // we don't return an error code back to the media element.
     return NS_OK;
   }
--- a/content/media/mediasource/SourceBufferResource.h
+++ b/content/media/mediasource/SourceBufferResource.h
@@ -41,17 +41,17 @@ namespace dom {
 
 class SourceBuffer;
 
 }  // namespace dom
 
 class SourceBufferResource MOZ_FINAL : public MediaResource
 {
 public:
-  SourceBufferResource(const nsACString& aType);
+  explicit SourceBufferResource(const nsACString& aType);
   virtual nsresult Close() MOZ_OVERRIDE;
   virtual void Suspend(bool aCloseImmediately) MOZ_OVERRIDE { UNIMPLEMENTED(); }
   virtual void Resume() MOZ_OVERRIDE { UNIMPLEMENTED(); }
   virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() MOZ_OVERRIDE { UNIMPLEMENTED(); return nullptr; }
   virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder) MOZ_OVERRIDE { UNIMPLEMENTED(); return nullptr; }
   virtual void SetReadMode(MediaCacheStream::ReadMode aMode) MOZ_OVERRIDE { UNIMPLEMENTED(); }
   virtual void SetPlaybackRate(uint32_t aBytesPerSecond) MOZ_OVERRIDE { UNIMPLEMENTED(); }
   virtual nsresult Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes) MOZ_OVERRIDE;
--- a/content/media/ogg/OggCodecState.h
+++ b/content/media/ogg/OggCodecState.h
@@ -208,17 +208,17 @@ protected:
   // use the vorbis comment format for metadata.
   static bool AddVorbisComment(MetadataTags* aTags,
                         const char* aComment,
                         uint32_t aLength);
 };
 
 class VorbisState : public OggCodecState {
 public:
-  VorbisState(ogg_page* aBosPage);
+  explicit VorbisState(ogg_page* aBosPage);
   virtual ~VorbisState();
 
   CodecType GetType() { return TYPE_VORBIS; }
   bool DecodeHeader(ogg_packet* aPacket);
   int64_t Time(int64_t granulepos);
   bool Init();
   nsresult Reset();
   bool IsHeader(ogg_packet* aPacket);
@@ -281,17 +281,17 @@ public:
 // version (maj,min,sub) or later, otherwise returns 0.
 int TheoraVersion(th_info* info,
                   unsigned char maj,
                   unsigned char min,
                   unsigned char sub);
 
 class TheoraState : public OggCodecState {
 public:
-  TheoraState(ogg_page* aBosPage);
+  explicit TheoraState(ogg_page* aBosPage);
   virtual ~TheoraState();
 
   CodecType GetType() { return TYPE_THEORA; }
   bool DecodeHeader(ogg_packet* aPacket);
   int64_t Time(int64_t granulepos);
   int64_t StartTime(int64_t granulepos);
   bool Init();
   bool IsHeader(ogg_packet* aPacket);
@@ -320,17 +320,17 @@ private:
   // of all frames in the array. This enables us to determine their timestamps.
   void ReconstructTheoraGranulepos();
 
 };
 
 class OpusState : public OggCodecState {
 #ifdef MOZ_OPUS
 public:
-  OpusState(ogg_page* aBosPage);
+  explicit OpusState(ogg_page* aBosPage);
   virtual ~OpusState();
 
   CodecType GetType() { return TYPE_OPUS; }
   bool DecodeHeader(ogg_packet* aPacket);
   int64_t Time(int64_t aGranulepos);
   bool Init();
   nsresult Reset();
   nsresult Reset(bool aStart);
@@ -379,17 +379,17 @@ private:
 };
 
 // Constructs a 32bit version number out of two 16 bit major,minor
 // version numbers.
 #define SKELETON_VERSION(major, minor) (((major)<<16)|(minor))
 
 class SkeletonState : public OggCodecState {
 public:
-  SkeletonState(ogg_page* aBosPage);
+  explicit SkeletonState(ogg_page* aBosPage);
   ~SkeletonState();
   CodecType GetType() { return TYPE_SKELETON; }
   bool DecodeHeader(ogg_packet* aPacket);
   int64_t Time(int64_t granulepos) { return -1; }
   bool Init() { return true; }
   bool IsHeader(ogg_packet* aPacket) { return true; }
 
   // Return true if the given time (in milliseconds) is within
--- a/content/media/ogg/OggReader.h
+++ b/content/media/ogg/OggReader.h
@@ -43,17 +43,17 @@ class OggCodecStore
 
     // Protects the |mCodecStates| and the |mKnownStreams| members.
     Monitor mMonitor;
 };
 
 class OggReader MOZ_FINAL : public MediaDecoderReader
 {
 public:
-  OggReader(AbstractMediaDecoder* aDecoder);
+  explicit OggReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~OggReader();
 
 public:
   virtual nsresult Init(MediaDecoderReader* aCloneDonor);
   virtual nsresult ResetDecode();
   virtual bool DecodeAudioData();
--- a/content/media/raw/RawReader.h
+++ b/content/media/raw/RawReader.h
@@ -9,17 +9,17 @@
 #include "MediaDecoderReader.h"
 #include "RawStructs.h"
 
 namespace mozilla {
 
 class RawReader : public MediaDecoderReader
 {
 public:
-  RawReader(AbstractMediaDecoder* aDecoder);
+  explicit RawReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~RawReader();
 
 public:
   virtual nsresult Init(MediaDecoderReader* aCloneDonor);
   virtual nsresult ResetDecode();
   virtual bool DecodeAudioData();
--- a/content/media/systemservices/LoadManager.h
+++ b/content/media/systemservices/LoadManager.h
@@ -71,17 +71,17 @@ private:
 
     static StaticRefPtr<LoadManagerSingleton> sSingleton;
 };
 
 class LoadManager MOZ_FINAL : public webrtc::CPULoadStateCallbackInvoker,
                               public webrtc::CpuOveruseObserver
 {
 public:
-    LoadManager(LoadManagerSingleton* aManager)
+    explicit LoadManager(LoadManagerSingleton* aManager)
         : mManager(aManager)
     {}
     ~LoadManager() {}
 
     void AddObserver(webrtc::CPULoadStateObserver * aObserver) MOZ_OVERRIDE
     {
         mManager->AddObserver(aObserver);
     }
--- a/content/media/systemservices/LoadMonitor.cpp
+++ b/content/media/systemservices/LoadMonitor.cpp
@@ -96,17 +96,17 @@ LoadMonitor::Observe(nsISupports* /* aSu
   MOZ_ASSERT(!strcmp("xpcom-shutdown-threads", aTopic), "Bad topic!");
   Shutdown();
   return NS_OK;
 }
 
 class LoadMonitorAddObserver : public nsRunnable
 {
 public:
-  LoadMonitorAddObserver(nsRefPtr<LoadMonitor> loadMonitor)
+  explicit LoadMonitorAddObserver(nsRefPtr<LoadMonitor> loadMonitor)
   {
     mLoadMonitor = loadMonitor;
   }
 
   NS_IMETHOD Run()
   {
     nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
@@ -121,17 +121,17 @@ public:
 
 private:
   nsRefPtr<LoadMonitor> mLoadMonitor;
 };
 
 class LoadMonitorRemoveObserver : public nsRunnable
 {
 public:
-  LoadMonitorRemoveObserver(nsRefPtr<LoadMonitor> loadMonitor)
+  explicit LoadMonitorRemoveObserver(nsRefPtr<LoadMonitor> loadMonitor)
   {
     mLoadMonitor = loadMonitor;
   }
 
   NS_IMETHOD Run()
   {
     // remove xpcom shutdown observer
     nsCOMPtr<nsIObserverService> observerService =
--- a/content/media/systemservices/LoadMonitor.h
+++ b/content/media/systemservices/LoadMonitor.h
@@ -26,17 +26,17 @@ public:
 };
 
 class LoadMonitor MOZ_FINAL : public nsIObserver
 {
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
-    LoadMonitor(int aLoadUpdateInterval);
+    explicit LoadMonitor(int aLoadUpdateInterval);
 
     nsresult Init(nsRefPtr<LoadMonitor> &self);
     void SetLoadChangeCallback(LoadNotificationCallback* aCallback);
     void Shutdown();
     float GetSystemLoad();
     float GetProcessLoad();
 
     friend class LoadInfoCollectRunner;
--- a/content/media/wave/WaveReader.h
+++ b/content/media/wave/WaveReader.h
@@ -15,17 +15,17 @@ class TimeRanges;
 }
 }
 
 namespace mozilla {
 
 class WaveReader : public MediaDecoderReader
 {
 public:
-  WaveReader(AbstractMediaDecoder* aDecoder);
+  explicit WaveReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~WaveReader();
 
 public:
   virtual nsresult Init(MediaDecoderReader* aCloneDonor);
   virtual bool DecodeAudioData();
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
--- a/content/media/webaudio/AudioNodeEngine.h
+++ b/content/media/webaudio/AudioNodeEngine.h
@@ -27,17 +27,17 @@ class AudioNodeStream;
  * pointers can be different (e.g. if the buffers are contained inside
  * some malloced object).
  */
 class ThreadSharedFloatArrayBufferList : public ThreadSharedObject {
 public:
   /**
    * Construct with null data.
    */
-  ThreadSharedFloatArrayBufferList(uint32_t aCount)
+  explicit ThreadSharedFloatArrayBufferList(uint32_t aCount)
   {
     mContents.SetLength(aCount);
   }
 
   struct Storage {
     Storage()
     {
       mDataToFree = nullptr;
--- a/content/media/webaudio/blink/DirectConvolver.h
+++ b/content/media/webaudio/blink/DirectConvolver.h
@@ -31,17 +31,17 @@
 
 #include "nsTArray.h"
 #include "mozilla/MemoryReporting.h"
 
 namespace WebCore {
 
 class DirectConvolver {
 public:
-    DirectConvolver(size_t inputBlockSize);
+    explicit DirectConvolver(size_t inputBlockSize);
 
     void process(const nsTArray<float>* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess);
 
     void reset();
 
     size_t sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
     {
         size_t amount = aMallocSizeOf(this);
--- a/content/media/webaudio/blink/FFTConvolver.h
+++ b/content/media/webaudio/blink/FFTConvolver.h
@@ -36,17 +36,17 @@
 namespace WebCore {
 
 typedef nsTArray<float> AudioFloatArray;
 using mozilla::FFTBlock;
 
 class FFTConvolver {
 public:
     // fftSize must be a power of two
-    FFTConvolver(size_t fftSize);
+    explicit FFTConvolver(size_t fftSize);
 
     // |fftKernel| must be pre-scaled for FFTBlock::GetInverseWithoutScaling().
     //
     // For now, with multiple calls to Process(), framesToProcess MUST add up EXACTLY to fftSize / 2
     //
     // FIXME: Later, we can do more sophisticated buffering to relax this requirement...
     //
     // The input to output latency is equal to fftSize / 2
--- a/content/media/webaudio/blink/HRTFDatabaseLoader.h
+++ b/content/media/webaudio/blink/HRTFDatabaseLoader.h
@@ -107,17 +107,17 @@ private:
 
     // If it hasn't already been loaded, creates a new thread and initiates asynchronous loading of the default database.
     // This must be called from the main thread.
     void loadAsynchronously();
 
     // Map from sample-rate to loader.
     class LoaderByRateEntry : public nsFloatHashKey {
     public:
-        LoaderByRateEntry(KeyTypePointer aKey)
+        explicit LoaderByRateEntry(KeyTypePointer aKey)
             : nsFloatHashKey(aKey)
             , mLoader() // so PutEntry() will zero-initialize
         {
         }
         HRTFDatabaseLoader* mLoader;
     };
 
     static PLDHashOperator shutdownEnumFunc(LoaderByRateEntry *entry,
--- a/content/media/webaudio/blink/ReverbAccumulationBuffer.h
+++ b/content/media/webaudio/blink/ReverbAccumulationBuffer.h
@@ -36,17 +36,17 @@ namespace WebCore {
 
 typedef nsTArray<float> AudioFloatArray;
 
 // ReverbAccumulationBuffer is a circular delay buffer with one client reading from it and multiple clients
 // writing/accumulating to it at different delay offsets from the read position.  The read operation will zero the memory
 // just read from the buffer, so it will be ready for accumulation the next time around.
 class ReverbAccumulationBuffer {
 public:
-    ReverbAccumulationBuffer(size_t length);
+    explicit ReverbAccumulationBuffer(size_t length);
 
     // This will read from, then clear-out numberOfFrames
     void readAndClear(float* destination, size_t numberOfFrames);
 
     // Each ReverbConvolverStage will accumulate its output at the appropriate delay from the read position.
     // We need to pass in and update readIndex here, since each ReverbConvolverStage may be running in
     // a different thread than the realtime thread calling ReadAndClear() and maintaining m_readIndex
     // Returns the writeIndex where the accumulation took place
--- a/content/media/webaudio/blink/ReverbInputBuffer.h
+++ b/content/media/webaudio/blink/ReverbInputBuffer.h
@@ -32,17 +32,17 @@
 #include "nsTArray.h"
 #include "mozilla/MemoryReporting.h"
 
 namespace WebCore {
 
 // ReverbInputBuffer is used to buffer input samples for deferred processing by the background threads.
 class ReverbInputBuffer {
 public:
-    ReverbInputBuffer(size_t length);
+    explicit ReverbInputBuffer(size_t length);
 
     // The realtime audio thread keeps writing samples here.
     // The assumption is that the buffer's length is evenly divisible by numberOfFrames (for nearly all cases this will be fine).
     // FIXME: remove numberOfFrames restriction...
     void write(const float* sourceP, size_t numberOfFrames);
 
     // Background threads can call this to check if there's anything to read...
     size_t writeIndex() const { return m_writeIndex; }
--- a/content/media/webm/WebMReader.h
+++ b/content/media/webm/WebMReader.h
@@ -99,17 +99,17 @@ class WebMPacketQueue : private nsDeque 
       delete PopFront();
     }
   }
 };
 
 class WebMReader : public MediaDecoderReader
 {
 public:
-  WebMReader(AbstractMediaDecoder* aDecoder);
+  explicit WebMReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~WebMReader();
 
 public:
   virtual nsresult Init(MediaDecoderReader* aCloneDonor);
   virtual nsresult ResetDecode();
   virtual bool DecodeAudioData();
--- a/content/media/webm/WebMWriter.h
+++ b/content/media/webm/WebMWriter.h
@@ -41,17 +41,17 @@ public:
  * encoded data to ebml Composer, and get muxing data through GetContainerData.
  * The ctor/dtor run in the MediaRecorder thread, others run in MediaEncoder thread.
  */
 class WebMWriter : public ContainerWriter
 {
 public:
   // aTrackTypes indicate this muxer should multiplex into Video only or A/V foramt.
   // Run in MediaRecorder thread
-  WebMWriter(uint32_t aTrackTypes);
+  explicit WebMWriter(uint32_t aTrackTypes);
   virtual ~WebMWriter();
 
   // WriteEncodedTrack inserts raw packets into WebM stream.
   nsresult WriteEncodedTrack(const EncodedFrameContainer &aData,
                              uint32_t aFlags = 0) MOZ_OVERRIDE;
 
   // GetContainerData outputs multiplexing data.
   // aFlags indicates the muxer should enter into finished stage and flush out
--- a/content/media/webrtc/MediaEngineDefault.cpp
+++ b/content/media/webrtc/MediaEngineDefault.cpp
@@ -301,17 +301,17 @@ MediaEngineDefaultVideoSource::NotifyPul
 // generate 1k sine wave per second
 class SineWaveGenerator
 {
 public:
   static const int bytesPerSample = 2;
   static const int millisecondsPerSecond = 1000;
   static const int frequency = 1000;
 
-  SineWaveGenerator(int aSampleRate) :
+  explicit SineWaveGenerator(int aSampleRate) :
     mTotalLength(aSampleRate / frequency),
     mReadLength(0) {
     MOZ_ASSERT(mTotalLength * frequency == aSampleRate);
     mAudioBuffer = new int16_t[mTotalLength];
     for(int i = 0; i < mTotalLength; i++) {
       // Set volume to -20db. It's from 32768.0 * 10^(-20/20) = 3276.8
       mAudioBuffer[i] = (3276.8f * sin(2 * M_PI * i / mTotalLength));
     }
--- a/content/media/webrtc/MediaEngineTabVideoSource.h
+++ b/content/media/webrtc/MediaEngineTabVideoSource.h
@@ -33,31 +33,31 @@ class MediaEngineTabVideoSource : public
     virtual const MediaSourceType GetMediaSource() {
       return MediaSourceType::Browser;
     }
 
     void Draw();
 
     class StartRunnable : public nsRunnable {
     public:
-      StartRunnable(MediaEngineTabVideoSource *videoSource) : mVideoSource(videoSource) {}
+      explicit StartRunnable(MediaEngineTabVideoSource *videoSource) : mVideoSource(videoSource) {}
       NS_IMETHOD Run();
       nsRefPtr<MediaEngineTabVideoSource> mVideoSource;
     };
 
     class StopRunnable : public nsRunnable {
     public:
-    StopRunnable(MediaEngineTabVideoSource *videoSource) : mVideoSource(videoSource) {}
+      explicit StopRunnable(MediaEngineTabVideoSource *videoSource) : mVideoSource(videoSource) {}
       NS_IMETHOD Run();
       nsRefPtr<MediaEngineTabVideoSource> mVideoSource;
     };
 
     class InitRunnable : public nsRunnable {
     public:
-    InitRunnable(MediaEngineTabVideoSource *videoSource) : mVideoSource(videoSource) {}
+      explicit InitRunnable(MediaEngineTabVideoSource *videoSource) : mVideoSource(videoSource) {}
       NS_IMETHOD Run();
       nsRefPtr<MediaEngineTabVideoSource> mVideoSource;
     };
 
 protected:
     ~MediaEngineTabVideoSource() {}
 
 private:
--- a/content/media/webrtc/MediaEngineWebRTC.h
+++ b/content/media/webrtc/MediaEngineWebRTC.h
@@ -385,17 +385,17 @@ private:
   int32_t mPlayoutDelay;
 
   NullTransport *mNullTransport;
 };
 
 class MediaEngineWebRTC : public MediaEngine
 {
 public:
-  MediaEngineWebRTC(MediaEnginePrefs &aPrefs);
+  explicit MediaEngineWebRTC(MediaEnginePrefs &aPrefs);
 
   // Clients should ensure to clean-up sources video/audio sources
   // before invoking Shutdown on this class.
   void Shutdown();
 
   virtual void EnumerateVideoDevices(MediaSourceType,
                                     nsTArray<nsRefPtr<MediaEngineVideoSource> >*);
   virtual void EnumerateAudioDevices(MediaSourceType,
--- a/content/media/webrtc/MediaTrackConstraints.h
+++ b/content/media/webrtc/MediaTrackConstraints.h
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // This file should not be included by other includes, as it contains code
 
 #ifndef MEDIATRACKCONSTRAINTS_H_
 #define MEDIATRACKCONSTRAINTS_H_
 
+#include "mozilla/Attributes.h"
 #include "mozilla/dom/MediaStreamTrackBinding.h"
 
 namespace mozilla {
 
 // Normalized internal version of MediaTrackConstraints to simplify downstream
 // processing. This implementation-only helper is included as needed by both
 // MediaManager (for gUM camera selection) and MediaEngine (for applyConstraints).
 
@@ -77,25 +78,25 @@ private:
     return Kind::Other;
   }
   const dom::EnumEntry* mStrings;
 };
 
 struct AudioTrackConstraintsN :
   public MediaTrackConstraintsN<dom::SupportedAudioConstraints>
 {
-  AudioTrackConstraintsN(const dom::MediaTrackConstraints &aOther)
+  MOZ_IMPLICIT AudioTrackConstraintsN(const dom::MediaTrackConstraints &aOther)
   : MediaTrackConstraintsN<dom::SupportedAudioConstraints>(aOther, // B2G ICS compiler bug
                            dom::SupportedAudioConstraintsValues::strings) {}
 };
 
 struct VideoTrackConstraintsN :
     public MediaTrackConstraintsN<dom::SupportedVideoConstraints>
 {
-  VideoTrackConstraintsN(const dom::MediaTrackConstraints &aOther)
+  MOZ_IMPLICIT VideoTrackConstraintsN(const dom::MediaTrackConstraints &aOther)
   : MediaTrackConstraintsN<dom::SupportedVideoConstraints>(aOther,
                            dom::SupportedVideoConstraintsValues::strings) {
     if (mFacingMode.WasPassed()) {
       Triage(Kind::FacingMode).mFacingMode.Construct(mFacingMode.Value());
     }
     // Reminder: add handling for new constraints both here & SatisfyConstraintSet
     Triage(Kind::Width).mWidth = mWidth;
     Triage(Kind::Height).mHeight = mHeight;
--- a/content/media/webrtc/PeerIdentity.h
+++ b/content/media/webrtc/PeerIdentity.h
@@ -25,17 +25,17 @@ namespace mozilla {
  * containing any character other than '@'.  The domain portion is a valid IDN
  * domain name and is compared accordingly.
  *
  * See: http://tools.ietf.org/html/draft-ietf-rtcweb-security-arch-09#section-5.6.5.3.3.1
  */
 class PeerIdentity MOZ_FINAL
 {
 public:
-  PeerIdentity(const nsAString& aPeerIdentity)
+  explicit PeerIdentity(const nsAString& aPeerIdentity)
     : mPeerIdentity(aPeerIdentity) {}
   ~PeerIdentity() {}
 
   bool Equals(const PeerIdentity& aOther) const;
   bool Equals(const nsAString& aOtherString) const;
   const nsString& ToString() const { return mPeerIdentity; }
 
 private:
--- a/content/media/webspeech/recognition/SpeechGrammar.h
+++ b/content/media/webspeech/recognition/SpeechGrammar.h
@@ -20,17 +20,17 @@ namespace mozilla {
 namespace dom {
 
 class GlobalObject;
 
 class SpeechGrammar MOZ_FINAL : public nsISupports,
                                 public nsWrapperCache
 {
 public:
-  SpeechGrammar(nsISupports* aParent);
+  explicit SpeechGrammar(nsISupports* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechGrammar)
 
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
--- a/content/media/webspeech/recognition/SpeechGrammarList.h
+++ b/content/media/webspeech/recognition/SpeechGrammarList.h
@@ -23,17 +23,17 @@ namespace dom {
 class GlobalObject;
 class SpeechGrammar;
 template<typename> class Optional;
 
 class SpeechGrammarList MOZ_FINAL : public nsISupports,
                                     public nsWrapperCache
 {
 public:
-  SpeechGrammarList(nsISupports* aParent);
+  explicit SpeechGrammarList(nsISupports* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechGrammarList)
 
   SpeechGrammarList* Constructor(const GlobalObject& aGlobal,
                                  ErrorResult& aRv);
 
   nsISupports* GetParentObject() const;
--- a/content/media/webspeech/recognition/SpeechRecognition.h
+++ b/content/media/webspeech/recognition/SpeechRecognition.h
@@ -54,17 +54,17 @@ PRLogModuleInfo* GetSpeechRecognitionLog
 #endif
 
 class SpeechRecognition MOZ_FINAL : public DOMEventTargetHelper,
                                     public nsIObserver,
                                     public SupportsWeakPtr<SpeechRecognition>
 {
 public:
   MOZ_DECLARE_REFCOUNTED_TYPENAME(SpeechRecognition)
-  SpeechRecognition(nsPIDOMWindow* aOwnerWindow);
+  explicit SpeechRecognition(nsPIDOMWindow* aOwnerWindow);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIOBSERVER
 
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
@@ -177,33 +177,33 @@ private:
   bool StateBetween(FSMState begin, FSMState end);
 
   class GetUserMediaSuccessCallback : public nsIDOMGetUserMediaSuccessCallback
   {
   public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIDOMGETUSERMEDIASUCCESSCALLBACK
 
-    GetUserMediaSuccessCallback(SpeechRecognition* aRecognition)
+    explicit GetUserMediaSuccessCallback(SpeechRecognition* aRecognition)
       : mRecognition(aRecognition)
     {}
 
   private:
     virtual ~GetUserMediaSuccessCallback() {}
 
     nsRefPtr<SpeechRecognition> mRecognition;
   };
 
   class GetUserMediaErrorCallback : public nsIDOMGetUserMediaErrorCallback
   {
   public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIDOMGETUSERMEDIAERRORCALLBACK
 
-    GetUserMediaErrorCallback(SpeechRecognition* aRecognition)
+    explicit GetUserMediaErrorCallback(SpeechRecognition* aRecognition)
       : mRecognition(aRecognition)
     {}
 
   private:
     virtual ~GetUserMediaErrorCallback() {}
 
     nsRefPtr<SpeechRecognition> mRecognition;
   };
--- a/content/media/webspeech/recognition/SpeechRecognitionAlternative.h
+++ b/content/media/webspeech/recognition/SpeechRecognitionAlternative.h
@@ -19,17 +19,17 @@ namespace mozilla {
 namespace dom {
 
 class SpeechRecognition;
 
 class SpeechRecognitionAlternative MOZ_FINAL : public nsISupports,
                                                public nsWrapperCache
 {
 public:
-  SpeechRecognitionAlternative(SpeechRecognition* aParent);
+  explicit SpeechRecognitionAlternative(SpeechRecognition* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionAlternative)
 
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
--- a/content/media/webspeech/recognition/SpeechRecognitionResult.h
+++ b/content/media/webspeech/recognition/SpeechRecognitionResult.h
@@ -20,17 +20,17 @@
 
 namespace mozilla {
 namespace dom {
 
 class SpeechRecognitionResult MOZ_FINAL : public nsISupports,
                                           public nsWrapperCache
 {
 public:
-  SpeechRecognitionResult(SpeechRecognition* aParent);
+  explicit SpeechRecognitionResult(SpeechRecognition* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionResult)
 
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
--- a/content/media/webspeech/recognition/SpeechRecognitionResultList.h
+++ b/content/media/webspeech/recognition/SpeechRecognitionResultList.h
@@ -21,17 +21,17 @@ namespace mozilla {
 namespace dom {
 
 class SpeechRecognition;
 
 class SpeechRecognitionResultList MOZ_FINAL : public nsISupports,
                                               public nsWrapperCache
 {
 public:
-  SpeechRecognitionResultList(SpeechRecognition* aParent);
+  explicit SpeechRecognitionResultList(SpeechRecognition* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionResultList)
 
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
--- a/content/media/webspeech/recognition/SpeechStreamListener.h
+++ b/content/media/webspeech/recognition/SpeechStreamListener.h
@@ -16,17 +16,17 @@ class AudioSegment;
 
 namespace dom {
 
 class SpeechRecognition;
 
 class SpeechStreamListener : public MediaStreamListener
 {
 public:
-  SpeechStreamListener(SpeechRecognition* aRecognition);
+  explicit SpeechStreamListener(SpeechRecognition* aRecognition);
   ~SpeechStreamListener();
 
   void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
                                 TrackRate aTrackRate,
                                 TrackTicks aTrackOffset,
                                 uint32_t aTrackEvents,
                                 const MediaSegment& aQueuedMedia) MOZ_OVERRIDE;
 
--- a/content/media/webspeech/synth/SpeechSynthesis.h
+++ b/content/media/webspeech/synth/SpeechSynthesis.h
@@ -22,17 +22,17 @@ namespace mozilla {
 namespace dom {
 
 class nsSpeechTask;
 
 class SpeechSynthesis MOZ_FINAL : public nsISupports,
                                   public nsWrapperCache
 {
 public:
-  SpeechSynthesis(nsPIDOMWindow* aParent);
+  explicit SpeechSynthesis(nsPIDOMWindow* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechSynthesis)
 
   nsIDOMWindow* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
--- a/content/media/webspeech/synth/ipc/SpeechSynthesisChild.h
+++ b/content/media/webspeech/synth/ipc/SpeechSynthesisChild.h
@@ -39,17 +39,17 @@ protected:
                                                                   const float& aPitch,
                                                                   const float& aRate) MOZ_OVERRIDE;
   bool DeallocPSpeechSynthesisRequestChild(PSpeechSynthesisRequestChild* aActor) MOZ_OVERRIDE;
 };
 
 class SpeechSynthesisRequestChild : public PSpeechSynthesisRequestChild
 {
 public:
-  SpeechSynthesisRequestChild(SpeechTaskChild* aTask);
+  explicit SpeechSynthesisRequestChild(SpeechTaskChild* aTask);
   virtual ~SpeechSynthesisRequestChild();
 
 protected:
   virtual bool RecvOnStart() MOZ_OVERRIDE;
 
   virtual bool Recv__delete__(const bool& aIsError,
                               const float& aElapsedTime,
                               const uint32_t& aCharIndex) MOZ_OVERRIDE;
@@ -67,17 +67,17 @@ protected:
   nsRefPtr<SpeechTaskChild> mTask;
 };
 
 class SpeechTaskChild : public nsSpeechTask
 {
   friend class SpeechSynthesisRequestChild;
 public:
 
-  SpeechTaskChild(SpeechSynthesisUtterance* aUtterance);
+  explicit SpeechTaskChild(SpeechSynthesisUtterance* aUtterance);
 
   NS_IMETHOD Setup(nsISpeechTaskCallback* aCallback,
                    uint32_t aChannels, uint32_t aRate, uint8_t argc) MOZ_OVERRIDE;
 
   NS_IMETHOD SendAudio(JS::Handle<JS::Value> aData, JS::Handle<JS::Value> aLandmarks,
                        JSContext* aCx) MOZ_OVERRIDE;
 
   NS_IMETHOD SendAudioNative(int16_t* aData, uint32_t aDataLen) MOZ_OVERRIDE;
--- a/content/media/webspeech/synth/ipc/SpeechSynthesisParent.h
+++ b/content/media/webspeech/synth/ipc/SpeechSynthesisParent.h
@@ -47,17 +47,17 @@ protected:
                                               const float& aVolume,
                                               const float& aRate,
                                               const float& aPitch) MOZ_OVERRIDE;
 };
 
 class SpeechSynthesisRequestParent : public PSpeechSynthesisRequestParent
 {
 public:
-  SpeechSynthesisRequestParent(SpeechTaskParent* aTask);
+  explicit SpeechSynthesisRequestParent(SpeechTaskParent* aTask);
   virtual ~SpeechSynthesisRequestParent();
 
   nsRefPtr<SpeechTaskParent> mTask;
 
 protected:
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
--- a/content/media/webspeech/synth/nsSpeechTask.cpp
+++ b/content/media/webspeech/synth/nsSpeechTask.cpp
@@ -23,17 +23,17 @@ extern PRLogModuleInfo* GetSpeechSynthLo
 #endif
 
 namespace mozilla {
 namespace dom {
 
 class SynthStreamListener : public MediaStreamListener
 {
 public:
-  SynthStreamListener(nsSpeechTask* aSpeechTask) :
+  explicit SynthStreamListener(nsSpeechTask* aSpeechTask) :
     mSpeechTask(aSpeechTask),
     mStarted(false)
   {
   }
 
   void DoNotifyStarted()
   {
     if (mSpeechTask) {
--- a/content/media/webspeech/synth/nsSpeechTask.h
+++ b/content/media/webspeech/synth/nsSpeechTask.h
@@ -23,17 +23,17 @@ class nsSpeechTask : public nsISpeechTas
   friend class SynthStreamListener;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsSpeechTask, nsISpeechTask)
 
   NS_DECL_NSISPEECHTASK
 
-  nsSpeechTask(SpeechSynthesisUtterance* aUtterance);
+  explicit nsSpeechTask(SpeechSynthesisUtterance* aUtterance);
   nsSpeechTask(float aVolume, const nsAString& aText);
 
   virtual void Pause();
 
   virtual void Resume();
 
   virtual void Cancel();
 
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -505,37 +505,37 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIMEDIADEVICE
 
   static MediaDevice* Create(MediaEngineVideoSource* source);
   static MediaDevice* Create(MediaEngineAudioSource* source);
 
 protected:
   virtual ~MediaDevice() {}
-  MediaDevice(MediaEngineSource* aSource);
+  explicit MediaDevice(MediaEngineSource* aSource);
   nsString mName;
   nsString mID;
   bool mHasFacingMode;
   dom::VideoFacingModeEnum mFacingMode;
   MediaSourceType mMediaSource;
   nsRefPtr<MediaEngineSource> mSource;
 };
 
 class VideoDevice : public MediaDevice
 {
 public:
-  VideoDevice(MediaEngineVideoSource* aSource);
+  explicit VideoDevice(MediaEngineVideoSource* aSource);
   NS_IMETHOD GetType(nsAString& aType);
   MediaEngineVideoSource* GetSource();
 };
 
 class AudioDevice : public MediaDevice
 {
 public:
-  AudioDevice(MediaEngineAudioSource* aSource);
+  explicit AudioDevice(MediaEngineAudioSource* aSource);
   NS_IMETHOD GetType(nsAString& aType);
   MediaEngineAudioSource* GetSource();
 };
 
 class MediaManager MOZ_FINAL : public nsIMediaManagerService,
                                public nsIObserver
 {
 public:
--- a/dom/media/gmp-plugin/gmp-fake.cpp
+++ b/dom/media/gmp-plugin/gmp-fake.cpp
@@ -112,17 +112,17 @@ class FakeEncoderTask : public GMPTask {
 
   FakeVideoEncoder* encoder_;
   GMPVideoi420Frame* frame_;
   GMPVideoFrameType type_;
 };
 
 class FakeVideoEncoder : public GMPVideoEncoder {
  public:
-  FakeVideoEncoder (GMPVideoHost* hostAPI) :
+  explicit FakeVideoEncoder (GMPVideoHost* hostAPI) :
     host_ (hostAPI),
     callback_ (NULL) {}
 
   virtual void InitEncode (const GMPVideoCodec& codecSettings,
                              const uint8_t* aCodecSpecific,
                              uint32_t aCodecSpecificSize,
                              GMPVideoEncoderCallback* callback,
                              int32_t numberOfCores,
@@ -266,17 +266,17 @@ class FakeDecoderTask : public GMPTask {
 
   FakeVideoDecoder* decoder_;
   GMPVideoEncodedFrame* frame_;
   int64_t time_;
 };
 
 class FakeVideoDecoder : public GMPVideoDecoder {
  public:
-  FakeVideoDecoder (GMPVideoHost* hostAPI) :
+  explicit FakeVideoDecoder (GMPVideoHost* hostAPI) :
     host_ (hostAPI),
     callback_ (NULL) {}
 
   virtual ~FakeVideoDecoder() {
   }
 
   virtual void InitDecode (const GMPVideoCodec& codecSettings,
                              const uint8_t* aCodecSpecific,
--- a/media/libstagefright/binding/include/mp4_demuxer/MoofParser.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/MoofParser.h
@@ -19,17 +19,17 @@ class Tkhd
 public:
   Tkhd()
     : mCreationTime(0)
     , mModificationTime(0)
     , mTrackId(0)
     , mDuration(0)
   {
   }
-  Tkhd(Box& aBox);
+  explicit Tkhd(Box& aBox);
 
   uint64_t mCreationTime;
   uint64_t mModificationTime;
   uint32_t mTrackId;
   uint64_t mDuration;
 };
 
 class Mdhd
@@ -37,66 +37,66 @@ class Mdhd
 public:
   Mdhd()
     : mCreationTime(0)
     , mModificationTime(0)
     , mTimescale(0)
     , mDuration(0)
   {
   }
-  Mdhd(Box& aBox);
+  explicit Mdhd(Box& aBox);
 
   Microseconds ToMicroseconds(uint64_t aTimescaleUnits)
   {
     return aTimescaleUnits * 1000000ll / mTimescale;
   }
 
   uint64_t mCreationTime;
   uint64_t mModificationTime;
   uint32_t mTimescale;
   uint64_t mDuration;
 };
 
 class Trex
 {
 public:
-  Trex(uint32_t aTrackId)
+  explicit Trex(uint32_t aTrackId)
     : mFlags(0)
     , mTrackId(aTrackId)
     , mDefaultSampleDescriptionIndex(0)
     , mDefaultSampleDuration(0)
     , mDefaultSampleSize(0)
     , mDefaultSampleFlags(0)
   {
   }
 
-  Trex(Box& aBox);
+  explicit Trex(Box& aBox);
 
   uint32_t mFlags;
   uint32_t mTrackId;
   uint32_t mDefaultSampleDescriptionIndex;
   uint32_t mDefaultSampleDuration;
   uint32_t mDefaultSampleSize;
   uint32_t mDefaultSampleFlags;
 };
 
 class Tfhd : public Trex
 {
 public:
-  Tfhd(Trex& aTrex) : Trex(aTrex), mBaseDataOffset(0) {}
+  explicit Tfhd(Trex& aTrex) : Trex(aTrex), mBaseDataOffset(0) {}
   Tfhd(Box& aBox, Trex& aTrex);
 
   uint64_t mBaseDataOffset;
 };
 
 class Tfdt
 {
 public:
   Tfdt() : mBaseMediaDecodeTime(0) {}
-  Tfdt(Box& aBox);
+  explicit Tfdt(Box& aBox);
 
   uint64_t mBaseMediaDecodeTime;
 };
 
 struct Sample
 {
   mozilla::MediaByteRange mByteRange;
   Interval<Microseconds> mCompositionRange;
--- a/media/libstagefright/binding/include/mp4_demuxer/mp4_demuxer.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/mp4_demuxer.h
@@ -32,17 +32,17 @@ protected:
   virtual ~Stream() {}
 };
 
 enum TrackType { kVideo = 1, kAudio };
 
 class MP4Demuxer
 {
 public:
-  MP4Demuxer(Stream* aSource);
+  explicit MP4Demuxer(Stream* aSource);
   ~MP4Demuxer();
 
   bool Init();
   Microseconds Duration();
   bool CanSeek();
 
   bool HasValidAudio();
   bool HasValidVideo();
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -211,17 +211,17 @@ class PeerConnectionImpl MOZ_FINAL : pub
                                      public nsNSSShutDownObject,
                                      public DOMMediaStream::PrincipalChangeObserver,
 #endif
                                      public sigslot::has_slots<>
 {
   struct Internal; // Avoid exposing c includes to bindings
 
 public:
-  PeerConnectionImpl(const mozilla::dom::GlobalObject* aGlobal = nullptr);
+  explicit PeerConnectionImpl(const mozilla::dom::GlobalObject* aGlobal = nullptr);
 
   enum Error {
     kNoError                          = 0,
     kInvalidCandidateType             = 2,
     kInvalidMediastreamTrack          = 3,
     kInvalidState                     = 4,
     kInvalidSessionDescription        = 5,
     kIncompatibleSessionDescription   = 6,
@@ -757,17 +757,17 @@ public:
   unsigned short connectPort;
   char *connectStr; // XXX ownership/free
 };
 
 // This is what is returned when you acquire on a handle
 class PeerConnectionWrapper
 {
  public:
-  PeerConnectionWrapper(const std::string& handle);
+  explicit PeerConnectionWrapper(const std::string& handle);
 
   PeerConnectionImpl *impl() { return impl_; }
 
  private:
   nsRefPtr<PeerConnectionImpl> impl_;
 };
 
 }  // end sipcc namespace