Backed out changeset 9035ff3757ac (bug 1415980) at request from froydnj on the suspicion that it's going to break MSVC builds when it gets merged to central.

This commit is contained in:
Cosmin Sabou 2018-07-31 01:19:49 +03:00
parent 38f8ebc675
commit bfc1e72e01
34 changed files with 92 additions and 167 deletions

View File

@ -367,10 +367,7 @@ private:
typedef const T* KeyTypePointer;
explicit nsCOMPtrHashKey(const T* aKey) : mKey(const_cast<T*>(aKey)) {}
nsCOMPtrHashKey(nsCOMPtrHashKey<T>&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mKey(std::move(aOther.mKey))
{}
explicit nsCOMPtrHashKey(const nsPtrHashKey<T> &aToCopy) : mKey(aToCopy.mKey) {}
~nsCOMPtrHashKey() { }
KeyType GetKey() const { return mKey; }

View File

@ -24,7 +24,7 @@ public:
explicit PseudoElementHashEntry(KeyTypePointer aKey)
: mElement(aKey->mElement)
, mPseudoType(aKey->mPseudoType) { }
PseudoElementHashEntry(PseudoElementHashEntry&& aOther) = default;
explicit PseudoElementHashEntry(const PseudoElementHashEntry& aCopy)=default;
~PseudoElementHashEntry() = default;

View File

@ -386,8 +386,7 @@ nsIdentifierMapEntry::~nsIdentifierMapEntry()
{}
nsIdentifierMapEntry::nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mKey(std::move(aOther.mKey))
: mKey(std::move(aOther.mKey))
, mIdContentList(std::move(aOther.mIdContentList))
, mNameContentList(std::move(aOther.mNameContentList))
, mChangeCallbacks(std::move(aOther.mChangeCallbacks))

View File

@ -182,9 +182,8 @@ public:
explicit ChangeCallbackEntry(const ChangeCallback* aKey) :
mKey(*aKey) { }
ChangeCallbackEntry(ChangeCallbackEntry&& aOther) :
PLDHashEntryHdr(std::move(aOther)),
mKey(std::move(aOther.mKey)) { }
ChangeCallbackEntry(const ChangeCallbackEntry& toCopy) :
mKey(toCopy.mKey) { }
KeyType GetKey() const { return mKey; }
bool KeyEquals(KeyTypePointer aKey) const {

View File

@ -149,7 +149,6 @@ private:
{
public:
explicit NodeInfoInnerKey(KeyTypePointer aKey) : nsPtrHashKey(aKey) {}
NodeInfoInnerKey(NodeInfoInnerKey&&) = default;
~NodeInfoInnerKey() = default;
bool KeyEquals(KeyTypePointer aKey) const { return *mKey == *aKey; }
static PLDHashNumber HashKey(KeyTypePointer aKey) { return aKey->Hash(); }

View File

@ -336,10 +336,10 @@ nsCommandParams::HashMoveEntry(PLDHashTable* aTable,
const PLDHashEntryHdr* aFrom,
PLDHashEntryHdr* aTo)
{
auto* fromEntry = const_cast<HashEntry*>(static_cast<const HashEntry*>(aFrom));
const HashEntry* fromEntry = static_cast<const HashEntry*>(aFrom);
HashEntry* toEntry = static_cast<HashEntry*>(aTo);
new (KnownNotNull, toEntry) HashEntry(std::move(*fromEntry));
new (toEntry) HashEntry(*fromEntry);
fromEntry->~HashEntry();
}

View File

@ -86,7 +86,7 @@ protected:
Reset(mEntryType);
}
explicit HashEntry(const HashEntry& aRHS)
HashEntry(const HashEntry& aRHS)
: mEntryType(aRHS.mEntryType)
{
Reset(mEntryType);

View File

@ -3704,10 +3704,15 @@ HTMLMediaElement::MozCaptureStreamUntilEnded(ErrorResult& aRv)
class MediaElementSetForURI : public nsURIHashKey
{
public:
explicit MediaElementSetForURI(const nsIURI* aKey) : nsURIHashKey(aKey) {}
MediaElementSetForURI(MediaElementSetForURI&& aOther)
: nsURIHashKey(std::move(aOther))
, mElements(std::move(aOther.mElements)) {}
explicit MediaElementSetForURI(const nsIURI* aKey)
: nsURIHashKey(aKey)
{
}
MediaElementSetForURI(const MediaElementSetForURI& toCopy)
: nsURIHashKey(toCopy)
, mElements(toCopy.mElements)
{
}
nsTArray<HTMLMediaElement*> mElements;
};

View File

@ -35,8 +35,7 @@ public:
mForceCompositing(false)
{ }
nsSMILCompositor(nsSMILCompositor&& toMove)
: PLDHashEntryHdr(std::move(toMove)),
mKey(std::move(toMove.mKey)),
: mKey(std::move(toMove.mKey)),
mAnimationFunctions(std::move(toMove.mAnimationFunctions)),
mForceCompositing(false)
{ }

View File

@ -66,10 +66,8 @@ private:
, mCache(new LocalStorageCache(aKey))
{}
LocalStorageCacheHashKey(LocalStorageCacheHashKey&& aOther)
: nsCStringHashKey(std::move(aOther))
, mCache(std::move(aOther.mCache))
, mCacheRef(std::move(aOther.mCacheRef))
LocalStorageCacheHashKey(const LocalStorageCacheHashKey& aOther)
: nsCStringHashKey(aOther)
{
NS_ERROR("Shouldn't be called");
}

View File

@ -29,10 +29,8 @@ public:
mLoadResult(NS_OK)
{
}
txLoadedDocumentEntry(txLoadedDocumentEntry&& aOther)
: nsStringHashKey(std::move(aOther))
, mDocument(std::move(aOther.mDocument))
, mLoadResult(std::move(aOther.mLoadResult))
txLoadedDocumentEntry(const txLoadedDocumentEntry& aToCopy)
: nsStringHashKey(aToCopy)
{
NS_ERROR("We're horked.");
}

View File

@ -112,10 +112,7 @@ private:
typedef const FeatureValueHashKey *KeyTypePointer;
explicit FeatureValueHashEntry(KeyTypePointer aKey) { }
FeatureValueHashEntry(FeatureValueHashEntry&& other)
: PLDHashEntryHdr(std::move(other))
, mKey(std::move(other.mKey))
, mValues(std::move(other.mValues))
FeatureValueHashEntry(const FeatureValueHashEntry& toCopy)
{
NS_ERROR("Should not be called");
}

View File

@ -89,7 +89,9 @@ private:
// When constructing a new entry in the hashtable, we'll leave this
// blank. The caller of Put() will fill this in.
explicit HashEntry(KeyTypePointer aPtr) : nsUint32HashKey(aPtr) {}
HashEntry(HashEntry&& other) = default;
HashEntry(const HashEntry& toCopy) : nsUint32HashKey(toCopy) {
x = toCopy.x; y = toCopy.y; width = toCopy.width; height = toCopy.height;
}
float x, y, width, height;
};

View File

@ -394,8 +394,7 @@ public:
{ }
Entry(Entry&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mURI(std::move(aOther.mURI))
: mURI(std::move(aOther.mURI))
, mPrincipal(std::move(aOther.mPrincipal))
, mFontEntry(std::move(aOther.mFontEntry))
, mPrivate(std::move(aOther.mPrivate))

View File

@ -28,7 +28,7 @@ public:
explicit DisplayItemHashEntry(KeyTypePointer aKey)
: mKey(*aKey) {}
DisplayItemHashEntry(DisplayItemHashEntry&&) = default;
explicit DisplayItemHashEntry(const DisplayItemHashEntry& aCopy)=default;
~DisplayItemHashEntry() = default;

View File

@ -24,7 +24,6 @@
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/Maybe.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Move.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/net/ReferrerPolicy.h"
@ -70,11 +69,11 @@ public:
{
MOZ_COUNT_CTOR(URIPrincipalReferrerPolicyAndCORSModeHashKey);
}
URIPrincipalReferrerPolicyAndCORSModeHashKey(URIPrincipalReferrerPolicyAndCORSModeHashKey&& toMove)
: nsURIHashKey(std::move(toMove)),
mPrincipal(std::move(toMove.mPrincipal)),
mCORSMode(std::move(toMove.mCORSMode)),
mReferrerPolicy(std::move(toMove.mReferrerPolicy))
URIPrincipalReferrerPolicyAndCORSModeHashKey(const URIPrincipalReferrerPolicyAndCORSModeHashKey& toCopy)
: nsURIHashKey(toCopy),
mPrincipal(toCopy.mPrincipal),
mCORSMode(toCopy.mCORSMode),
mReferrerPolicy(toCopy.mReferrerPolicy)
{
MOZ_COUNT_CTOR(URIPrincipalReferrerPolicyAndCORSModeHashKey);
}

View File

@ -2081,7 +2081,7 @@ public:
mCanonical = canonical;
}
// This is explicitly not a copy constructor.
// Copy constructor needs to be explicit or the linker complains.
explicit PrefCallback(const PrefCallback*& aCopy)
: mDomain(aCopy->mDomain)
, mBranch(aCopy->mBranch)
@ -2092,9 +2092,6 @@ public:
MOZ_COUNT_CTOR(PrefCallback);
}
PrefCallback(const PrefCallback&) = delete;
PrefCallback(PrefCallback&&) = default;
~PrefCallback() { MOZ_COUNT_DTOR(PrefCallback); }
bool KeyEquals(const PrefCallback* aKey) const

View File

@ -9,7 +9,6 @@
#include "nsCOMPtr.h"
#include "nsIURI.h"
#include "nsHashKeys.h"
#include "mozilla/Move.h"
#include "mozilla/Unused.h"
/**
@ -23,12 +22,8 @@ public:
explicit nsURIHashKey(const nsIURI* aKey) :
mKey(const_cast<nsIURI*>(aKey)) { MOZ_COUNT_CTOR(nsURIHashKey); }
nsURIHashKey(nsURIHashKey&& toMove)
: PLDHashEntryHdr(std::move(toMove))
, mKey(std::move(toMove.mKey))
{
MOZ_COUNT_CTOR(nsURIHashKey);
}
nsURIHashKey(const nsURIHashKey& toCopy) :
mKey(toCopy.mKey) { MOZ_COUNT_CTOR(nsURIHashKey); }
~nsURIHashKey() { MOZ_COUNT_DTOR(nsURIHashKey); }
nsIURI* GetKey() const { return mKey; }

View File

@ -502,8 +502,8 @@ nsCacheEntryHashTable::MoveEntry(PLDHashTable * /* table */,
const PLDHashEntryHdr *from,
PLDHashEntryHdr *to)
{
new (KnownNotNull, to) nsCacheEntryHashTableEntry(std::move(*((nsCacheEntryHashTableEntry *)from)));
// No need to destroy `from`.
((nsCacheEntryHashTableEntry *)to)->cacheEntry =
((nsCacheEntryHashTableEntry *)from)->cacheEntry;
}

