Bug 1317954 - Replace default bodies of special member functions with = default; in xpcom/.
MozReview-Commit-ID: 5GXchMr0VvV
--- a/xpcom/build/FileLocation.cpp
+++ b/xpcom/build/FileLocation.cpp
@@ -5,23 +5,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "FileLocation.h"
#include "nsZipArchive.h"
#include "nsURLHelper.h"
namespace mozilla {
-FileLocation::FileLocation()
-{
-}
+FileLocation::FileLocation() = default;
-FileLocation::~FileLocation()
-{
-}
+FileLocation::~FileLocation() = default;
FileLocation::FileLocation(nsIFile* aFile)
{
Init(aFile);
}
FileLocation::FileLocation(nsIFile* aFile, const char* aPath)
{
--- a/xpcom/components/nsCategoryManager.cpp
+++ b/xpcom/components/nsCategoryManager.cpp
@@ -201,19 +201,17 @@ EntryEnumerator::Create(nsTHashtable<Cat
//
CategoryNode*
CategoryNode::Create(PLArenaPool* aArena)
{
return new (aArena) CategoryNode();
}
-CategoryNode::~CategoryNode()
-{
-}
+CategoryNode::~CategoryNode() = default;
void*
CategoryNode::operator new(size_t aSize, PLArenaPool* aArena)
{
void* p;
PL_ARENA_ALLOCATE(p, aArena, aSize);
return p;
}
--- a/xpcom/glue/nsArrayEnumerator.cpp
+++ b/xpcom/glue/nsArrayEnumerator.cpp
@@ -27,17 +27,17 @@ public:
// nsSimpleArrayEnumerator methods
explicit nsSimpleArrayEnumerator(nsIArray* aValueArray)
: mValueArray(aValueArray)
, mIndex(0)
{
}
private:
- ~nsSimpleArrayEnumerator() {}
+ ~nsSimpleArrayEnumerator() = default;
protected:
nsCOMPtr<nsIArray> mValueArray;
uint32_t mIndex;
};
NS_IMPL_ISUPPORTS(nsSimpleArrayEnumerator, nsISimpleEnumerator)
--- a/xpcom/glue/nsCategoryCache.cpp
+++ b/xpcom/glue/nsCategoryCache.cpp
@@ -57,19 +57,17 @@ nsCategoryObserver::nsCategoryObserver(c
if (serv) {
serv->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
serv->AddObserver(this, NS_XPCOM_CATEGORY_ENTRY_ADDED_OBSERVER_ID, false);
serv->AddObserver(this, NS_XPCOM_CATEGORY_ENTRY_REMOVED_OBSERVER_ID, false);
serv->AddObserver(this, NS_XPCOM_CATEGORY_CLEARED_OBSERVER_ID, false);
}
}
-nsCategoryObserver::~nsCategoryObserver()
-{
-}
+nsCategoryObserver::~nsCategoryObserver() = default;
NS_IMPL_ISUPPORTS(nsCategoryObserver, nsIObserver)
void
nsCategoryObserver::ListenerDied()
{
RemoveObservers();
}
--- a/xpcom/glue/nsEnumeratorUtils.cpp
+++ b/xpcom/glue/nsEnumeratorUtils.cpp
@@ -117,19 +117,17 @@ protected:
};
nsSingletonEnumerator::nsSingletonEnumerator(nsISupports* aValue)
: mValue(aValue)
{
mConsumed = (mValue ? false : true);
}
-nsSingletonEnumerator::~nsSingletonEnumerator()
-{
-}
+nsSingletonEnumerator::~nsSingletonEnumerator() = default;
NS_IMPL_ISUPPORTS(nsSingletonEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP
nsSingletonEnumerator::HasMoreElements(bool* aResult)
{
NS_PRECONDITION(aResult != 0, "null ptr");
if (!aResult) {
@@ -196,19 +194,17 @@ nsUnionEnumerator::nsUnionEnumerator(nsI
nsISimpleEnumerator* aSecondEnumerator)
: mFirstEnumerator(aFirstEnumerator)
, mSecondEnumerator(aSecondEnumerator)
, mConsumed(false)
, mAtSecond(false)
{
}
-nsUnionEnumerator::~nsUnionEnumerator()
-{
-}
+nsUnionEnumerator::~nsUnionEnumerator() = default;
NS_IMPL_ISUPPORTS(nsUnionEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP
nsUnionEnumerator::HasMoreElements(bool* aResult)
{
NS_PRECONDITION(aResult != 0, "null ptr");
if (!aResult) {
--- a/xpcom/tests/gtest/TestHashtables.cpp
+++ b/xpcom/tests/gtest/TestHashtables.cpp
@@ -22,19 +22,17 @@ namespace TestHashtables {
class TestUniChar // for nsClassHashtable
{
public:
explicit TestUniChar(uint32_t aWord)
{
mWord = aWord;
}
- ~TestUniChar()
- {
- }
+ ~TestUniChar() = default;
uint32_t GetChar() const { return mWord; }
private:
uint32_t mWord;
};
struct EntityNode {
@@ -66,17 +64,17 @@ EntityNode gEntities[] = {
class EntityToUnicodeEntry : public PLDHashEntryHdr
{
public:
typedef const char* KeyType;
typedef const char* KeyTypePointer;
explicit EntityToUnicodeEntry(const char* aKey) { mNode = nullptr; }
EntityToUnicodeEntry(const EntityToUnicodeEntry& aEntry) { mNode = aEntry.mNode; }
- ~EntityToUnicodeEntry() { }
+ ~EntityToUnicodeEntry() = default;
bool KeyEquals(const char* aEntity) const { return !strcmp(mNode->mStr, aEntity); }
static const char* KeyToPointer(const char* aEntity) { return aEntity; }
static PLDHashNumber HashKey(const char* aEntity) { return mozilla::HashString(aEntity); }
enum { ALLOW_MEMMOVE = true };
const EntityNode* mNode;
};
--- a/xpcom/tests/gtest/TestNsRefPtr.cpp
+++ b/xpcom/tests/gtest/TestNsRefPtr.cpp
@@ -414,19 +414,17 @@ NS_METHOD_(MozExternalRefCountType) Rele
protected: \
mutable ::mozilla::ThreadSafeAutoRefCnt mRefCnt; \
public:
class ObjectForConstPtr
{
private:
// Reference-counted classes cannot have public destructors.
- ~ObjectForConstPtr()
- {
- }
+ ~ObjectForConstPtr() = default;
public:
NS_INLINE_DECL_THREADSAFE_MUTABLE_REFCOUNTING(ObjectForConstPtr)
void ConstMemberFunction( int aArg1, int* aArgPtr, int& aArgRef ) const
{
}
};
#undef NS_INLINE_DECL_THREADSAFE_MUTABLE_REFCOUNTING