Bug 1055519 - Fix some more bad implicit constructors in layout and widget; r=roc
--- a/layout/generic/nsTextRunTransformations.h
+++ b/layout/generic/nsTextRunTransformations.h
@@ -38,18 +38,18 @@ class nsCaseTransformTextRunFactory : pu
public:
// We could add an optimization here so that when there is no inner
// factory, no title-case conversion, and no upper-casing of SZLIG, we override
// MakeTextRun (after making it virtual in the superclass) and have it
// just convert the string to uppercase or lowercase and create the textrun
// via the fontgroup.
// Takes ownership of aInnerTransformTextRunFactory
- nsCaseTransformTextRunFactory(nsTransformingTextRunFactory* aInnerTransformingTextRunFactory,
- bool aAllUppercase = false)
+ explicit nsCaseTransformTextRunFactory(nsTransformingTextRunFactory* aInnerTransformingTextRunFactory,
+ bool aAllUppercase = false)
: mInnerTransformingTextRunFactory(aInnerTransformingTextRunFactory),
mAllUppercase(aAllUppercase) {}
virtual void RebuildTextRun(nsTransformedTextRun* aTextRun, gfxContext* aRefContext) MOZ_OVERRIDE;
// Perform a transformation on the given string, writing the result into
// aConvertedString. If aAllUppercase is true, the transform is (global)
// upper-casing, and aLanguage is used to determine any language-specific
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -33,17 +33,17 @@ struct AnimationPlayerCollection;
namespace css {
bool IsGeometricProperty(nsCSSProperty aProperty);
class CommonAnimationManager : public nsIStyleRuleProcessor,
public nsARefreshObserver {
public:
- CommonAnimationManager(nsPresContext *aPresContext);
+ explicit CommonAnimationManager(nsPresContext *aPresContext);
// nsISupports
NS_DECL_ISUPPORTS
// nsIStyleRuleProcessor (parts)
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE;
virtual nsRestyleHint HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData) MOZ_OVERRIDE;
virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE;
--- a/layout/style/StyleRule.h
+++ b/layout/style/StyleRule.h
@@ -25,18 +25,18 @@ struct nsCSSSelectorList;
class nsCSSCompressedDataBlock;
namespace mozilla {
class CSSStyleSheet;
} // namespace mozilla
struct nsAtomList {
public:
- nsAtomList(nsIAtom* aAtom);
- nsAtomList(const nsString& aAtomValue);
+ explicit nsAtomList(nsIAtom* aAtom);
+ explicit nsAtomList(const nsString& aAtomValue);
~nsAtomList(void);
/** Do a deep clone. Should be used only on the first in the linked list. */
nsAtomList* Clone() const { return Clone(true); }
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
nsCOMPtr<nsIAtom> mAtom;
@@ -45,17 +45,17 @@ private:
nsAtomList* Clone(bool aDeep) const;
nsAtomList(const nsAtomList& aCopy) MOZ_DELETE;
nsAtomList& operator=(const nsAtomList& aCopy) MOZ_DELETE;
};
struct nsPseudoClassList {
public:
- nsPseudoClassList(nsCSSPseudoClasses::Type aType);
+ explicit nsPseudoClassList(nsCSSPseudoClasses::Type aType);
nsPseudoClassList(nsCSSPseudoClasses::Type aType, const char16_t *aString);
nsPseudoClassList(nsCSSPseudoClasses::Type aType, const int32_t *aIntPair);
nsPseudoClassList(nsCSSPseudoClasses::Type aType,
nsCSSSelectorList *aSelectorList /* takes ownership */);
~nsPseudoClassList(void);
/** Do a deep clone. Should be used only on the first in the linked list. */
nsPseudoClassList* Clone() const { return Clone(true); }
@@ -279,17 +279,17 @@ namespace css {
class Declaration;
class DOMCSSStyleRule;
class StyleRule;
class ImportantRule : public nsIStyleRule {
public:
- ImportantRule(Declaration *aDeclaration);
+ explicit ImportantRule(Declaration *aDeclaration);
NS_DECL_ISUPPORTS
// nsIStyleRule interface
virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
#endif
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -47,17 +47,17 @@ struct AnimationEventInfo {
};
typedef InfallibleTArray<AnimationEventInfo> EventArray;
class nsAnimationManager MOZ_FINAL
: public mozilla::css::CommonAnimationManager
{
public:
- nsAnimationManager(nsPresContext *aPresContext)
+ explicit nsAnimationManager(nsPresContext *aPresContext)
: mozilla::css::CommonAnimationManager(aPresContext)
, mObservingRefreshDriver(false)
{
}
static mozilla::AnimationPlayerCollection*
GetAnimationsForCompositor(nsIContent* aContent, nsCSSProperty aProperty)
{
--- a/layout/svg/nsSVGUtils.h
+++ b/layout/svg/nsSVGUtils.h
@@ -85,20 +85,20 @@ bool NS_SVGNewGetBBoxEnabled();
*/
class SVGBBox {
typedef mozilla::gfx::Rect Rect;
public:
SVGBBox()
: mIsEmpty(true) {}
- SVGBBox(const Rect& aRect)
+ MOZ_IMPLICIT SVGBBox(const Rect& aRect)
: mBBox(aRect), mIsEmpty(false) {}
- SVGBBox(const gfxRect& aRect)
+ MOZ_IMPLICIT SVGBBox(const gfxRect& aRect)
: mBBox(ToRect(aRect)), mIsEmpty(false) {}
gfxRect ToThebesRect() const {
return ThebesRect(mBBox);
}
bool IsEmpty() const {
return mIsEmpty;
--- a/widget/InputData.h
+++ b/widget/InputData.h
@@ -183,26 +183,26 @@ public:
MultiTouchInput(const MultiTouchInput& aOther)
: InputData(MULTITOUCH_INPUT, aOther.mTime,
aOther.mTimeStamp, aOther.modifiers)
, mType(aOther.mType)
{
mTouches.AppendElements(aOther.mTouches);
}
- MultiTouchInput(const WidgetTouchEvent& aTouchEvent);
+ explicit MultiTouchInput(const WidgetTouchEvent& aTouchEvent);
WidgetTouchEvent ToWidgetTouchEvent(nsIWidget* aWidget) const;
// This conversion from WidgetMouseEvent to MultiTouchInput is needed because
// on the B2G emulator we can only receive mouse events, but we need to be
// able to pan correctly. To do this, we convert the events into a format that
// the panning code can handle. This code is very limited and only supports
// SingleTouchData. It also sends garbage for the identifier, radius, force
// and rotation angle.
- MultiTouchInput(const WidgetMouseEvent& aMouseEvent);
+ explicit MultiTouchInput(const WidgetMouseEvent& aMouseEvent);
MultiTouchType mType;
nsTArray<SingleTouchData> mTouches;
};
/**
* Encapsulation class for pan events, can be used off-main-thread.
* These events are currently only used for scrolling on desktop.
--- a/widget/cocoa/nsCocoaUtils.h
+++ b/widget/cocoa/nsCocoaUtils.h
@@ -49,17 +49,17 @@ namespace mozilla {
namespace gfx {
class SourceSurface;
}
}
// Used to retain a Cocoa object for the remainder of a method's execution.
class nsAutoRetainCocoaObject {
public:
-nsAutoRetainCocoaObject(id anObject)
+explicit nsAutoRetainCocoaObject(id anObject)
{
mObject = NS_OBJC_TRY_EXPR_ABORT([anObject retain]);
}
~nsAutoRetainCocoaObject()
{
NS_OBJC_TRY_ABORT([mObject release]);
}
private: