Bug 1050609 - Fix more bad implicit constructors in gfx/layers; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 20 Aug 2014 00:55:14 -0400
changeset 222127 377796be32c3174ecb674c1bb4b933ffcb448ebf
parent 222126 3eee51b304705b926bb9e5c197274e99f6ae9a5e
child 222128 23f8315ecd6a431033e37299a42288af684e67f2
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
bugs1050609
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 1050609 - Fix more bad implicit constructors in gfx/layers; r=roc
gfx/layers/Compositor.h
gfx/layers/Effects.h
gfx/layers/ImageContainer.h
gfx/layers/LayerScope.cpp
gfx/layers/LayerScope.h
gfx/layers/LayerTreeInvalidation.cpp
gfx/layers/RotatedBuffer.h
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/AsyncPanZoomController.h
gfx/layers/apz/src/Axis.h
gfx/layers/apz/src/GestureEventListener.h
gfx/layers/basic/BasicCanvasLayer.h
gfx/layers/basic/BasicColorLayer.cpp
gfx/layers/basic/BasicCompositor.h
gfx/layers/basic/BasicContainerLayer.h
gfx/layers/basic/BasicImageLayer.cpp
gfx/layers/basic/BasicLayers.h
gfx/layers/basic/BasicLayersImpl.h
gfx/layers/basic/BasicThebesLayer.h
gfx/layers/client/ClientCanvasLayer.h
gfx/layers/client/ClientColorLayer.cpp
gfx/layers/client/ClientContainerLayer.h
gfx/layers/client/ClientImageLayer.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/client/ClientReadbackLayer.h
gfx/layers/client/ClientThebesLayer.h
gfx/layers/client/ClientTiledThebesLayer.h
gfx/layers/client/CompositableClient.h
gfx/layers/client/ContentClient.h
gfx/layers/client/SimpleTiledContentClient.h
gfx/layers/client/TextureClient.h
gfx/layers/client/TiledContentClient.h
gfx/layers/composite/AsyncCompositionManager.h
gfx/layers/composite/CanvasLayerComposite.h
gfx/layers/composite/ColorLayerComposite.h
gfx/layers/composite/CompositableHost.h
gfx/layers/composite/ContainerLayerComposite.h
gfx/layers/composite/ContentHost.h
gfx/layers/composite/FPSCounter.h
gfx/layers/composite/ImageHost.h
gfx/layers/composite/ImageLayerComposite.h
gfx/layers/composite/LayerManagerComposite.h
gfx/layers/composite/TextRenderer.h
gfx/layers/composite/TextureHost.cpp
gfx/layers/composite/TextureHost.h
gfx/layers/composite/ThebesLayerComposite.h
gfx/layers/composite/TiledContentHost.h
gfx/layers/ipc/AsyncTransactionTracker.h
gfx/layers/ipc/CompositorChild.h
gfx/layers/ipc/CompositorParent.h
gfx/layers/ipc/FenceUtils.h
gfx/layers/ipc/ImageBridgeChild.cpp
gfx/layers/ipc/ShadowLayerChild.h
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/ipc/SharedBufferManagerParent.cpp
gfx/layers/ipc/SharedPlanarYCbCrImage.h
gfx/layers/ipc/SharedRGBImage.h
gfx/layers/opengl/CompositorOGL.h
gfx/layers/opengl/GLManager.cpp
gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h
gfx/layers/opengl/TextureClientOGL.h
gfx/layers/opengl/TextureHostOGL.h
--- a/gfx/layers/Compositor.h
+++ b/gfx/layers/Compositor.h
@@ -192,17 +192,17 @@ protected:
 class Compositor
 {
 protected:
   virtual ~Compositor() {}
 
 public:
   NS_INLINE_DECL_REFCOUNTING(Compositor)
 
-  Compositor(PCompositorParent* aParent = nullptr)
+  explicit Compositor(PCompositorParent* aParent = nullptr)
     : mCompositorID(0)
     , mDiagnosticTypes(DiagnosticTypes::NO_DIAGNOSTIC)
     , mParent(aParent)
     , mScreenRotation(ROTATION_0)
   {
   }
 
   virtual TemporaryRef<DataTextureSource> CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) = 0;
--- a/gfx/layers/Effects.h
+++ b/gfx/layers/Effects.h
@@ -37,17 +37,17 @@ namespace layers {
  * effects may be added by the layer or compositable. The effect chain is passed
  * to the compositor by the compositable host as a parameter to DrawQuad.
  */
 
 struct Effect
 {
   NS_INLINE_DECL_REFCOUNTING(Effect)
 
-  Effect(EffectTypes aType) : mType(aType) {}
+  explicit Effect(EffectTypes aType) : mType(aType) {}
 
   EffectTypes mType;
 
   virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) = 0;
 
 protected:
   virtual ~Effect() {}
 };
@@ -93,31 +93,31 @@ struct EffectMask : public Effect
   TextureSource* mMaskTexture;
   bool mIs3D;
   gfx::IntSize mSize;
   gfx::Matrix4x4 mMaskTransform;
 };
 
 struct EffectBlendMode : public Effect
 {
-  EffectBlendMode(gfx::CompositionOp aBlendMode)
+  explicit EffectBlendMode(gfx::CompositionOp aBlendMode)
     : Effect(EffectTypes::BLEND_MODE)
     , mBlendMode(aBlendMode)
   { }
 
   virtual const char* Name() { return "EffectBlendMode"; }
   virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
 
   gfx::CompositionOp mBlendMode;
 };
 
 // Render to a render target rather than the screen.
 struct EffectRenderTarget : public TexturedEffect
 {
-  EffectRenderTarget(CompositingRenderTarget *aRenderTarget)
+  explicit EffectRenderTarget(CompositingRenderTarget *aRenderTarget)
     : TexturedEffect(EffectTypes::RENDER_TARGET, aRenderTarget, true, gfx::Filter::LINEAR)
     , mRenderTarget(aRenderTarget)
   {}
 
   virtual const char* Name() { return "EffectRenderTarget"; }
   virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
 
   RefPtr<CompositingRenderTarget> mRenderTarget;
@@ -178,17 +178,17 @@ struct EffectComponentAlpha : public Tex
   virtual const char* Name() { return "EffectComponentAlpha"; }
 
   TextureSource* mOnBlack;
   TextureSource* mOnWhite;
 };
 
 struct EffectSolidColor : public Effect
 {
-  EffectSolidColor(const gfx::Color &aColor)
+  explicit EffectSolidColor(const gfx::Color &aColor)
     : Effect(EffectTypes::SOLID_COLOR)
     , mColor(aColor)
   {}
 
   virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
 
   gfx::Color mColor;
 };
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -52,17 +52,17 @@ class nsAutoRefTraits<nsMainThreadSource
 public:
   typedef mozilla::gfx::SourceSurface* RawRef;
 
   /**
    * The XPCOM event that will do the actual release on the main thread.
    */
   class SurfaceReleaser : public nsRunnable {
   public:
-    SurfaceReleaser(RawRef aRef) : mRef(aRef) {}
+    explicit SurfaceReleaser(RawRef aRef) : mRef(aRef) {}
     NS_IMETHOD Run() {
       mRef->Release();
       return NS_OK;
     }
     RawRef mRef;
   };
 
   static RawRef Void() { return nullptr; }