View File

@ -43,8 +43,7 @@ MoveEntry(PLDHashTable * /* table */,
const PLDHashEntryHdr * src,
PLDHashEntryHdr * dst)
{
new (KnownNotNull, dst) HashTableEntry(std::move(*(HashTableEntry*)src));
// No need to delete `src`.
((HashTableEntry *)dst)->mBinding = ((HashTableEntry *)src)->mBinding;
}

View File

@ -28,8 +28,10 @@ public:
, mOriginAttributes(other->mOriginAttributes)
{}
nsCookieKey(nsCookieKey&& other) = default;
nsCookieKey& operator=(nsCookieKey&&) = default;
nsCookieKey(KeyType other)
: mBaseDomain(other.mBaseDomain)
, mOriginAttributes(other.mOriginAttributes)
{}
bool KeyEquals(KeyTypePointer other) const
{

View File

@ -2898,7 +2898,7 @@ nsCookieService::Read()
nsCookieKey key(baseDomain, attrs);
CookieDomainTuple* tuple = mReadArray.AppendElement();
tuple->key = std::move(key);
tuple->key = key;
tuple->cookie = GetCookieFromRow(stmt, attrs);
}

View File

@ -11,8 +11,8 @@ nsHtml5AtomEntry::nsHtml5AtomEntry(KeyTypePointer aStr)
{
}
nsHtml5AtomEntry::nsHtml5AtomEntry(nsHtml5AtomEntry&& aOther)
: nsStringHashKey(std::move(aOther))
nsHtml5AtomEntry::nsHtml5AtomEntry(const nsHtml5AtomEntry& aOther)
: nsStringHashKey(aOther)
, mAtom(nullptr)
{
MOZ_ASSERT_UNREACHABLE("nsHtml5AtomTable is broken; tried to copy an entry");

View File

@ -16,7 +16,7 @@ class nsHtml5AtomEntry : public nsStringHashKey
{
public:
explicit nsHtml5AtomEntry(KeyTypePointer aStr);
nsHtml5AtomEntry(nsHtml5AtomEntry&& aOther);
nsHtml5AtomEntry(const nsHtml5AtomEntry& aOther);
~nsHtml5AtomEntry();
inline nsAtom* GetAtom() { return mAtom; }

View File

@ -81,8 +81,7 @@ class nsCertOverrideEntry final : public PLDHashEntryHdr
}
nsCertOverrideEntry(nsCertOverrideEntry&& toMove)
: PLDHashEntryHdr(std::move(toMove))
, mSettings(std::move(toMove.mSettings))
: mSettings(std::move(toMove.mSettings))
, mHostWithPort(std::move(toMove.mHostWithPort))
{
}

View File

@ -65,8 +65,7 @@ class nsClientAuthRememberEntry final : public PLDHashEntryHdr
}
nsClientAuthRememberEntry(nsClientAuthRememberEntry&& aToMove)
: PLDHashEntryHdr(std::move(aToMove))
, mSettings(std::move(aToMove.mSettings))
: mSettings(std::move(aToMove.mSettings))
, mEntryKey(std::move(aToMove.mEntryKey))
{
}

