Bug 1061051 - Fix more bad implicit constructors in the media code; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 31 Aug 2014 23:50:59 -0400
changeset 224488 588d58c76e334431389a0989af885ad2440d1306
parent 224487 2572b784a8bbd0119cd0e97119499d6654c3f0ba
child 224489 d8d79e4fbfc49f964743dfca2c7817c84dc8397e
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1061051
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 1061051 - Fix more bad implicit constructors in the media code; r=roc
content/media/fmp4/MP4Reader.cpp
content/media/fmp4/apple/AppleUtils.h
content/media/fmp4/eme/EMEAudioDecoder.h
content/media/fmp4/eme/EMEH264Decoder.h
content/media/gtest/TestWebMWriter.cpp
content/media/webaudio/ChannelMergerNode.cpp
content/media/webaudio/ChannelSplitterNode.cpp
content/media/webaudio/OscillatorNode.cpp
content/media/webaudio/ScriptProcessorNode.cpp
media/libstagefright/binding/Index.cpp
media/libstagefright/binding/include/mp4_demuxer/Box.h
media/libstagefright/binding/include/mp4_demuxer/ByteReader.h
media/libstagefright/binding/mp4_demuxer.cpp
--- a/content/media/fmp4/MP4Reader.cpp
+++ b/content/media/fmp4/MP4Reader.cpp
@@ -57,17 +57,17 @@ TrackTypeToStr(TrackType aTrack)
     return "Unknown";
   }
 }
 #endif
 
 class MP4Stream : public Stream {
 public:
 
-  MP4Stream(MediaResource* aResource)
+  explicit MP4Stream(MediaResource* aResource)
     : mResource(aResource)
   {
     MOZ_COUNT_CTOR(MP4Stream);
     MOZ_ASSERT(aResource);
   }
   virtual ~MP4Stream() {
     MOZ_COUNT_DTOR(MP4Stream);
   }
--- a/content/media/fmp4/apple/AppleUtils.h
+++ b/content/media/fmp4/apple/AppleUtils.h
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Utility functions to help with Apple API calls.
 
 #ifndef mozilla_AppleUtils_h
 #define mozilla_AppleUtils_h
 
 #include <AudioToolbox/AudioToolbox.h>
+#include "mozilla/Attributes.h"
 #include "nsError.h"
 
 namespace mozilla {
 
 struct AppleUtils {
   // Helper to retrieve properties from AudioFileStream objects.
   static nsresult GetProperty(AudioFileStreamID aAudioFileStream,
                               AudioFileStreamPropertyID aPropertyID,
@@ -38,17 +39,17 @@ struct AppleUtils {
     AudioFileStreamID aAudioFileStream, AudioStreamBasicDescription& aFormat);
 };
 
 // Wrapper class to call CFRelease on reference types
 // when they go out of scope.
 template <class T>
 class AutoCFRelease {
 public:
-  AutoCFRelease(T aRef)
+  MOZ_IMPLICIT AutoCFRelease(T aRef)
     : mRef(aRef)
   {
   }
   ~AutoCFRelease()
   {
     if (mRef) {
       CFRelease(mRef);
     }
--- a/content/media/fmp4/eme/EMEAudioDecoder.h
+++ b/content/media/fmp4/eme/EMEAudioDecoder.h
@@ -63,17 +63,17 @@ private:
     }
   private:
     nsRefPtr<EMEAudioDecoder> mDecoder;
     nsAutoPtr<mp4_demuxer::MP4Sample> mSample;
   };
 
   class InitTask : public nsRunnable {
   public:
-    InitTask(EMEAudioDecoder* aDecoder)
+    explicit InitTask(EMEAudioDecoder* aDecoder)
       : mDecoder(aDecoder)
     {}
     NS_IMETHOD Run() {
       mResult = mDecoder->GmpInit();
       return NS_OK;
     }
     nsresult mResult;
     EMEAudioDecoder* mDecoder;
--- a/content/media/fmp4/eme/EMEH264Decoder.h
+++ b/content/media/fmp4/eme/EMEH264Decoder.h
@@ -76,17 +76,17 @@ private:
     }
   private:
     nsRefPtr<EMEH264Decoder> mDecoder;
     nsAutoPtr<mp4_demuxer::MP4Sample> mSample;
   };
 
   class InitTask : public nsRunnable {
   public:
-    InitTask(EMEH264Decoder* aDecoder)
+    explicit InitTask(EMEH264Decoder* aDecoder)
       : mDecoder(aDecoder)
     {}
     NS_IMETHOD Run() {
       mResult = mDecoder->GmpInit();
       return NS_OK;
     }
     nsresult mResult;
     EMEH264Decoder* mDecoder;
--- a/content/media/gtest/TestWebMWriter.cpp
+++ b/content/media/gtest/TestWebMWriter.cpp
@@ -40,17 +40,17 @@ public:
 };
 
 const uint64_t FIXED_DURATION = 1000000;
 const uint32_t FIXED_FRAMESIZE = 500;
 
 class TestWebMWriter: public WebMWriter
 {
 public:
-  TestWebMWriter(int aTrackTypes)
+  explicit TestWebMWriter(int aTrackTypes)
   : WebMWriter(aTrackTypes),
     mTimestamp(0)
   {}
 
   void SetVorbisMetadata(int aChannels, int aSampleRate) {
     WebMVorbisTrackEncoder vorbisEncoder;
     EXPECT_TRUE(vorbisEncoder.TestVorbisCreation(aChannels, aSampleRate));
     nsRefPtr<TrackMetadataBase> vorbisMeta = vorbisEncoder.GetMetadata();
--- a/content/media/webaudio/ChannelMergerNode.cpp
+++ b/content/media/webaudio/ChannelMergerNode.cpp
@@ -12,17 +12,17 @@
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS_INHERITED0(ChannelMergerNode, AudioNode)
 
 class ChannelMergerNodeEngine : public AudioNodeEngine
 {
 public:
-  ChannelMergerNodeEngine(ChannelMergerNode* aNode)
+  explicit ChannelMergerNodeEngine(ChannelMergerNode* aNode)
     : AudioNodeEngine(aNode)
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
   virtual void ProcessBlocksOnPorts(AudioNodeStream* aStream,
                                     const OutputChunks& aInput,
                                     OutputChunks& aOutput,
--- a/content/media/webaudio/ChannelSplitterNode.cpp
+++ b/content/media/webaudio/ChannelSplitterNode.cpp
@@ -12,17 +12,17 @@
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS_INHERITED0(ChannelSplitterNode, AudioNode)
 
 class ChannelSplitterNodeEngine : public AudioNodeEngine
 {
 public:
-  ChannelSplitterNodeEngine(ChannelSplitterNode* aNode)
+  explicit ChannelSplitterNodeEngine(ChannelSplitterNode* aNode)
     : AudioNodeEngine(aNode)
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
   virtual void ProcessBlocksOnPorts(AudioNodeStream* aStream,
                                     const OutputChunks& aInput,
                                     OutputChunks& aOutput,
--- a/content/media/webaudio/OscillatorNode.cpp
+++ b/content/media/webaudio/OscillatorNode.cpp
@@ -25,17 +25,17 @@ NS_IMPL_RELEASE_INHERITED(OscillatorNode
 
 static const float sLeakTriangle = 0.995f;
 static const float sLeak = 0.999f;
 
 class DCBlocker
 {
 public:
   // These are sane defauts when the initial mPhase is zero
-  DCBlocker(float aLastInput = 0.0f,
+  explicit DCBlocker(float aLastInput = 0.0f,
             float aLastOutput = 0.0f,
             float aPole = 0.995)
     :mLastInput(aLastInput),
      mLastOutput(aLastOutput),
      mPole(aPole)
   {
     MOZ_ASSERT(aPole > 0);
   }
--- a/content/media/webaudio/ScriptProcessorNode.cpp
+++ b/content/media/webaudio/ScriptProcessorNode.cpp
@@ -93,17 +93,17 @@ private:
     // of the callers to perform the required locking, and we assert that every
     // time we access mBufferList.
     Mutex mMutex;
     // The list representing the queue.
     BufferList mBufferList;
   };
 
 public:
-  SharedBuffers(float aSampleRate)
+  explicit SharedBuffers(float aSampleRate)
     : mOutputQueue("SharedBuffers::outputQueue")
     , mDelaySoFar(TRACK_TICKS_MAX)
     , mSampleRate(aSampleRate)
     , mLatency(0.0)
     , mDroppingBuffers(false)
   {
   }
 
--- a/media/libstagefright/binding/Index.cpp
+++ b/media/libstagefright/binding/Index.cpp
@@ -18,17 +18,17 @@ namespace mp4_demuxer
 {
 
 class MOZ_STACK_CLASS RangeFinder
 {
 public:
   // Given that we're processing this in order we don't use a binary search
   // to find the apropriate time range. Instead we search linearly from the
   // last used point.
-  RangeFinder(const nsTArray<mozilla::MediaByteRange>& ranges)
+  explicit RangeFinder(const nsTArray<mozilla::MediaByteRange>& ranges)
     : mRanges(ranges), mIndex(0)
   {
     // Ranges must be normalised for this to work
   }
 
   bool Contains(MediaByteRange aByteRange);
 
 private:
--- a/media/libstagefright/binding/include/mp4_demuxer/Box.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/Box.h
@@ -60,17 +60,17 @@ private:
   uint64_t mChildOffset;
   uint32_t mType;
   const Box* mParent;
 };
 
 class BoxReader
 {
 public:
-  BoxReader(Box& aBox)
+  explicit BoxReader(Box& aBox)
   {
     aBox.Read(&mBuffer);
     mReader.SetData(mBuffer);
   }
   ByteReader* operator->() { return &mReader; }
   ByteReader mReader;
 
 private:
--- a/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/ByteReader.h
@@ -10,17 +10,17 @@
 #include "nsTArray.h"
 
 namespace mp4_demuxer {
 
 class ByteReader
 {
 public:
   ByteReader() : mPtr(nullptr), mRemaining(0) {}
-  ByteReader(const mozilla::Vector<uint8_t>& aData)
+  explicit ByteReader(const mozilla::Vector<uint8_t>& aData)
     : mPtr(&aData[0]), mRemaining(aData.length())
   {
   }
   ByteReader(const uint8_t* aData, size_t aSize)
     : mPtr(aData), mRemaining(aSize)
   {
   }
   void SetData(const nsTArray<uint8_t>& aData)
--- a/media/libstagefright/binding/mp4_demuxer.cpp
+++ b/media/libstagefright/binding/mp4_demuxer.cpp
@@ -31,17 +31,17 @@ struct StageFrightPrivate
   MediaSource::ReadOptions mVideoOptions;
 
   nsTArray<nsAutoPtr<Index>> mIndexes;
 };
 
 class DataSourceAdapter : public DataSource
 {
 public:
-  DataSourceAdapter(Stream* aSource) : mSource(aSource) {}
+  explicit DataSourceAdapter(Stream* aSource) : mSource(aSource) {}
 
   ~DataSourceAdapter() {}
 
   virtual status_t initCheck() const { return NO_ERROR; }
 
   virtual ssize_t readAt(off64_t offset, void* data, size_t size)
   {
     MOZ_ASSERT(((ssize_t)size) >= 0);