@@ -345,17 +345,17 @@ struct RemoteImageData {
  */
 class ImageContainer MOZ_FINAL : public SupportsWeakPtr<ImageContainer> {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer)
 public:
   MOZ_DECLARE_REFCOUNTED_TYPENAME(ImageContainer)
 
   enum { DISABLE_ASYNC = 0x0, ENABLE_ASYNC = 0x01 };
 
-  ImageContainer(int flag = 0);
+  explicit ImageContainer(int flag = 0);
 
   /**
    * Create an Image in one of the given formats.
    * Picks the "best" format from the list and creates an Image of that
    * format.
    * Returns null if this backend does not support any of the formats.
    * Can be called on any thread. This method takes mReentrantMonitor
    * when accessing thread-shared state.
@@ -661,17 +661,17 @@ private:
   // frames to the compositor through transactions in the main thread rather than
   // asynchronusly using the ImageBridge IPDL protocol.
   ImageClient* mImageClient;
 };
 
 class AutoLockImage
 {
 public:
-  AutoLockImage(ImageContainer *aContainer) : mContainer(aContainer) { mImage = mContainer->LockCurrentImage(); }
+  explicit AutoLockImage(ImageContainer *aContainer) : mContainer(aContainer) { mImage = mContainer->LockCurrentImage(); }
   AutoLockImage(ImageContainer *aContainer, RefPtr<gfx::SourceSurface> *aSurface) : mContainer(aContainer) {
     *aSurface = mContainer->LockCurrentAsSourceSurface(&mSize, getter_AddRefs(mImage));
   }
   ~AutoLockImage() { if (mContainer) { mContainer->UnlockCurrentImage(); } }
 
   Image* GetImage() { return mImage; }
   const gfx::IntSize &GetSize() { return mSize; }
 
@@ -816,17 +816,17 @@ public:
    * Return the number of bytes of heap memory used to store this image.
    */
   virtual uint32_t GetDataSize() { return mBufferSize; }
 
   virtual bool IsValid() { return !!mBufferSize; }
 
   virtual gfx::IntSize GetSize() { return mSize; }
 
-  PlanarYCbCrImage(BufferRecycleBin *aRecycleBin);
+  explicit PlanarYCbCrImage(BufferRecycleBin *aRecycleBin);
 
   virtual SharedPlanarYCbCrImage *AsSharedPlanarYCbCrImage() { return nullptr; }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;
--- a/gfx/layers/LayerScope.cpp
+++ b/gfx/layers/LayerScope.cpp
@@ -361,17 +361,17 @@ StaticAutoPtr<LayerScopeWebSocketManager
 /*
  * DebugGLData is the base class of
  * 1. DebugGLFrameStatusData (Frame start/end packet)
  * 2. DebugGLColorData (Color data packet)
  * 3. DebugGLTextureData (Texture data packet)
  */
 class DebugGLData: public LinkedListElement<DebugGLData> {
 public:
-    DebugGLData(Packet::DataType aDataType)
+    explicit DebugGLData(Packet::DataType aDataType)
         : mDataType(aDataType)
     { }
 
     virtual ~DebugGLData() { }
 
     Packet::DataType GetDataType() const { return mDataType; }
 
     virtual bool Write() = 0;
@@ -394,17 +394,17 @@ class DebugGLFrameStatusData : public De
 {
 public:
     DebugGLFrameStatusData(Packet::DataType aDataType,
                            int64_t aValue)
         : DebugGLData(aDataType),
           mFrameStamp(aValue)
     { }
 
-    DebugGLFrameStatusData(Packet::DataType aDataType)
+    explicit DebugGLFrameStatusData(Packet::DataType aDataType)
         : DebugGLData(aDataType),
           mFrameStamp(0)
     { }
 
     int64_t GetFrameStamp() const { return mFrameStamp; }
 
     virtual bool Write() MOZ_OVERRIDE {
         Packet packet;
@@ -542,17 +542,17 @@ public:
 protected:
     void* mLayerRef;
     uint32_t mColor;
     nsIntSize mSize;
 };
 
 class DebugGLLayersData : public DebugGLData {
 public:
-    DebugGLLayersData(UniquePtr<Packet> aPacket)
+    explicit DebugGLLayersData(UniquePtr<Packet> aPacket)
         : DebugGLData(Packet::LAYERS),
           mPacket(Move(aPacket))
     { }
 
     virtual bool Write() MOZ_OVERRIDE {
         mPacket->set_type(mDataType);
 
         if (!WriteToStream(*mPacket))
--- a/gfx/layers/LayerScope.h
+++ b/gfx/layers/LayerScope.h
@@ -36,17 +36,17 @@ public:
     static void SendLayerDump(UniquePtr<layerscope::Packet> aPacket);
     static bool CheckSendable();
     static void CleanLayer();
 };
 
 // Perform BeginFrame and EndFrame automatically
 class LayerScopeAutoFrame {
 public:
-    LayerScopeAutoFrame(int64_t aFrameStamp);
+    explicit LayerScopeAutoFrame(int64_t aFrameStamp);
     ~LayerScopeAutoFrame();
 
 private:
     static void BeginFrame(int64_t aFrameStamp);
     static void EndFrame();
 };
 
 } /* layers */
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -93,17 +93,17 @@ NotifySubdocumentInvalidationRecursive(L
     NotifySubdocumentInvalidationRecursive(child, aCallback);
   }
 
   aCallback(container, container->GetVisibleRegion());
 }
 
 struct LayerPropertiesBase : public LayerProperties
 {
-  LayerPropertiesBase(Layer* aLayer)
+  explicit LayerPropertiesBase(Layer* aLayer)
     : mLayer(aLayer)
     , mMaskLayer(nullptr)
     , mVisibleRegion(aLayer->GetVisibleRegion())
     , mInvalidRegion(aLayer->GetInvalidRegion())
     , mPostXScale(aLayer->GetPostXScale())
     , mPostYScale(aLayer->GetPostYScale())
     , mOpacity(aLayer->GetLocalOpacity())
     , mUseClipRect(!!aLayer->GetClipRect())
@@ -207,17 +207,17 @@ struct LayerPropertiesBase : public Laye
   float mPostYScale;
   float mOpacity;
   nsIntRect mClipRect;
   bool mUseClipRect;
 };
 
 struct ContainerLayerProperties : public LayerPropertiesBase
 {
-  ContainerLayerProperties(ContainerLayer* aLayer)
+  explicit ContainerLayerProperties(ContainerLayer* aLayer)
     : LayerPropertiesBase(aLayer)
     , mPreXScale(aLayer->GetPreXScale())
     , mPreYScale(aLayer->GetPreYScale())
   {
     for (Layer* child = aLayer->GetFirstChild(); child; child = child->GetNextSibling()) {
       mChildren.AppendElement(CloneLayerTreePropertiesInternal(child));
     }
   }
@@ -317,17 +317,17 @@ struct ContainerLayerProperties : public
   // The old list of children:
   nsAutoTArray<nsAutoPtr<LayerPropertiesBase>,1> mChildren;
   float mPreXScale;
   float mPreYScale;
 };
 
 struct ColorLayerProperties : public LayerPropertiesBase
 {
-  ColorLayerProperties(ColorLayer *aLayer)
+  explicit ColorLayerProperties(ColorLayer *aLayer)
     : LayerPropertiesBase(aLayer)
     , mColor(aLayer->GetColor())
   { }
 
   virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback,
                                             bool& aGeometryChanged)
   {
     ColorLayer* color = static_cast<ColorLayer*>(mLayer.get());
@@ -340,17 +340,17 @@ struct ColorLayerProperties : public Lay
     return nsIntRegion();
   }
 
   gfxRGBA mColor;
 };
 
 struct ImageLayerProperties : public LayerPropertiesBase
 {
-  ImageLayerProperties(ImageLayer* aImage)
+  explicit ImageLayerProperties(ImageLayer* aImage)
     : LayerPropertiesBase(aImage)
     , mContainer(aImage->GetContainer())
     , mFilter(aImage->GetFilter())
     , mScaleToSize(aImage->GetScaleToSize())
     , mScaleMode(aImage->GetScaleMode())
   {
   }
 
--- a/gfx/layers/RotatedBuffer.h
+++ b/gfx/layers/RotatedBuffer.h
@@ -185,17 +185,17 @@ public:
    * - ContainsVisibleBounds: the backing buffer is large enough to
    *   fit visible bounds.  May be larger.
    */
   enum BufferSizePolicy {
     SizedToVisibleBounds,
     ContainsVisibleBounds
   };
 
-  RotatedContentBuffer(BufferSizePolicy aBufferSizePolicy)
+  explicit RotatedContentBuffer(BufferSizePolicy aBufferSizePolicy)
     : mBufferProvider(nullptr)
     , mBufferProviderOnWhite(nullptr)
     , mBufferSizePolicy(aBufferSizePolicy)
   {
     MOZ_COUNT_CTOR(RotatedContentBuffer);
   }
   virtual ~RotatedContentBuffer()
   {
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -641,17 +641,17 @@ private:
   // the "ANIMATED_ZOOM" state. We only use the |mViewportScrollOffset| and
   // |mResolution| fields on this.
   CSSPoint mEndOffset;
   CSSToScreenScale mEndZoom;
 };
 
 class OverscrollSnapBackAnimation: public AsyncPanZoomAnimation {
 public:
-  OverscrollSnapBackAnimation(AsyncPanZoomController& aApzc)
+  explicit OverscrollSnapBackAnimation(AsyncPanZoomController& aApzc)
     : mApzc(aApzc)
   {
     // Make sure the initial velocity is zero. This is normally the case
     // since we've just stopped a fling, but in some corner cases involving
     // handoff it could not be.
     mApzc.mX.SetVelocity(0);
     mApzc.mY.SetVelocity(0);
   }
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -1069,18 +1069,18 @@ private:
   // Extra offset to add in SampleContentTransformForFrame for testing
   CSSPoint mTestAsyncScrollOffset;
 };
 
 class AsyncPanZoomAnimation {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AsyncPanZoomAnimation)
 
 public:
-  AsyncPanZoomAnimation(const TimeDuration& aRepaintInterval =
-                        TimeDuration::Forever())
+  explicit AsyncPanZoomAnimation(const TimeDuration& aRepaintInterval =
+                                 TimeDuration::Forever())
     : mRepaintInterval(aRepaintInterval)
   { }
 
   virtual bool Sample(FrameMetrics& aFrameMetrics,
                       const TimeDuration& aDelta) = 0;
 
   /**
    * Get the deferred tasks in |mDeferredTasks|. See |mDeferredTasks|
--- a/gfx/layers/apz/src/Axis.h
+++ b/gfx/layers/apz/src/Axis.h
@@ -30,17 +30,17 @@ class AsyncPanZoomController;
 
 /**
  * Helper class to maintain each axis of movement (X,Y) for panning and zooming.
  * Note that everything here is specific to one axis; that is, the X axis knows
  * nothing about the Y axis and vice versa.
  */
 class Axis {
 public:
-  Axis(AsyncPanZoomController* aAsyncPanZoomController);
+  explicit Axis(AsyncPanZoomController* aAsyncPanZoomController);
 
   enum Overscroll {
     // Overscroll is not happening at all.
     OVERSCROLL_NONE = 0,
     // Overscroll is happening in the negative direction. This means either to
     // the left or to the top depending on the axis.
     OVERSCROLL_MINUS,
     // Overscroll is happening in the positive direction. This means either to
@@ -241,25 +241,25 @@ protected:
 
   // Adjust a requested overscroll amount for resistance, yielding a smaller
   // actual overscroll amount.
   CSSCoord ApplyResistance(CSSCoord aOverscroll) const;
 };
 
 class AxisX : public Axis {
 public:
-  AxisX(AsyncPanZoomController* mAsyncPanZoomController);
+  explicit AxisX(AsyncPanZoomController* mAsyncPanZoomController);
   virtual CSSCoord GetPointOffset(const CSSPoint& aPoint) const;
   virtual CSSCoord GetRectLength(const CSSRect& aRect) const;
   virtual CSSCoord GetRectOffset(const CSSRect& aRect) const;
 };
 
 class AxisY : public Axis {
 public:
-  AxisY(AsyncPanZoomController* mAsyncPanZoomController);
+  explicit AxisY(AsyncPanZoomController* mAsyncPanZoomController);
   virtual CSSCoord GetPointOffset(const CSSPoint& aPoint) const;
   virtual CSSCoord GetRectLength(const CSSRect& aRect) const;
   virtual CSSCoord GetRectOffset(const CSSRect& aRect) const;
 };
 
 }
 }
 
--- a/gfx/layers/apz/src/GestureEventListener.h
+++ b/gfx/layers/apz/src/GestureEventListener.h
@@ -35,17 +35,17 @@ class AsyncPanZoomController;
  *
  * Android doesn't use this class because it has its own built-in gesture event
  * listeners that should generally be preferred.
  */
 class GestureEventListener MOZ_FINAL {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GestureEventListener)
 
-  GestureEventListener(AsyncPanZoomController* aAsyncPanZoomController);
+  explicit GestureEventListener(AsyncPanZoomController* aAsyncPanZoomController);
 
   // --------------------------------------------------------------------------
   // These methods must only be called on the controller/UI thread.
   //
 
   /**
    * General input handler for a touch event. If the touch event is not a part
    * of a gesture, then we pass it along to AsyncPanZoomController. Otherwise,
--- a/gfx/layers/basic/BasicCanvasLayer.h
+++ b/gfx/layers/basic/BasicCanvasLayer.h
@@ -17,17 +17,17 @@ class gfxContext;
 
 namespace mozilla {
 namespace layers {
 
 class BasicCanvasLayer : public CopyableCanvasLayer,
                          public BasicImplData
 {
 public:
-  BasicCanvasLayer(BasicLayerManager* aLayerManager) :
+  explicit BasicCanvasLayer(BasicLayerManager* aLayerManager) :
     CopyableCanvasLayer(aLayerManager,
                         static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
   { }
   
   virtual void SetVisibleRegion(const nsIntRegion& aRegion)
   {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
--- a/gfx/layers/basic/BasicColorLayer.cpp
+++ b/gfx/layers/basic/BasicColorLayer.cpp
@@ -21,17 +21,17 @@
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layers {
 
 class BasicColorLayer : public ColorLayer, public BasicImplData {
 public:
-  BasicColorLayer(BasicLayerManager* aLayerManager) :
+  explicit BasicColorLayer(BasicLayerManager* aLayerManager) :
     ColorLayer(aLayerManager,
                static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
   {
     MOZ_COUNT_CTOR(BasicColorLayer);
   }
 
 protected:
   virtual ~BasicColorLayer()
--- a/gfx/layers/basic/BasicCompositor.h
+++ b/gfx/layers/basic/BasicCompositor.h
@@ -35,17 +35,17 @@ public:
 
   RefPtr<gfx::DrawTarget> mDrawTarget;
   gfx::IntSize mSize;
 };
 
 class BasicCompositor : public Compositor
 {
 public:
-  BasicCompositor(nsIWidget *aWidget);
+  explicit BasicCompositor(nsIWidget *aWidget);
 
 protected:
   virtual ~BasicCompositor();
 
 public:
   virtual bool Initialize() MOZ_OVERRIDE { return true; };
 
   virtual void Destroy() MOZ_OVERRIDE;
--- a/gfx/layers/basic/BasicContainerLayer.h
+++ b/gfx/layers/basic/BasicContainerLayer.h
@@ -14,17 +14,17 @@
 #include "nsISupportsUtils.h"           // for NS_ADDREF, NS_RELEASE
 struct nsIntRect;
 
 namespace mozilla {
 namespace layers {
 
 class BasicContainerLayer : public ContainerLayer, public BasicImplData {
 public:
-  BasicContainerLayer(BasicLayerManager* aManager) :
+  explicit BasicContainerLayer(BasicLayerManager* aManager) :
     ContainerLayer(aManager,
                    static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
   {
     MOZ_COUNT_CTOR(BasicContainerLayer);
     mSupportsComponentAlphaChildren = true;
   }
 protected:
   virtual ~BasicContainerLayer();
--- a/gfx/layers/basic/BasicImageLayer.cpp
+++ b/gfx/layers/basic/BasicImageLayer.cpp
@@ -20,17 +20,17 @@
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layers {
 
 class BasicImageLayer : public ImageLayer, public BasicImplData {
 public:
-  BasicImageLayer(BasicLayerManager* aLayerManager) :
+  explicit BasicImageLayer(BasicLayerManager* aLayerManager) :
     ImageLayer(aLayerManager,
                static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST())),
     mSize(-1, -1)
   {
     MOZ_COUNT_CTOR(BasicImageLayer);
   }
 protected:
   virtual ~BasicImageLayer()
--- a/gfx/layers/basic/BasicLayers.h
+++ b/gfx/layers/basic/BasicLayers.h
@@ -51,33 +51,33 @@ public:
     BLM_INACTIVE
   };
   /**
    * Construct a BasicLayerManager which will have no default
    * target context. SetDefaultTarget or BeginTransactionWithTarget
    * must be called for any rendering to happen. ThebesLayers will not
    * be retained.
    */
-  BasicLayerManager(BasicLayerManagerType aType);
+  explicit BasicLayerManager(BasicLayerManagerType aType);
   /**
    * Construct a BasicLayerManager which will have no default
    * target context. SetDefaultTarget or BeginTransactionWithTarget
    * must be called for any rendering to happen. ThebesLayers will be
    * retained; that is, we will try to retain the visible contents of
    * ThebesLayers as cairo surfaces. We create ThebesLayer buffers by
    * creating similar surfaces to the default target context, or to
    * aWidget's GetThebesSurface if there is no default target context, or
    * to the passed-in context if there is no widget and no default
    * target context.
    * 
    * This does not keep a strong reference to the widget, so the caller
    * must ensure that the widget outlives the layer manager or call
    * ClearWidget before the widget dies.
    */
-  BasicLayerManager(nsIWidget* aWidget);
+  explicit BasicLayerManager(nsIWidget* aWidget);
 
 protected:
   virtual ~BasicLayerManager();
 
 public:
   /**
    * Set the default target context that will be used when BeginTransaction
    * is called. This can only be called outside a transaction.
--- a/gfx/layers/basic/BasicLayersImpl.h
+++ b/gfx/layers/basic/BasicLayersImpl.h
@@ -44,17 +44,17 @@ public:
 private:
   nsRefPtr<gfxContext> mContext;
 };
 
 class BasicReadbackLayer : public ReadbackLayer,
                            public BasicImplData
 {
 public:
-  BasicReadbackLayer(BasicLayerManager* aLayerManager) :
+  explicit BasicReadbackLayer(BasicLayerManager* aLayerManager) :
     ReadbackLayer(aLayerManager,
                   static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
   {
     MOZ_COUNT_CTOR(BasicReadbackLayer);
   }
 
 protected:
   virtual ~BasicReadbackLayer()
--- a/gfx/layers/basic/BasicThebesLayer.h
+++ b/gfx/layers/basic/BasicThebesLayer.h
@@ -25,17 +25,17 @@ namespace layers {
 
 class ReadbackProcessor;
 
 class BasicThebesLayer : public ThebesLayer, public BasicImplData {
 public:
   typedef RotatedContentBuffer::PaintState PaintState;
   typedef RotatedContentBuffer::ContentType ContentType;
 
-  BasicThebesLayer(BasicLayerManager* aLayerManager) :
+  explicit BasicThebesLayer(BasicLayerManager* aLayerManager) :
     ThebesLayer(aLayerManager,
                 static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST())),
     mContentClient(nullptr)
   {
     MOZ_COUNT_CTOR(BasicThebesLayer);
   }
 
 protected:
--- a/gfx/layers/client/ClientCanvasLayer.h
+++ b/gfx/layers/client/ClientCanvasLayer.h
@@ -31,17 +31,17 @@ namespace layers {
 class CompositableClient;
 class ShadowableLayer;
 
 class ClientCanvasLayer : public CopyableCanvasLayer,
                           public ClientLayer
 {
   typedef CanvasClient::CanvasClientType CanvasClientType;
 public:
-  ClientCanvasLayer(ClientLayerManager* aLayerManager) :
+  explicit ClientCanvasLayer(ClientLayerManager* aLayerManager) :
     CopyableCanvasLayer(aLayerManager,
                         static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
     , mTextureSurface(nullptr)
     , mFactory(nullptr)
   {
     MOZ_COUNT_CTOR(ClientCanvasLayer);
   }
 
--- a/gfx/layers/client/ClientColorLayer.cpp
+++ b/gfx/layers/client/ClientColorLayer.cpp
@@ -16,17 +16,17 @@
 namespace mozilla {
 namespace layers {
 
 using namespace mozilla::gfx;
 
 class ClientColorLayer : public ColorLayer, 
                          public ClientLayer {
 public:
-  ClientColorLayer(ClientLayerManager* aLayerManager) :
+  explicit ClientColorLayer(ClientLayerManager* aLayerManager) :
     ColorLayer(aLayerManager,
                static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
   {
     MOZ_COUNT_CTOR(ClientColorLayer);
   }
 
 protected:
   virtual ~ClientColorLayer()
--- a/gfx/layers/client/ClientContainerLayer.h
+++ b/gfx/layers/client/ClientContainerLayer.h
@@ -22,17 +22,17 @@ namespace mozilla {
 namespace layers {
 
 class ShadowableLayer;
 
 class ClientContainerLayer : public ContainerLayer,
                              public ClientLayer
 {
 public:
-  ClientContainerLayer(ClientLayerManager* aManager) :
+  explicit ClientContainerLayer(ClientLayerManager* aManager) :
     ContainerLayer(aManager,
                    static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
   {
     MOZ_COUNT_CTOR(ClientContainerLayer);
     mSupportsComponentAlphaChildren = true;
   }
 
 protected:
@@ -145,17 +145,17 @@ protected:
   {
     return static_cast<ClientLayerManager*>(mManager);
   }
 };
 
 class ClientRefLayer : public RefLayer,
                        public ClientLayer {
 public:
-  ClientRefLayer(ClientLayerManager* aManager) :
+  explicit ClientRefLayer(ClientLayerManager* aManager) :
     RefLayer(aManager,
              static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
   {
     MOZ_COUNT_CTOR(ClientRefLayer);
   }
 
 protected:
   virtual ~ClientRefLayer()
--- a/gfx/layers/client/ClientImageLayer.cpp
+++ b/gfx/layers/client/ClientImageLayer.cpp
@@ -21,17 +21,17 @@
 namespace mozilla {
 namespace layers {
 
 using namespace mozilla::gfx;
 
 class ClientImageLayer : public ImageLayer, 
                          public ClientLayer {
 public:
-  ClientImageLayer(ClientLayerManager* aLayerManager)
+  explicit ClientImageLayer(ClientLayerManager* aLayerManager)
     : ImageLayer(aLayerManager,
                  static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
     , mImageClientTypeContainer(CompositableType::BUFFER_UNKNOWN)
   {
     MOZ_COUNT_CTOR(ClientImageLayer);
   }
 
 protected:
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -38,17 +38,17 @@ class PLayerChild;
 class TextureClientPool;
 class SimpleTextureClientPool;
 
 class ClientLayerManager : public LayerManager
 {
   typedef nsTArray<nsRefPtr<Layer> > LayerRefArray;
 
 public:
-  ClientLayerManager(nsIWidget* aWidget);
+  explicit ClientLayerManager(nsIWidget* aWidget);
 
 protected:
   virtual ~ClientLayerManager();
 
 public:
   virtual ShadowLayerForwarder* AsShadowForwarder()
   {
     return mForwarder;
--- a/gfx/layers/client/ClientReadbackLayer.h
+++ b/gfx/layers/client/ClientReadbackLayer.h
@@ -12,17 +12,17 @@
 namespace mozilla {
 namespace layers {
 
 class ClientReadbackLayer :
   public ReadbackLayer,
   public ClientLayer
 {
 public:
-    ClientReadbackLayer(ClientLayerManager *aManager)
+  explicit ClientReadbackLayer(ClientLayerManager *aManager)
     : ReadbackLayer(aManager, nullptr)
   {
       mImplData = static_cast<ClientLayer*>(this);
   }
 
   virtual Layer* AsLayer() { return this; }
   virtual void RenderLayer() {}
 };
--- a/gfx/layers/client/ClientThebesLayer.h
+++ b/gfx/layers/client/ClientThebesLayer.h
@@ -28,18 +28,18 @@ class ShadowableLayer;
 class SpecificLayerAttributes;
 
 class ClientThebesLayer : public ThebesLayer,
                           public ClientLayer {
 public:
   typedef RotatedContentBuffer::PaintState PaintState;
   typedef RotatedContentBuffer::ContentType ContentType;
 
-  ClientThebesLayer(ClientLayerManager* aLayerManager,
-                    LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE) :
+  explicit ClientThebesLayer(ClientLayerManager* aLayerManager,
+                             LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE) :
     ThebesLayer(aLayerManager,
                 static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
                 aCreationHint),
     mContentClient(nullptr)
   {
     MOZ_COUNT_CTOR(ClientThebesLayer);
   }
 
--- a/gfx/layers/client/ClientTiledThebesLayer.h
+++ b/gfx/layers/client/ClientTiledThebesLayer.h
@@ -36,18 +36,18 @@ class SpecificLayerAttributes;
  * There is no ContentClient for tiled layers. There is a ContentHost, however.
  */
 class ClientTiledThebesLayer : public ThebesLayer,
                                public ClientLayer
 {
   typedef ThebesLayer Base;
 
 public:
-  ClientTiledThebesLayer(ClientLayerManager* const aManager,
-                         ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE);
+  explicit ClientTiledThebesLayer(ClientLayerManager* const aManager,
+                                  ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE);
 
 protected:
   ~ClientTiledThebesLayer();
 
 public:
   // Override name to distinguish it from ClientThebesLayer in layer dumps
   virtual const char* Name() const { return "TiledThebesLayer"; }
 
--- a/gfx/layers/client/CompositableClient.h
+++ b/gfx/layers/client/CompositableClient.h
@@ -118,17 +118,17 @@ private:
 class CompositableClient
 {
 protected:
   virtual ~CompositableClient();
 
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositableClient)
 
-  CompositableClient(CompositableForwarder* aForwarder, TextureFlags aFlags = TextureFlags::NO_FLAGS);
+  explicit CompositableClient(CompositableForwarder* aForwarder, TextureFlags aFlags = TextureFlags::NO_FLAGS);
 
   virtual TextureInfo GetTextureInfo() const = 0;
 
   LayersBackend GetCompositorBackendType() const;
 
   TemporaryRef<BufferTextureClient>
   CreateBufferTextureClient(gfx::SurfaceFormat aFormat,
                             gfx::IntSize aSize,
@@ -241,18 +241,18 @@ protected:
   friend class CompositableChild;
 };
 
 /**
  * Helper to call RemoveTexture at the end of a scope.
  */
 struct AutoRemoveTexture
 {
-  AutoRemoveTexture(CompositableClient* aCompositable,
-                    TextureClient* aTexture = nullptr)
+  explicit AutoRemoveTexture(CompositableClient* aCompositable,
+                             TextureClient* aTexture = nullptr)
     : mTexture(aTexture)
     , mCompositable(aCompositable)
   {}
 
   ~AutoRemoveTexture()
   {
     if (mCompositable && mTexture) {
       mCompositable->RemoveTexture(mTexture);
--- a/gfx/layers/client/ContentClient.h
+++ b/gfx/layers/client/ContentClient.h
@@ -78,17 +78,17 @@ class ContentClient : public Compositabl
 public:
   /**
    * Creates, configures, and returns a new content client. If necessary, a
    * message will be sent to the compositor to create a corresponding content
    * host.
    */
   static TemporaryRef<ContentClient> CreateContentClient(CompositableForwarder* aFwd);
 
-  ContentClient(CompositableForwarder* aForwarder)
+  explicit ContentClient(CompositableForwarder* aForwarder)
   : CompositableClient(aForwarder)
   {}
   virtual ~ContentClient()
   {}
 
 
   virtual void Clear() = 0;
   virtual RotatedContentBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
@@ -108,17 +108,17 @@ public:
 };
 
 /**
  * A ContentClient for use with OMTC.
  */
 class ContentClientRemote : public ContentClient
 {
 public:
-  ContentClientRemote(CompositableForwarder* aForwarder)
+  explicit ContentClientRemote(CompositableForwarder* aForwarder)
     : ContentClient(aForwarder)
   {}
 
   virtual void Updated(const nsIntRegion& aRegionToDraw,
                        const nsIntRegion& aVisibleRegion,
                        bool aDidSelfCopy) = 0;
 };
 
@@ -185,17 +185,17 @@ public:
  */
 // Version using new texture clients
 class ContentClientRemoteBuffer : public ContentClientRemote
                                 , protected RotatedContentBuffer
 {
   using RotatedContentBuffer::BufferRect;
   using RotatedContentBuffer::BufferRotation;
 public:
-  ContentClientRemoteBuffer(CompositableForwarder* aForwarder)
+  explicit ContentClientRemoteBuffer(CompositableForwarder* aForwarder)
     : ContentClientRemote(aForwarder)
     , RotatedContentBuffer(ContainsVisibleBounds)
     , mIsNewBuffer(false)
     , mFrontAndBackBufferDiffer(false)
     , mSurfaceFormat(gfx::SurfaceFormat::B8G8R8A8)
   {}
 
   typedef RotatedContentBuffer::PaintState PaintState;
@@ -310,17 +310,17 @@ protected:
  * The ContentHost keeps a reference to both corresponding texture hosts, in
  * response to our UpdateTextureRegion message, the compositor swaps its
  * references. In response to the compositor's reply we swap our references
  * (in SwapBuffers).
  */
 class ContentClientDoubleBuffered : public ContentClientRemoteBuffer
 {
 public:
-  ContentClientDoubleBuffered(CompositableForwarder* aFwd)
+  explicit ContentClientDoubleBuffered(CompositableForwarder* aFwd)
     : ContentClientRemoteBuffer(aFwd)
   {
     mTextureInfo.mCompositableType = CompositableType::CONTENT_DOUBLE;
   }
   virtual ~ContentClientDoubleBuffered() {}
 
   virtual void Clear() MOZ_OVERRIDE
   {
@@ -369,17 +369,17 @@ private:
  * done updating. It is not safe for the compositor to use the corresponding
  * TextureHost's memory directly, it must upload it to video memory of some
  * kind. We are free to modify the TextureClient once we receive reply from
  * the compositor.
  */
 class ContentClientSingleBuffered : public ContentClientRemoteBuffer
 {
 public:
-  ContentClientSingleBuffered(CompositableForwarder* aFwd)
+  explicit ContentClientSingleBuffered(CompositableForwarder* aFwd)
     : ContentClientRemoteBuffer(aFwd)
   {
     mTextureInfo.mCompositableType = CompositableType::CONTENT_SINGLE;
   }
   virtual ~ContentClientSingleBuffered() {}
 
   virtual void FinalizeFrame(const nsIntRegion& aRegionToDraw) MOZ_OVERRIDE;
 };
@@ -389,17 +389,17 @@ public:
  * used to update the host-side texture. The ownership of the buffers is
  * passed to the host side during the transaction, and we need to create
  * new ones each frame.
  */
 class ContentClientIncremental : public ContentClientRemote
                                , public BorrowDrawTarget
 {
 public:
-  ContentClientIncremental(CompositableForwarder* aFwd)
+  explicit ContentClientIncremental(CompositableForwarder* aFwd)
     : ContentClientRemote(aFwd)
     , mContentType(gfxContentType::COLOR_ALPHA)
     , mHasBuffer(false)
     , mHasBufferOnWhite(false)
   {
     mTextureInfo.mCompositableType = CompositableType::BUFFER_CONTENT_INC;
   }
 
--- a/gfx/layers/client/SimpleTiledContentClient.h
+++ b/gfx/layers/client/SimpleTiledContentClient.h
@@ -158,18 +158,18 @@ private:
 };
 
 class SimpleClientTiledThebesLayer : public ThebesLayer,
                                      public ClientLayer
 {
   typedef ThebesLayer Base;
 
 public:
-  SimpleClientTiledThebesLayer(ClientLayerManager* const aManager,
-                               ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE);
+  explicit SimpleClientTiledThebesLayer(ClientLayerManager* const aManager,
+                                        ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE);
 protected:
   ~SimpleClientTiledThebesLayer();
 
 public:
   // Thebes Layer
   virtual Layer* AsLayer() { return this; }
   virtual void InvalidateRegion(const nsIntRegion& aRegion) {
     mInvalidRegion.Or(mInvalidRegion, aRegion);
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -132,17 +132,17 @@ protected:
  * responsibility of the compositable (which would use two Texture pairs).
  * In order to send several different buffers to the compositor side, use
  * several TextureClients.
  */
 class TextureClient
   : public AtomicRefCountedWithFinalize<TextureClient>
 {
 public:
-  TextureClient(TextureFlags aFlags = TextureFlags::DEFAULT);
+  explicit TextureClient(TextureFlags aFlags = TextureFlags::DEFAULT);
   virtual ~TextureClient();
 
   // Creates and allocates a TextureClient usable with Moz2D.
   static TemporaryRef<TextureClient>
   CreateForDrawing(ISurfaceAllocator* aAllocator,
                    gfx::SurfaceFormat aFormat,
                    gfx::IntSize aSize,
                    gfx::BackendType aMoz2dBackend,
@@ -460,17 +460,17 @@ protected:
 };
 
 /**
  * Task that releases TextureClient pointer on a specified thread.
  */
 class TextureClientReleaseTask : public Task
 {
 public:
-    TextureClientReleaseTask(TextureClient* aClient)
+    explicit TextureClientReleaseTask(TextureClient* aClient)
         : mTextureClient(aClient) {
     }
 
     virtual void Run() MOZ_OVERRIDE
     {
         mTextureClient = nullptr;
     }
 
@@ -615,17 +615,17 @@ protected:
 };
 
 /**
  * A TextureClient implementation to share SurfaceStream.
  */
 class StreamTextureClient : public TextureClient
 {
 public:
-  StreamTextureClient(TextureFlags aFlags);
+  explicit StreamTextureClient(TextureFlags aFlags);
 
 protected:
   ~StreamTextureClient();
 
 public:
   virtual bool IsAllocated() const MOZ_OVERRIDE;
 
   virtual bool Lock(OpenMode mode) MOZ_OVERRIDE;
@@ -664,17 +664,17 @@ protected:
   RefPtr<gl::SurfaceStream> mStream;
   RefPtr<gl::GLContext> mGL; // Just for reference holding.
 };
 
 struct TextureClientAutoUnlock
 {
   TextureClient* mTexture;
 
-  TextureClientAutoUnlock(TextureClient* aTexture)
+  explicit TextureClientAutoUnlock(TextureClient* aTexture)
   : mTexture(aTexture) {}
 
   ~TextureClientAutoUnlock()
   {
     mTexture->Unlock();
   }
 };
 
@@ -683,16 +683,16 @@ class KeepAlive
 public:
   virtual ~KeepAlive() {}
 };
 
 template<typename T>
 class TKeepAlive : public KeepAlive
 {
 public:
-  TKeepAlive(T* aData) : mData(aData) {}
+  explicit TKeepAlive(T* aData) : mData(aData) {}
 protected:
   RefPtr<T> mData;
 };
 
 }
 }
 #endif
--- a/gfx/layers/client/TiledContentClient.h
+++ b/gfx/layers/client/TiledContentClient.h
@@ -92,17 +92,17 @@ private:
 
 class gfxShmSharedReadLock : public gfxSharedReadLock {
 private:
   struct ShmReadLockInfo {
     int32_t readCount;
   };
 
 public:
-  gfxShmSharedReadLock(ISurfaceAllocator* aAllocator);
+  explicit gfxShmSharedReadLock(ISurfaceAllocator* aAllocator);
 
 protected:
   ~gfxShmSharedReadLock();
 
 public:
   virtual int32_t ReadLock() MOZ_OVERRIDE;
 
   virtual int32_t ReadUnlock() MOZ_OVERRIDE;
--- a/gfx/layers/composite/AsyncCompositionManager.h
+++ b/gfx/layers/composite/AsyncCompositionManager.h
@@ -23,18 +23,18 @@ namespace layers {
 
 class AsyncPanZoomController;
 class Layer;
 class LayerManagerComposite;
 class AutoResolveRefLayers;
 
 // Represents (affine) transforms that are calculated from a content view.
 struct ViewTransform {
-  ViewTransform(ParentLayerToScreenScale aScale = ParentLayerToScreenScale(),
-                ScreenPoint aTranslation = ScreenPoint())
+  explicit ViewTransform(ParentLayerToScreenScale aScale = ParentLayerToScreenScale(),
+                         ScreenPoint aTranslation = ScreenPoint())
     : mScale(aScale)
     , mTranslation(aTranslation)
   {}
 
   operator gfx::Matrix4x4() const
   {
     return
       gfx::Matrix4x4().Scale(mScale.scale, mScale.scale, 1)
@@ -71,17 +71,17 @@ class AsyncCompositionManager MOZ_FINAL
 {
   friend class AutoResolveRefLayers;
   ~AsyncCompositionManager()
   {
   }
 public:
   NS_INLINE_DECL_REFCOUNTING(AsyncCompositionManager)
 
-  AsyncCompositionManager(LayerManagerComposite* aManager)
+  explicit AsyncCompositionManager(LayerManagerComposite* aManager)
     : mLayerManager(aManager)
     , mIsFirstPaint(false)
     , mLayersUpdated(false)
     , mReadyForCompose(true)
   {
   }
 
   /**
@@ -202,17 +202,17 @@ private:
   // after a layers update has it set. It is cleared after that first composition.
   bool mLayersUpdated;
 
   bool mReadyForCompose;
 };
 
 class MOZ_STACK_CLASS AutoResolveRefLayers {
 public:
-  AutoResolveRefLayers(AsyncCompositionManager* aManager) : mManager(aManager)
+  explicit AutoResolveRefLayers(AsyncCompositionManager* aManager) : mManager(aManager)
   {
     if (mManager) {
       mManager->ResolveRefLayers();
     }
   }
 
   ~AutoResolveRefLayers()
   {
--- a/gfx/layers/composite/CanvasLayerComposite.h
+++ b/gfx/layers/composite/CanvasLayerComposite.h
@@ -23,17 +23,17 @@ class CompositableHost;
 // Canvas layers use ImageHosts (but CanvasClients) because compositing a
 // canvas is identical to compositing an image.
 class ImageHost;
 
 class CanvasLayerComposite : public CanvasLayer,
                              public LayerComposite
 {
 public:
-  CanvasLayerComposite(LayerManagerComposite* aManager);
+  explicit CanvasLayerComposite(LayerManagerComposite* aManager);
 
 protected:
   virtual ~CanvasLayerComposite();
 
 public:
   // CanvasLayer impl
   virtual void Initialize(const Data& aData) MOZ_OVERRIDE
   {
--- a/gfx/layers/composite/ColorLayerComposite.h
+++ b/gfx/layers/composite/ColorLayerComposite.h
@@ -18,17 +18,17 @@ namespace mozilla {
 namespace layers {
 
 class CompositableHost;
 
 class ColorLayerComposite : public ColorLayer,
                             public LayerComposite
 {
 public:
-  ColorLayerComposite(LayerManagerComposite *aManager)
+  explicit ColorLayerComposite(LayerManagerComposite *aManager)
     : ColorLayer(aManager, nullptr)
     , LayerComposite(aManager)
   {
     MOZ_COUNT_CTOR(ColorLayerComposite);
     mImplData = static_cast<LayerComposite*>(this);
   }
 
 protected:
--- a/gfx/layers/composite/CompositableHost.h
+++ b/gfx/layers/composite/CompositableHost.h
@@ -83,17 +83,17 @@ public:
  */
 class CompositableHost
 {
 protected:
   virtual ~CompositableHost();
 
 public:
   NS_INLINE_DECL_REFCOUNTING(CompositableHost)
-  CompositableHost(const TextureInfo& aTextureInfo);
+  explicit CompositableHost(const TextureInfo& aTextureInfo);
 
   static TemporaryRef<CompositableHost> Create(const TextureInfo& aTextureInfo);
 
   virtual CompositableType GetType() = 0;
 
   virtual CompositableBackendSpecificData* GetCompositableBackendSpecificData()
   {
     return mBackendData;
@@ -299,17 +299,17 @@ protected:
   uint32_t mFlashCounter; // used when the pref "layers.flash-borders" is true.
   bool mAttached;
   bool mKeepAttached;
 };
 
 class AutoLockCompositableHost MOZ_FINAL
 {
 public:
-  AutoLockCompositableHost(CompositableHost* aHost)
+  explicit AutoLockCompositableHost(CompositableHost* aHost)
     : mHost(aHost)
   {
     mSucceeded = mHost->Lock();
   }
 
   ~AutoLockCompositableHost()
   {
     if (mSucceeded) {
--- a/gfx/layers/composite/ContainerLayerComposite.h
+++ b/gfx/layers/composite/ContainerLayerComposite.h
@@ -48,17 +48,17 @@ class ContainerLayerComposite : public C
                                              const nsIntRect& aClipRect);
   template<class ContainerT>
   friend RefPtr<CompositingRenderTarget>
   CreateTemporaryTarget(ContainerT* aContainer,
                         LayerManagerComposite* aManager,
                         const nsIntRect& aClipRect);
 
 public:
-  ContainerLayerComposite(LayerManagerComposite *aManager);
+  explicit ContainerLayerComposite(LayerManagerComposite *aManager);
 
 protected:
   ~ContainerLayerComposite();
 
 public:
   // LayerComposite Implementation
   virtual Layer* GetLayer() MOZ_OVERRIDE { return this; }
 
@@ -112,17 +112,17 @@ class RefLayerComposite : public RefLaye
                                              const nsIntRect& aClipRect);
   template<class ContainerT>
   friend RefPtr<CompositingRenderTarget>
   CreateTemporaryTarget(ContainerT* aContainer,
                         LayerManagerComposite* aManager,
                         const nsIntRect& aClipRect);
 
 public:
-  RefLayerComposite(LayerManagerComposite *aManager);
+  explicit RefLayerComposite(LayerManagerComposite *aManager);
 
 protected:
   ~RefLayerComposite();
 
 public:
   /** LayerOGL implementation */
   Layer* GetLayer() MOZ_OVERRIDE { return this; }
 
--- a/gfx/layers/composite/ContentHost.h
+++ b/gfx/layers/composite/ContentHost.h
@@ -63,17 +63,17 @@ public:
                             const nsIntRegion& aUpdated,
                             const nsIntRegion& aOldValidRegionBack,
                             nsIntRegion* aUpdatedRegionBack) = 0;
 
   virtual void SetPaintWillResample(bool aResample) { mPaintWillResample = aResample; }
   bool PaintWillResample() { return mPaintWillResample; }
 
 protected:
-  ContentHost(const TextureInfo& aTextureInfo)
+  explicit ContentHost(const TextureInfo& aTextureInfo)
     : CompositableHost(aTextureInfo)
     , mPaintWillResample(false)
   {}
 
   bool mPaintWillResample;
 };
 
 /**
@@ -88,17 +88,17 @@ protected:
  * they are recreated or the ContentHost dies.
  */
 class ContentHostBase : public ContentHost
 {
 public:
   typedef RotatedContentBuffer::ContentType ContentType;
   typedef RotatedContentBuffer::PaintState PaintState;
 
-  ContentHostBase(const TextureInfo& aTextureInfo);
+  explicit ContentHostBase(const TextureInfo& aTextureInfo);
   virtual ~ContentHostBase();
 
   virtual void Composite(EffectChain& aEffectChain,
                          float aOpacity,
                          const gfx::Matrix4x4& aTransform,
                          const gfx::Filter& aFilter,
                          const gfx::Rect& aClipRect,
                          const nsIntRegion* aVisibleRegion = nullptr);
@@ -122,17 +122,17 @@ protected:
 
 /**
  * Shared ContentHostBase implementation for content hosts that
  * use up to two TextureHosts.
  */
 class ContentHostTexture : public ContentHostBase
 {
 public:
-  ContentHostTexture(const TextureInfo& aTextureInfo)
+  explicit ContentHostTexture(const TextureInfo& aTextureInfo)
     : ContentHostBase(aTextureInfo)
     , mLocked(false)
   { }
 
   virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
 
 #ifdef MOZ_DUMP_PAINTING
   virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE;
@@ -196,17 +196,17 @@ protected:
 /**
  * Double buffering is implemented by swapping the front and back TextureHosts.
  * We assume that whenever we use double buffering, then we have
  * render-to-texture and thus no texture upload to do.
  */
 class ContentHostDoubleBuffered : public ContentHostTexture
 {
 public:
-  ContentHostDoubleBuffered(const TextureInfo& aTextureInfo)
+  explicit ContentHostDoubleBuffered(const TextureInfo& aTextureInfo)
     : ContentHostTexture(aTextureInfo)
   {}
 
   virtual ~ContentHostDoubleBuffered() {}
 
   virtual CompositableType GetType() { return CompositableType::CONTENT_DOUBLE; }
 
   virtual bool UpdateThebes(const ThebesBufferData& aData,
@@ -220,17 +220,17 @@ protected:
 
 /**
  * Single buffered, therefore we must synchronously upload the image from the
  * TextureHost in the layers transaction (i.e., in UpdateThebes).
  */
 class ContentHostSingleBuffered : public ContentHostTexture
 {
 public:
-  ContentHostSingleBuffered(const TextureInfo& aTextureInfo)
+  explicit ContentHostSingleBuffered(const TextureInfo& aTextureInfo)
     : ContentHostTexture(aTextureInfo)
   {}
   virtual ~ContentHostSingleBuffered() {}
 
   virtual CompositableType GetType() { return CompositableType::CONTENT_SINGLE; }
 
   virtual bool UpdateThebes(const ThebesBufferData& aData,
                             const nsIntRegion& aUpdated,
@@ -246,17 +246,17 @@ public:
  * free them once texture upload is complete.
  *
  * Delays texture uploads until the next composite to
  * avoid blocking the main thread.
  */
 class ContentHostIncremental : public ContentHostBase
 {
 public:
-  ContentHostIncremental(const TextureInfo& aTextureInfo);
+  explicit ContentHostIncremental(const TextureInfo& aTextureInfo);
   ~ContentHostIncremental();
 
   virtual CompositableType GetType() { return CompositableType::BUFFER_CONTENT_INC; }
 
   virtual LayerRenderState GetRenderState() MOZ_OVERRIDE { return LayerRenderState(); }
 
   virtual bool CreatedIncrementalTexture(ISurfaceAllocator* aAllocator,
                                          const TextureInfo& aTextureInfo,
--- a/gfx/layers/composite/FPSCounter.h
+++ b/gfx/layers/composite/FPSCounter.h
@@ -53,17 +53,17 @@ const int kMaxFrames = 2400;
  * To enable printing histogram data to logcat,
  * enable layers.acceleration.draw-fps.print-histogram
  *
  * Use the HasNext(), GetNextTimeStamp() like an iterator to read the data,
  * backwards in time. This abstracts away the mechanics of reading the data.
  */
 class FPSCounter {
 public:
-  FPSCounter(const char* aName);
+  explicit FPSCounter(const char* aName);
   ~FPSCounter();
 
   void AddFrame(TimeStamp aTimestamp);
   double AddFrameAndGetFps(TimeStamp aTimestamp);
   double GetFPS(TimeStamp aTimestamp);
 
 private:
   void      Init();
--- a/gfx/layers/composite/ImageHost.h
+++ b/gfx/layers/composite/ImageHost.h
@@ -35,17 +35,17 @@ class ISurfaceAllocator;
 struct EffectChain;
 
 /**
  * ImageHost. Works with ImageClientSingle and ImageClientBuffered
  */
 class ImageHost : public CompositableHost
 {
 public:
-  ImageHost(const TextureInfo& aTextureInfo);
+  explicit ImageHost(const TextureInfo& aTextureInfo);
   ~ImageHost();
 
   virtual CompositableType GetType() { return mTextureInfo.mCompositableType; }
 
   virtual void Composite(EffectChain& aEffectChain,
                          float aOpacity,
                          const gfx::Matrix4x4& aTransform,
                          const gfx::Filter& aFilter,
--- a/gfx/layers/composite/ImageLayerComposite.h
+++ b/gfx/layers/composite/ImageLayerComposite.h
@@ -26,17 +26,17 @@ class ImageHost;
 class Layer;
 
 class ImageLayerComposite : public ImageLayer,
                             public LayerComposite
 {
   typedef gl::TextureImage TextureImage;
 
 public:
-  ImageLayerComposite(LayerManagerComposite* aManager);
+  explicit ImageLayerComposite(LayerManagerComposite* aManager);
 
 protected:
   virtual ~ImageLayerComposite();
 
 public:
   virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
 
   virtual void Disconnect() MOZ_OVERRIDE;
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -68,17 +68,17 @@ struct FPSState;
 
 class LayerManagerComposite : public LayerManager
 {
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::IntSize IntSize;
   typedef mozilla::gfx::SurfaceFormat SurfaceFormat;
 
 public:
-  LayerManagerComposite(Compositor* aCompositor);
+  explicit LayerManagerComposite(Compositor* aCompositor);
   ~LayerManagerComposite();
 
   virtual void Destroy() MOZ_OVERRIDE;
 
   /**
    * return True if initialization was succesful, false when it was not.
    */
   bool Initialize();
@@ -310,17 +310,17 @@ private:
  * Mostly, layers are updated during the layers transaction. This is done from
  * CompositableClient to CompositableHost without interacting with the layer.
  *
  * A reference to the Compositor is stored in LayerManagerComposite.
  */
 class LayerComposite
 {
 public:
-  LayerComposite(LayerManagerComposite* aManager);
+  explicit LayerComposite(LayerManagerComposite* aManager);
 
   virtual ~LayerComposite();
 
   virtual LayerComposite* GetFirstChildComposite()
   {
     return nullptr;
   }
 
--- a/gfx/layers/composite/TextRenderer.h
+++ b/gfx/layers/composite/TextRenderer.h
@@ -17,17 +17,17 @@ class Compositor;
 
 class TextRenderer
 {
   ~TextRenderer();
 
 public:
   NS_INLINE_DECL_REFCOUNTING(TextRenderer)
 
-  TextRenderer(Compositor *aCompositor)
+  explicit TextRenderer(Compositor *aCompositor)
     : mCompositor(aCompositor)
   {
   }
 
   void RenderText(const std::string& aText, const gfx::IntPoint& aOrigin,
                   const gfx::Matrix4x4& aTransform, uint32_t aTextSize,
                   uint32_t aTargetPixelWidth);
 
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -66,17 +66,17 @@ namespace layers {
 
 /**
  * TextureParent is the host-side IPDL glue between TextureClient and TextureHost.
  * It is an IPDL actor just like LayerParent, CompositableParent, etc.
  */
 class TextureParent : public PTextureParent
 {
 public:
-  TextureParent(CompositableParentManager* aManager);
+  explicit TextureParent(CompositableParentManager* aManager);
 
   ~TextureParent();
 
   bool Init(const SurfaceDescriptor& aSharedData,
             const TextureFlags& aFlags);
 
   void CompositorRecycle();
 
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -281,17 +281,17 @@ class TextureHost
    *
    * Here goes the shut-down code that uses virtual methods.
    * Must only be called by Release().
    */
   void Finalize();
 
   friend class AtomicRefCountedWithFinalize<TextureHost>;
 public:
-  TextureHost(TextureFlags aFlags);
+  explicit TextureHost(TextureFlags aFlags);
 
 protected:
   virtual ~TextureHost();
 
 public:
   /**
    * Factory method.
    */
@@ -647,17 +647,17 @@ protected:
   gl::SurfaceStream* mStream;
   RefPtr<NewTextureSource> mTextureSource;
   RefPtr<DataTextureSource> mDataTextureSource;
 };
 
 class MOZ_STACK_CLASS AutoLockTextureHost
 {
 public:
-  AutoLockTextureHost(TextureHost* aTexture)
+  explicit AutoLockTextureHost(TextureHost* aTexture)
     : mTexture(aTexture)
   {
     mLocked = mTexture ? mTexture->Lock() : false;
   }
 
   ~AutoLockTextureHost()
   {
     if (mTexture && mLocked) {
@@ -674,17 +674,17 @@ private:
 
 /**
  * This can be used as an offscreen rendering target by the compositor, and
  * subsequently can be used as a source by the compositor.
  */
 class CompositingRenderTarget : public TextureSource
 {
 public:
-  CompositingRenderTarget(const gfx::IntPoint& aOrigin)
+  explicit CompositingRenderTarget(const gfx::IntPoint& aOrigin)
     : mOrigin(aOrigin)
   {}
   virtual ~CompositingRenderTarget() {}
 
 #ifdef MOZ_DUMP_PAINTING
   virtual TemporaryRef<gfx::DataSourceSurface> Dump(Compositor* aCompositor) { return nullptr; }
 #endif
 
--- a/gfx/layers/composite/ThebesLayerComposite.h
+++ b/gfx/layers/composite/ThebesLayerComposite.h
@@ -32,17 +32,17 @@ namespace layers {
 class CompositableHost;
 class ContentHost;
 class TiledLayerComposer;
 
 class ThebesLayerComposite : public ThebesLayer,
                              public LayerComposite
 {
 public:
-  ThebesLayerComposite(LayerManagerComposite *aManager);
+  explicit ThebesLayerComposite(LayerManagerComposite *aManager);
 
 protected:
   virtual ~ThebesLayerComposite();
 
 public:
   virtual void Disconnect() MOZ_OVERRIDE;
 
   virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
--- a/gfx/layers/composite/TiledContentHost.h
+++ b/gfx/layers/composite/TiledContentHost.h
@@ -184,17 +184,17 @@ private:
  * point, for double-buffered tiles we unlock and discard the last composited
  * buffer after compositing a new one. Rendering takes us to RenderTile which
  * is similar to Composite for non-tiled ContentHosts.
  */
 class TiledContentHost : public ContentHost,
                          public TiledLayerComposer
 {
 public:
-  TiledContentHost(const TextureInfo& aTextureInfo);
+  explicit TiledContentHost(const TextureInfo& aTextureInfo);
 
 protected:
   ~TiledContentHost();
 
 public:
   virtual LayerRenderState GetRenderState() MOZ_OVERRIDE
   {
     return LayerRenderState();
--- a/gfx/layers/ipc/AsyncTransactionTracker.h
+++ b/gfx/layers/ipc/AsyncTransactionTracker.h
@@ -185,17 +185,17 @@ protected:
   static std::map<uint64_t, AsyncTransactionTrackersHolder*> sTrackersHolders;
 };
 
 /**
  * FenceDeliveryTracker puts off releasing a Fence until a transaction complete.
  */
 class FenceDeliveryTracker : public AsyncTransactionTracker {
 public:
-  FenceDeliveryTracker(FenceHandle& aFenceHandle)
+  explicit FenceDeliveryTracker(FenceHandle& aFenceHandle)
     : mFenceHandle(aFenceHandle)
   {
     MOZ_COUNT_CTOR(FenceDeliveryTracker);
   }
 
 protected:
   ~FenceDeliveryTracker()
   {
--- a/gfx/layers/ipc/CompositorChild.h
+++ b/gfx/layers/ipc/CompositorChild.h
@@ -36,17 +36,17 @@ class ClientLayerManager;
 class CompositorParent;
 struct FrameMetrics;
 
 class CompositorChild MOZ_FINAL : public PCompositorChild
 {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorChild)
 
 public:
-  CompositorChild(ClientLayerManager *aLayerManager);
+  explicit CompositorChild(ClientLayerManager *aLayerManager);
 
   void Destroy();
 
   /**
    * Lookup the FrameMetrics shared by the compositor process with the
    * associated FrameMetrics::ViewID. The returned FrameMetrics is used
    * in progressive paint calculations.
    */
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -88,19 +88,19 @@ private:
 };
 
 class CompositorParent : public PCompositorParent,
                          public ShadowLayersManager
 {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorParent)
 
 public:
-  CompositorParent(nsIWidget* aWidget,
-                   bool aUseExternalSurfaceSize = false,
-                   int aSurfaceWidth = -1, int aSurfaceHeight = -1);
+  explicit CompositorParent(nsIWidget* aWidget,
+                            bool aUseExternalSurfaceSize = false,
+                            int aSurfaceWidth = -1, int aSurfaceHeight = -1);
 
   // IToplevelProtocol::CloneToplevel()
   virtual IToplevelProtocol*
   CloneToplevel(const InfallibleTArray<mozilla::ipc::ProtocolFdMapping>& aFds,
                 base::ProcessHandle aPeerProcess,
                 mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
 
   virtual bool RecvRequestOverfill() MOZ_OVERRIDE;
--- a/gfx/layers/ipc/FenceUtils.h
+++ b/gfx/layers/ipc/FenceUtils.h
@@ -18,24 +18,24 @@
 #else
 namespace mozilla {
 namespace layers {
 
 struct FenceHandleFromChild;
 
 struct FenceHandle {
   FenceHandle() {}
-  FenceHandle(const FenceHandleFromChild& aFenceHandle) {}
+  explicit FenceHandle(const FenceHandleFromChild& aFenceHandle) {}
   bool operator==(const FenceHandle&) const { return false; }
   bool IsValid() const { return false; }
 };
 
 struct FenceHandleFromChild {
   FenceHandleFromChild() {}
-  FenceHandleFromChild(const FenceHandle& aFence) {}
+  explicit FenceHandleFromChild(const FenceHandle& aFence) {}
   bool operator==(const FenceHandle&) const { return false; }
   bool operator==(const FenceHandleFromChild&) const { return false; }
   bool IsValid() const { return false; }
 };
 
 } // namespace layers
 } // namespace mozilla
 #endif // MOZ_WIDGET_GONK && ANDROID_VERSION >= 17
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -96,17 +96,17 @@ struct CompositableTransaction
   }
 
   OpVector mOperations;
   bool mSwapRequired;
   bool mFinished;
 };
 
 struct AutoEndTransaction {
-  AutoEndTransaction(CompositableTransaction* aTxn) : mTxn(aTxn) {}
+  explicit AutoEndTransaction(CompositableTransaction* aTxn) : mTxn(aTxn) {}
   ~AutoEndTransaction() { mTxn->End(); }
   CompositableTransaction* mTxn;
 };
 
 void
 ImageBridgeChild::UseTexture(CompositableClient* aCompositable,
                              TextureClient* aTexture)
 {
@@ -459,17 +459,17 @@ ImageBridgeChild::BeginTransaction()
   MOZ_ASSERT(!mShuttingDown);
   MOZ_ASSERT(mTxn->Finished(), "uncommitted txn?");
   mTxn->Begin();
 }
 
 class MOZ_STACK_CLASS AutoRemoveTextures
 {
 public:
-  AutoRemoveTextures(ImageBridgeChild* aImageBridge)
+  explicit AutoRemoveTextures(ImageBridgeChild* aImageBridge)
     : mImageBridge(aImageBridge) {}
 
   ~AutoRemoveTextures()
   {
     mImageBridge->RemoveTexturesIfNecessary();
   }
 private:
   ImageBridgeChild* mImageBridge;
--- a/gfx/layers/ipc/ShadowLayerChild.h
+++ b/gfx/layers/ipc/ShadowLayerChild.h
@@ -15,17 +15,17 @@
 namespace mozilla {
 namespace layers {
 
 class ShadowableLayer;
 
 class ShadowLayerChild : public PLayerChild
 {
 public:
-  ShadowLayerChild(ShadowableLayer* aLayer);
+  explicit ShadowLayerChild(ShadowableLayer* aLayer);
   virtual ~ShadowLayerChild();
 
   ShadowableLayer* layer() const { return mLayer; }
 
 protected:
   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
 private:
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -149,17 +149,17 @@ private:
   bool mOpen;
   bool mRotationChanged;
 
   // disabled
   Transaction(const Transaction&);
   Transaction& operator=(const Transaction&);
 };
 struct AutoTxnEnd {
-  AutoTxnEnd(Transaction* aTxn) : mTxn(aTxn) {}
+  explicit AutoTxnEnd(Transaction* aTxn) : mTxn(aTxn) {}
   ~AutoTxnEnd() { mTxn->End(); }
   Transaction* mTxn;
 };
 
 void
 CompositableForwarder::IdentifyTextureHost(const TextureFactoryIdentifier& aIdentifier)
 {
   mTextureFactoryIdentifier = aIdentifier;
--- a/gfx/layers/ipc/SharedBufferManagerParent.cpp
+++ b/gfx/layers/ipc/SharedBufferManagerParent.cpp
@@ -103,17 +103,17 @@ void InitGralloc() {
 }
 
 /**
  * Task that deletes SharedBufferManagerParent on a specified thread.
  */
 class DeleteSharedBufferManagerParentTask : public Task
 {
 public:
-    DeleteSharedBufferManagerParentTask(UniquePtr<SharedBufferManagerParent> aSharedBufferManager)
+    explicit DeleteSharedBufferManagerParentTask(UniquePtr<SharedBufferManagerParent> aSharedBufferManager)
         : mSharedBufferManager(Move(aSharedBufferManager)) {
     }
     virtual void Run() MOZ_OVERRIDE {}
 private:
     UniquePtr<SharedBufferManagerParent> mSharedBufferManager;
 };
 
 SharedBufferManagerParent::SharedBufferManagerParent(Transport* aTransport, base::ProcessId aOwner, base::Thread* aThread)
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.h
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.h
@@ -23,17 +23,17 @@ class ImageClient;
 class ISurfaceAllocator;
 class SurfaceDescriptor;
 class TextureClient;
 
 class SharedPlanarYCbCrImage : public PlanarYCbCrImage
                              , public ISharedImage
 {
 public:
-  SharedPlanarYCbCrImage(ImageClient* aCompositable);
+  explicit SharedPlanarYCbCrImage(ImageClient* aCompositable);
 
 protected:
   ~SharedPlanarYCbCrImage();
 
 public:
   virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
   virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
   virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
--- a/gfx/layers/ipc/SharedRGBImage.h
+++ b/gfx/layers/ipc/SharedRGBImage.h
@@ -35,17 +35,17 @@ already_AddRefed<Image> CreateSharedRGBI
 /**
  * Stores RGB data in shared memory
  * It is assumed that the image width and stride are equal
  */
 class SharedRGBImage : public Image
                      , public ISharedImage
 {
 public:
-  SharedRGBImage(ImageClient* aCompositable);
+  explicit SharedRGBImage(ImageClient* aCompositable);
 
 protected:
   ~SharedRGBImage();
 
 public:
   virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
 
   virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
--- a/gfx/layers/opengl/CompositorOGL.h
+++ b/gfx/layers/opengl/CompositorOGL.h
@@ -80,17 +80,17 @@ public:
 
 /**
  * Agressively reuses textures. One gl texture per texture unit in total.
  * So far this hasn't shown the best results on b2g.
  */
 class PerUnitTexturePoolOGL : public CompositorTexturePoolOGL
 {
 public:
-  PerUnitTexturePoolOGL(gl::GLContext* aGL)
+  explicit PerUnitTexturePoolOGL(gl::GLContext* aGL)
   : mTextureTarget(0) // zero is never a valid texture target
   , mGL(aGL)
   {}
 
   virtual ~PerUnitTexturePoolOGL()
   {
     DestroyTextures();
   }
@@ -119,17 +119,17 @@ protected:
  * deleted.
  * This strategy seems to work well with gralloc textures because destroying
  * unused textures which are bound to gralloc buffers let drivers know that it
  * can unlock the gralloc buffers.
  */
 class PerFrameTexturePoolOGL : public CompositorTexturePoolOGL
 {
 public:
-  PerFrameTexturePoolOGL(gl::GLContext* aGL)
+  explicit PerFrameTexturePoolOGL(gl::GLContext* aGL)
   : mTextureTarget(0) // zero is never a valid texture target
   , mGL(aGL)
   {}
 
   virtual ~PerFrameTexturePoolOGL()
   {
     DestroyTextures();
   }
@@ -157,18 +157,18 @@ protected:
 class CompositorOGL MOZ_FINAL : public Compositor
 {
   typedef mozilla::gl::GLContext GLContext;
 
   friend class GLManagerCompositor;
 
   std::map<ShaderConfigOGL, ShaderProgramOGL*> mPrograms;
 public:
-  CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1,
-                bool aUseExternalSurfaceSize = false);
+  explicit CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1,
+                         bool aUseExternalSurfaceSize = false);
 
 protected:
   virtual ~CompositorOGL();
 
 public:
   virtual TemporaryRef<DataTextureSource>
   CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) MOZ_OVERRIDE;
 
--- a/gfx/layers/opengl/GLManager.cpp
+++ b/gfx/layers/opengl/GLManager.cpp
@@ -18,17 +18,17 @@
 using namespace mozilla::gl;
 
 namespace mozilla {
 namespace layers {
 
 class GLManagerCompositor : public GLManager
 {
 public:
-  GLManagerCompositor(CompositorOGL* aCompositor)
+  explicit GLManagerCompositor(CompositorOGL* aCompositor)
     : mImpl(aCompositor)
   {}
 
   virtual GLContext* gl() const MOZ_OVERRIDE
   {
     return mImpl->gl();
   }
 
--- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h
+++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h
@@ -11,17 +11,17 @@
 class MacIOSurface;
 
 namespace mozilla {
 namespace layers {
 
 class MacIOSurfaceTextureClientOGL : public TextureClient
 {
 public:
-  MacIOSurfaceTextureClientOGL(TextureFlags aFlags);
+  explicit MacIOSurfaceTextureClientOGL(TextureFlags aFlags);
 
   virtual ~MacIOSurfaceTextureClientOGL();
 
   void InitWith(MacIOSurface* aSurface);
 
   virtual bool Lock(OpenMode aMode) MOZ_OVERRIDE;
 
   virtual void Unlock() MOZ_OVERRIDE;
--- a/gfx/layers/opengl/TextureClientOGL.h
+++ b/gfx/layers/opengl/TextureClientOGL.h
@@ -27,17 +27,17 @@ class CompositableForwarder;
 
 /**
  * A TextureClient implementation to share TextureMemory that is already
  * on the GPU, for the OpenGL backend.
  */
 class SharedTextureClientOGL : public TextureClient
 {
 public:
-  SharedTextureClientOGL(TextureFlags aFlags);
+  explicit SharedTextureClientOGL(TextureFlags aFlags);
 
   ~SharedTextureClientOGL();
 
   virtual bool IsAllocated() const MOZ_OVERRIDE;
 
   virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
 
   virtual bool Lock(OpenMode mode) MOZ_OVERRIDE;
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -207,18 +207,18 @@ protected:
  * This TextureSource can be used without a TextureHost and manage it's own
  * GL texture(s).
  */
 class TextureImageTextureSourceOGL : public DataTextureSource
                                    , public TextureSourceOGL
                                    , public BigImageIterator
 {
 public:
-  TextureImageTextureSourceOGL(gl::GLContext* aGL,
-                               TextureFlags aFlags = TextureFlags::DEFAULT)
+  explicit TextureImageTextureSourceOGL(gl::GLContext* aGL,
+                                        TextureFlags aFlags = TextureFlags::DEFAULT)
     : mGL(aGL)
     , mFlags(aFlags)
     , mIterating(false)
   {}
 
   // DataTextureSource
 
   virtual bool Update(gfx::DataSourceSurface* aSurface,