View File

@ -9,7 +9,6 @@
#include "mozilla/IHistory.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Move.h"
#include "mozilla/Mutex.h"
#include "mozIAsyncHistory.h"
#include "nsIDownloadHistory.h"
@ -213,10 +212,8 @@ private:
: nsURIHashKey(aURI)
{
}
KeyClass(KeyClass&& aOther)
: nsURIHashKey(std::move(aOther))
, array(std::move(aOther.array))
, mVisited(std::move(aOther.mVisited))
KeyClass(const KeyClass& aOther)
: nsURIHashKey(aOther)
{
MOZ_ASSERT_UNREACHABLE("Do not call me!");
}
@ -240,7 +237,7 @@ private:
explicit RecentURIKey(const nsIURI* aURI) : nsURIHashKey(aURI)
{
}
RecentURIKey(RecentURIKey&& aOther) : nsURIHashKey(std::move(aOther))
RecentURIKey(const RecentURIKey& aOther) : nsURIHashKey(aOther)
{
MOZ_ASSERT_UNREACHABLE("Do not call me!");
}

View File

@ -21,7 +21,6 @@
#include "imgITools.h"
#include "mozilla/storage.h"
#include "mozilla/Attributes.h"
#include "mozilla/Move.h"
#include "FaviconHelpers.h"
@ -38,13 +37,11 @@ class UnassociatedIconHashKey : public nsURIHashKey
{
public:
explicit UnassociatedIconHashKey(const nsIURI* aURI)
: nsURIHashKey(aURI)
: nsURIHashKey(aURI)
{
}
UnassociatedIconHashKey(UnassociatedIconHashKey&& aOther)
: nsURIHashKey(std::move(aOther))
, iconData(std::move(aOther.iconData))
, created(std::move(aOther.created))
UnassociatedIconHashKey(const UnassociatedIconHashKey& aOther)
: nsURIHashKey(aOther)
{
MOZ_ASSERT_UNREACHABLE("Do not call me!");
}

View File

@ -532,8 +532,8 @@ protected:
: nsURIHashKey(aURI)
{
}
VisitHashKey(VisitHashKey&& aOther)
: nsURIHashKey(std::move(aOther))
VisitHashKey(const VisitHashKey& aOther)
: nsURIHashKey(aOther)
{
MOZ_ASSERT_UNREACHABLE("Do not call me!");
}

View File

@ -108,12 +108,11 @@ public:
, mKey(aOther->mKey)
{}
KeyboardHashKey(KeyboardHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mLang(std::move(aOther.mLang))
, mRegion(std::move(aOther.mRegion))
, mKeyIdx(std::move(aOther.mKeyIdx))
, mKey(std::move(aOther.mKey))
KeyboardHashKey(KeyType aOther)
: mLang(aOther.mLang)
, mRegion(aOther.mRegion)
, mKeyIdx(aOther.mKeyIdx)
, mKey(aOther.mKey)
{}
~KeyboardHashKey()

View File

@ -38,13 +38,6 @@ struct PLDHashTableOps;
// -- users need never access it.
struct PLDHashEntryHdr
{
PLDHashEntryHdr() = default;
PLDHashEntryHdr(const PLDHashEntryHdr&) = delete;
PLDHashEntryHdr(const PLDHashEntryHdr&&) = delete;
PLDHashEntryHdr& operator=(const PLDHashEntryHdr&) = delete;
PLDHashEntryHdr(PLDHashEntryHdr&&) = default;
PLDHashEntryHdr& operator=(PLDHashEntryHdr&&) = default;
private:
friend class PLDHashTable;

View File

@ -24,9 +24,8 @@
#include <stdlib.h>
#include <string.h>
#include <utility>
#include "mozilla/HashFunctions.h"
#include "mozilla/Move.h"
namespace mozilla {
@ -82,11 +81,7 @@ public:
typedef const nsAString* KeyTypePointer;
explicit nsStringHashKey(KeyTypePointer aStr) : mStr(*aStr) {}
nsStringHashKey(const nsStringHashKey&) = delete;
nsStringHashKey(nsStringHashKey&& aToMove)
: PLDHashEntryHdr(std::move(aToMove))
, mStr(std::move(aToMove.mStr))
{}
nsStringHashKey(const nsStringHashKey& aToCopy) : mStr(aToCopy.mStr) {}
~nsStringHashKey() {}
KeyType GetKey() const { return mStr; }
@ -112,7 +107,7 @@ public:
enum { ALLOW_MEMMOVE = true };
private:
nsString mStr;
const nsString mStr;
};
#ifdef MOZILLA_INTERNAL_API
@ -136,11 +131,8 @@ public:
{
// take it easy just deal HashKey
}
nsStringCaseInsensitiveHashKey(const nsStringCaseInsensitiveHashKey&) = delete;
nsStringCaseInsensitiveHashKey(nsStringCaseInsensitiveHashKey&& aToMove)
: PLDHashEntryHdr(std::move(aToMove))
, mStr(std::move(aToMove.mStr))
nsStringCaseInsensitiveHashKey(const nsStringCaseInsensitiveHashKey& aToCopy)
: mStr(aToCopy.mStr)
{
}
~nsStringCaseInsensitiveHashKey() {}
@ -184,10 +176,7 @@ public:
typedef const nsACString* KeyTypePointer;
explicit nsCStringHashKey(const nsACString* aStr) : mStr(*aStr) {}
nsCStringHashKey(nsCStringHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mStr(std::move(aOther.mStr))
{}
nsCStringHashKey(const nsCStringHashKey& aToCopy) : mStr(aToCopy.mStr) {}
~nsCStringHashKey() {}
KeyType GetKey() const { return mStr; }
@ -225,10 +214,7 @@ public:
typedef const uint32_t* KeyTypePointer;
explicit nsUint32HashKey(KeyTypePointer aKey) : mValue(*aKey) {}
nsUint32HashKey(nsUint32HashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mValue(std::move(aOther.mValue))
{}
nsUint32HashKey(const nsUint32HashKey& aToCopy) : mValue(aToCopy.mValue) {}
~nsUint32HashKey() {}
KeyType GetKey() const { return mValue; }
@ -254,10 +240,7 @@ public:
typedef const uint64_t* KeyTypePointer;
explicit nsUint64HashKey(KeyTypePointer aKey) : mValue(*aKey) {}
nsUint64HashKey(nsUint64HashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mValue(std::move(aOther.mValue))
{}
nsUint64HashKey(const nsUint64HashKey& aToCopy) : mValue(aToCopy.mValue) {}
~nsUint64HashKey() {}
KeyType GetKey() const { return mValue; }
@ -286,10 +269,7 @@ public:
typedef const float* KeyTypePointer;
explicit nsFloatHashKey(KeyTypePointer aKey) : mValue(*aKey) {}
nsFloatHashKey(nsFloatHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mValue(std::move(aOther.mValue))
{}
nsFloatHashKey(const nsFloatHashKey& aToCopy) : mValue(aToCopy.mValue) {}
~nsFloatHashKey() {}
KeyType GetKey() const { return mValue; }
@ -318,9 +298,7 @@ public:
typedef const intptr_t* KeyTypePointer;
explicit IntPtrHashKey(KeyTypePointer aKey) : mValue(*aKey) {}
IntPtrHashKey(IntPtrHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mValue(aOther.mValue) {}
IntPtrHashKey(const IntPtrHashKey& aToCopy) : mValue(aToCopy.mValue) {}
~IntPtrHashKey() {}
KeyType GetKey() const { return mValue; }
@ -352,9 +330,8 @@ public:
: mSupports(const_cast<nsISupports*>(aKey))
{
}
nsISupportsHashKey(nsISupportsHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mSupports(std::move(aOther.mSupports))
nsISupportsHashKey(const nsISupportsHashKey& aToCopy)
: mSupports(aToCopy.mSupports)
{
}
~nsISupportsHashKey() {}
@ -386,10 +363,7 @@ public:
typedef const T* KeyTypePointer;
explicit nsRefPtrHashKey(const T* aKey) : mKey(const_cast<T*>(aKey)) {}
nsRefPtrHashKey(nsRefPtrHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mKey(std::move(aOther.mKey))
{}
nsRefPtrHashKey(const nsRefPtrHashKey& aToCopy) : mKey(aToCopy.mKey) {}
~nsRefPtrHashKey() {}
KeyType GetKey() const { return mKey; }
@ -429,8 +403,8 @@ class nsClearingPtrHashKey : public nsPtrHashKey<T>
{
public:
explicit nsClearingPtrHashKey(const T* aKey) : nsPtrHashKey<T>(aKey) {}
nsClearingPtrHashKey(nsClearingPtrHashKey&& aToMove)
: nsPtrHashKey<T>(std::move(aToMove))
nsClearingPtrHashKey(const nsClearingPtrHashKey<T>& aToCopy)
: nsPtrHashKey<T>(aToCopy)
{
}
~nsClearingPtrHashKey() { nsPtrHashKey<T>::mKey = nullptr; }
@ -480,10 +454,7 @@ public:
typedef const nsID* KeyTypePointer;
explicit nsIDHashKey(const nsID* aInID) : mID(*aInID) {}
nsIDHashKey(nsIDHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mID(std::move(aOther.mID))
{}
nsIDHashKey(const nsIDHashKey& aToCopy) : mID(aToCopy.mID) {}
~nsIDHashKey() {}
KeyType GetKey() const { return mID; }
@ -499,7 +470,7 @@ public:
enum { ALLOW_MEMMOVE = true };
private:
nsID mID;
const nsID mID;
};
/**
@ -514,9 +485,7 @@ public:
typedef const nsID* KeyTypePointer;
explicit nsIDPointerHashKey(const nsID* aInID) : mID(aInID) {}
nsIDPointerHashKey(nsIDPointerHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mID(aOther.mID) {}
nsIDPointerHashKey(const nsIDPointerHashKey& aToCopy) : mID(aToCopy.mID) {}
~nsIDPointerHashKey() = default;
KeyType GetKey() const { return mID; }
@ -552,10 +521,7 @@ public:
typedef const char* KeyTypePointer;
explicit nsDepCharHashKey(const char* aKey) : mKey(aKey) {}
nsDepCharHashKey(nsDepCharHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mKey(std::move(aOther.mKey))
{}
nsDepCharHashKey(const nsDepCharHashKey& aToCopy) : mKey(aToCopy.mKey) {}
~nsDepCharHashKey() {}
const char* GetKey() const { return mKey; }
@ -584,8 +550,11 @@ public:
typedef const char* KeyTypePointer;
explicit nsCharPtrHashKey(const char* aKey) : mKey(strdup(aKey)) {}
nsCharPtrHashKey(const nsCharPtrHashKey& aToCopy)
: mKey(strdup(aToCopy.mKey))
{
}
nsCharPtrHashKey(const nsCharPtrHashKey&) = delete;
nsCharPtrHashKey(nsCharPtrHashKey&& aOther)
: mKey(aOther.mKey)
{
@ -631,8 +600,11 @@ public:
typedef const char16_t* KeyTypePointer;
explicit nsUnicharPtrHashKey(const char16_t* aKey) : mKey(NS_strdup(aKey)) {}
nsUnicharPtrHashKey(const nsUnicharPtrHashKey& aToCopy)
: mKey(NS_strdup(aToCopy.mKey))
{
}
nsUnicharPtrHashKey(const nsUnicharPtrHashKey& aToCopy) = delete;
nsUnicharPtrHashKey(nsUnicharPtrHashKey&& aOther)
: mKey(aOther.mKey)
{
@ -679,10 +651,7 @@ public:
: mKey(const_cast<nsIHashable*>(aKey))
{
}
nsHashableHashKey(nsHashableHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mKey(std::move(aOther.mKey))
{}
nsHashableHashKey(const nsHashableHashKey& aToCopy) : mKey(aToCopy.mKey) {}
~nsHashableHashKey() {}
nsIHashable* GetKey() const { return mKey; }
@ -737,10 +706,7 @@ public:
typedef const T* KeyTypePointer;
explicit nsGenericHashKey(KeyTypePointer aKey) : mKey(*aKey) {}
nsGenericHashKey(const nsGenericHashKey&) = delete;
nsGenericHashKey(nsGenericHashKey&& aOther)
: PLDHashEntryHdr(std::move(aOther))
, mKey(std::move(aOther.mKey)) {}
nsGenericHashKey(const nsGenericHashKey<T>& aOther) : mKey(aOther.mKey) {}
KeyType GetKey() const { return mKey; }
bool KeyEquals(KeyTypePointer aKey) const { return *aKey == mKey; }

View File

@ -51,12 +51,6 @@ public:
MOZ_COUNT_CTOR(nsObserverList);
}
nsObserverList(nsObserverList&& aOther)
: nsCharPtrHashKey(std::move(aOther))
, mObservers(std::move(aOther.mObservers))
{
}
~nsObserverList()
{
MOZ_COUNT_DTOR(nsObserverList);

View File

@ -27,10 +27,7 @@ public:
typedef const T* KeyTypePointer;
explicit nsPtrHashKey(const T* aKey) : mKey(const_cast<T*>(aKey)) {}
nsPtrHashKey(nsPtrHashKey<T>&& aToMove)
: PLDHashEntryHdr(std::move(aToMove))
, mKey(std::move(aToMove.mKey))
{}
nsPtrHashKey(const nsPtrHashKey<T>& aToCopy) : mKey(aToCopy.mKey) {}
~nsPtrHashKey() {}
KeyType GetKey() const { return mKey; }