Bug 1079317 - Fix some more bad implicit constructors in DOM; r=baku
--- a/content/base/src/ImportManager.h
+++ b/content/base/src/ImportManager.h
@@ -65,17 +65,17 @@ class ImportLoader MOZ_FINAL : public ns
, public nsIDOMEventListener
{
// A helper inner class to decouple the logic of updating the import graph
// after a new import link has been found by one of the parsers.
class Updater {
public:
- Updater(ImportLoader* aLoader) : mLoader(aLoader)
+ explicit Updater(ImportLoader* aLoader) : mLoader(aLoader)
{}
// After a new link is added that refers to this import, we
// have to update the spanning tree, since given this new link the
// priority of this import might be higher in the scripts
// execution order than before. It updates mMainReferrer, mImportParent,
// the corresponding pending ScriptRunners, etc.
// It also handles updating additional dependant loaders via the
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -550,17 +550,17 @@ nsIdentifierMapEntry::FireChangeCallback
mChangeCallbacks->EnumerateEntries(FireChangeEnumerator, &args);
}
namespace {
struct PositionComparator
{
Element* const mElement;
- PositionComparator(Element* const aElement) : mElement(aElement) {}
+ explicit PositionComparator(Element* const aElement) : mElement(aElement) {}
int operator()(void* aElement) const {
Element* curElement = static_cast<Element*>(aElement);
if (mElement == curElement) {
return 0;
}
if (nsContentUtils::PositionIsBefore(mElement, curElement)) {
return -1;
--- a/content/base/src/nsPlainTextSerializer.cpp
+++ b/content/base/src/nsPlainTextSerializer.cpp
@@ -1868,17 +1868,17 @@ struct interval
{
uint16_t first;
uint16_t last;
};
struct CombiningComparator
{
const char16_t mUcs;
- CombiningComparator(char16_t ucs) : mUcs(ucs) {}
+ explicit CombiningComparator(char16_t aUcs) : mUcs(aUcs) {}
int operator()(const interval& combining) const {
if (mUcs > combining.last)
return 1;
if (mUcs < combining.first)
return -1;
MOZ_ASSERT(combining.first <= mUcs);
MOZ_ASSERT(mUcs <= combining.last);
--- a/content/html/content/src/HTMLFormElement.cpp
+++ b/content/html/content/src/HTMLFormElement.cpp
@@ -2239,33 +2239,33 @@ HTMLFormElement::Clear()
mPastNameLookupTable.Clear();
}
namespace {
struct PositionComparator
{
nsIContent* const mElement;
- PositionComparator(nsIContent* const element) : mElement(element) {}
+ explicit PositionComparator(nsIContent* const aElement) : mElement(aElement) {}
int operator()(nsIContent* aElement) const {
if (mElement == aElement) {
return 0;
}
if (nsContentUtils::PositionIsBefore(mElement, aElement)) {
return -1;
}
return 1;
}
};
struct NodeListAdaptor
{
nsINodeList* const mList;
- NodeListAdaptor(nsINodeList* aList) : mList(aList) {}
+ explicit NodeListAdaptor(nsINodeList* aList) : mList(aList) {}
nsIContent* operator[](size_t aIdx) const {
return mList->Item(aIdx);
}
};
} // namespace
nsresult
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -1358,17 +1358,17 @@ protected:
WebGLContext& mWebGL;
const bool mNeedsChange;
static bool NeedsChange(WebGLContext& webgl) {
return webgl.mNeedsFakeNoAlpha &&
webgl.mColorWriteMask[3] != false;
}
- ScopedMaskWorkaround(WebGLContext& webgl);
+ explicit ScopedMaskWorkaround(WebGLContext& aWebgl);
~ScopedMaskWorkaround();
};
void LoseOldestWebGLContextIfLimitExceeded();
void UpdateLastUseIndex();
template <typename WebGLObjectType>
--- a/dom/cellbroadcast/CellBroadcast.cpp
+++ b/dom/cellbroadcast/CellBroadcast.cpp
@@ -27,17 +27,17 @@ class CellBroadcast::Listener MOZ_FINAL
{
private:
CellBroadcast* mCellBroadcast;
public:
NS_DECL_ISUPPORTS
NS_FORWARD_SAFE_NSICELLBROADCASTLISTENER(mCellBroadcast)
- Listener(CellBroadcast* aCellBroadcast)
+ explicit Listener(CellBroadcast* aCellBroadcast)
: mCellBroadcast(aCellBroadcast)
{
MOZ_ASSERT(mCellBroadcast);
}
void Disconnect()
{
MOZ_ASSERT(mCellBroadcast);
--- a/dom/fetch/Response.h
+++ b/dom/fetch/Response.h
@@ -22,17 +22,17 @@ class Promise;
class Response MOZ_FINAL : public nsISupports
, public nsWrapperCache
{
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Response)
public:
- Response(nsISupports* aOwner);
+ explicit Response(nsISupports* aOwner);
JSObject*
WrapObject(JSContext* aCx)
{
return ResponseBinding::Wrap(aCx, this);
}
ResponseType
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -324,17 +324,17 @@ class RemoteInputStream MOZ_FINAL
nsCOMPtr<nsIInputStream> mStream;
nsRefPtr<DOMFileImpl> mBlobImpl;
nsCOMPtr<nsIEventTarget> mEventTarget;
nsISeekableStream* mWeakSeekableStream;
public:
NS_DECL_THREADSAFE_ISUPPORTS
- RemoteInputStream(DOMFileImpl* aBlobImpl)
+ explicit RemoteInputStream(DOMFileImpl* aBlobImpl)
: mMonitor("RemoteInputStream.mMonitor")
, mBlobImpl(aBlobImpl)
, mWeakSeekableStream(nullptr)
{
MOZ_ASSERT(IsOnOwningThread());
MOZ_ASSERT(aBlobImpl);
if (!NS_IsMainThread()) {
--- a/dom/voicemail/Voicemail.cpp
+++ b/dom/voicemail/Voicemail.cpp
@@ -28,17 +28,17 @@ using mozilla::ErrorResult;
class Voicemail::Listener MOZ_FINAL : public nsIVoicemailListener
{
Voicemail* mVoicemail;
public:
NS_DECL_ISUPPORTS
NS_FORWARD_SAFE_NSIVOICEMAILLISTENER(mVoicemail)
- Listener(Voicemail* aVoicemail)
+ explicit Listener(Voicemail* aVoicemail)
: mVoicemail(aVoicemail)
{
MOZ_ASSERT(mVoicemail);
}
void Disconnect()
{
MOZ_ASSERT(mVoicemail);
--- a/dom/voicemail/ipc/VoicemailIPCService.cpp
+++ b/dom/voicemail/ipc/VoicemailIPCService.cpp
@@ -18,17 +18,17 @@ namespace voicemail {
class VoicemailIPCProvider MOZ_FINAL : public nsIVoicemailProvider
{
friend class VoicemailIPCService;
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIVOICEMAILPROVIDER
- VoicemailIPCProvider(uint32_t aServiceId);
+ explicit VoicemailIPCProvider(uint32_t aServiceId);
private:
// MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
~VoicemailIPCProvider() {}
private:
uint32_t mServiceId;
nsString mNumber;