зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 5 changesets (bug 1617604, bug 1617542, bug 1617546) for causing build bustages on ipc/mscom/Interceptor.cpp.
CLOSED TREE Backed out changeset 5faa54ad950e (bug 1617542) Backed out changeset cb38779e1eb6 (bug 1617604) Backed out changeset 3aea18e0396f (bug 1617542) Backed out changeset bc3eeefdfb6c (bug 1617542) Backed out changeset b76a3aa5ff6f (bug 1617546)
This commit is contained in:
Родитель
55035cb007
Коммит
7f1afff492
|
@ -963,7 +963,7 @@ void CustomElementRegistry::Define(
|
|||
disableInternals, disableShadow);
|
||||
|
||||
CustomElementDefinition* def = definition.get();
|
||||
mCustomDefinitions.Put(nameAtom, std::move(definition));
|
||||
mCustomDefinitions.Put(nameAtom, definition.forget());
|
||||
|
||||
MOZ_ASSERT(mCustomDefinitions.Count() == mConstructors.count(),
|
||||
"Number of entries should be the same");
|
||||
|
@ -1022,7 +1022,7 @@ void CustomElementRegistry::SetElementCreationCallback(
|
|||
}
|
||||
|
||||
RefPtr<CustomElementCreationCallback> callback = &aCallback;
|
||||
mElementCreationCallbacks.Put(nameAtom, std::move(callback));
|
||||
mElementCreationCallbacks.Put(nameAtom, callback.forget());
|
||||
}
|
||||
|
||||
void CustomElementRegistry::Upgrade(nsINode& aRoot) {
|
||||
|
|
|
@ -11410,7 +11410,7 @@ void Document::MaybePreLoadImage(nsIURI* uri, const nsAString& aCrossOriginAttr,
|
|||
// the "real" load occurs. Unpinned in DispatchContentLoadedEvents and
|
||||
// unlink
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mPreloadingImages.Put(uri, std::move(request));
|
||||
mPreloadingImages.Put(uri, request.forget());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12870,7 +12870,7 @@ RefPtr<FullDatabaseMetadata> FullDatabaseMetadata::Duplicate() const {
|
|||
newIndexMetadata->mCommonMetadata = value->mCommonMetadata;
|
||||
|
||||
if (NS_WARN_IF(!newOSMetadata->mIndexes.Put(
|
||||
indexEntry.GetKey(), std::move(newIndexMetadata), fallible))) {
|
||||
indexEntry.GetKey(), newIndexMetadata.forget(), fallible))) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -12879,7 +12879,7 @@ RefPtr<FullDatabaseMetadata> FullDatabaseMetadata::Duplicate() const {
|
|||
newOSMetadata->mIndexes.Count());
|
||||
|
||||
if (NS_WARN_IF(!newMetadata->mObjectStores.Put(
|
||||
objectStoreEntry.GetKey(), std::move(newOSMetadata), fallible))) {
|
||||
objectStoreEntry.GetKey(), newOSMetadata.forget(), fallible))) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2757,7 +2757,7 @@ RefPtr<MediaManager::StreamPromise> MediaManager::GetUserMedia(
|
|||
focusSource);
|
||||
|
||||
// Store the task w/callbacks.
|
||||
self->mActiveCallbacks.Put(callID, std::move(task));
|
||||
self->mActiveCallbacks.Put(callID, task.forget());
|
||||
|
||||
// Add a WindowID cross-reference so OnNavigation can tear
|
||||
// things down
|
||||
|
@ -3376,7 +3376,7 @@ void MediaManager::AddWindowID(uint64_t aWindowId,
|
|||
return;
|
||||
}
|
||||
|
||||
GetActiveWindows()->Put(aWindowId, std::move(aListener));
|
||||
GetActiveWindows()->Put(aWindowId, aListener.forget());
|
||||
}
|
||||
|
||||
void MediaManager::RemoveWindowID(uint64_t aWindowId) {
|
||||
|
|
|
@ -3319,7 +3319,9 @@ void nsPermissionManager::WhenPermissionsAvailable(nsIPrincipal* aPrincipal,
|
|||
// promise, and send the request to the parent (if we have not already
|
||||
// done so).
|
||||
promise = new GenericNonExclusivePromise::Private(__func__);
|
||||
mPermissionKeyPromiseMap.Put(pair.first(), promise);
|
||||
mPermissionKeyPromiseMap.Put(
|
||||
pair.first(),
|
||||
RefPtr<GenericNonExclusivePromise::Private>(promise).forget());
|
||||
}
|
||||
|
||||
if (promise) {
|
||||
|
|
|
@ -192,7 +192,7 @@ void SharedSurfacesParent::Add(const wr::ExternalImageId& aId,
|
|||
wr::RenderThread::Get()->RegisterExternalImage(id, texture.forget());
|
||||
|
||||
surface->AddConsumer();
|
||||
sInstance->mSurfaces.Put(id, std::move(surface));
|
||||
sInstance->mSurfaces.Put(id, surface.forget());
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -95,7 +95,7 @@ ComputedStyle* nsTreeStyleCache::GetComputedStyle(
|
|||
mCache = MakeUnique<ComputedStyleCache>();
|
||||
}
|
||||
result = newResult.get();
|
||||
mCache->Put(currState, std::move(newResult));
|
||||
mCache->Put(currState, newResult.forget());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -33,10 +33,6 @@ namespace mozilla {
|
|||
|
||||
struct Nothing {};
|
||||
|
||||
inline constexpr bool operator==(const Nothing&, const Nothing&) {
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
|
||||
// You would think that poisoning Maybe instances could just be a call
|
||||
|
|
|
@ -358,7 +358,7 @@ struct ParamTraits<mozilla::ModulesMap> {
|
|||
return false;
|
||||
}
|
||||
|
||||
aResult->Put(key, std::move(rec));
|
||||
aResult->Put(key, rec.forget());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -983,7 +983,7 @@ RefPtr<ModulesTrustPromise> UntrustedModulesProcessor::GetModulesTrustInternal(
|
|||
NS_ERROR_ILLEGAL_DURING_SHUTDOWN, __func__);
|
||||
}
|
||||
|
||||
modMap.Put(resolvedNtPath, std::move(module));
|
||||
modMap.Put(resolvedNtPath, module.forget());
|
||||
}
|
||||
|
||||
return ModulesTrustPromise::CreateAndResolve(std::move(result), __func__);
|
||||
|
|
|
@ -3697,7 +3697,7 @@ gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) {
|
|||
event.mTime = aEvent->time;
|
||||
|
||||
if (aEvent->type == GDK_TOUCH_BEGIN || aEvent->type == GDK_TOUCH_UPDATE) {
|
||||
mTouches.Put(aEvent->sequence, std::move(touch));
|
||||
mTouches.Put(aEvent->sequence, touch.forget());
|
||||
// add all touch points to event object
|
||||
for (auto iter = mTouches.Iter(); !iter.Done(); iter.Next()) {
|
||||
event.mTouches.AppendElement(new dom::Touch(*iter.UserData()));
|
||||
|
|
|
@ -53,13 +53,9 @@ class nsRefPtrHashtable
|
|||
// Overload Put, rather than overriding it.
|
||||
using base_type::Put;
|
||||
|
||||
template <typename U,
|
||||
typename = std::enable_if_t<std::is_base_of_v<PtrType, U>>>
|
||||
void Put(KeyType aKey, RefPtr<U>&& aData);
|
||||
void Put(KeyType aKey, already_AddRefed<PtrType> aData);
|
||||
|
||||
template <typename U,
|
||||
typename = std::enable_if_t<std::is_base_of_v<PtrType, U>>>
|
||||
MOZ_MUST_USE bool Put(KeyType aKey, RefPtr<U>&& aData,
|
||||
MOZ_MUST_USE bool Put(KeyType aKey, already_AddRefed<PtrType> aData,
|
||||
const mozilla::fallible_t&);
|
||||
|
||||
/**
|
||||
|
@ -150,17 +146,16 @@ PtrType* nsRefPtrHashtable<KeyClass, PtrType>::GetWeak(KeyType aKey,
|
|||
}
|
||||
|
||||
template <class KeyClass, class PtrType>
|
||||
template <typename U, typename>
|
||||
void nsRefPtrHashtable<KeyClass, PtrType>::Put(KeyType aKey,
|
||||
RefPtr<U>&& aData) {
|
||||
void nsRefPtrHashtable<KeyClass, PtrType>::Put(
|
||||
KeyType aKey, already_AddRefed<PtrType> aData) {
|
||||
if (!Put(aKey, std::move(aData), mozilla::fallible)) {
|
||||
NS_ABORT_OOM(this->mTable.EntrySize() * this->mTable.EntryCount());
|
||||
}
|
||||
}
|
||||
|
||||
template <class KeyClass, class PtrType>
|
||||
template <typename U, typename>
|
||||
bool nsRefPtrHashtable<KeyClass, PtrType>::Put(KeyType aKey, RefPtr<U>&& aData,
|
||||
bool nsRefPtrHashtable<KeyClass, PtrType>::Put(KeyType aKey,
|
||||
already_AddRefed<PtrType> aData,
|
||||
const mozilla::fallible_t&) {
|
||||
typename base_type::EntryType* ent = this->PutEntry(aKey, mozilla::fallible);
|
||||
|
||||
|
@ -168,7 +163,7 @@ bool nsRefPtrHashtable<KeyClass, PtrType>::Put(KeyType aKey, RefPtr<U>&& aData,
|
|||
return false;
|
||||
}
|
||||
|
||||
ent->SetData(std::move(aData));
|
||||
ent->SetData(aData);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1658,15 +1658,13 @@ class nsTArray_Impl
|
|||
|
||||
// Append a new element, constructed in place from the provided arguments.
|
||||
protected:
|
||||
template <typename ActualAlloc, class... Args>
|
||||
elem_type* EmplaceBackInternal(Args&&... aItem);
|
||||
template <class... Args, typename ActualAlloc = Alloc>
|
||||
elem_type* EmplaceBack(Args&&... aItem);
|
||||
|
||||
public:
|
||||
template <class... Args>
|
||||
MOZ_MUST_USE elem_type* EmplaceBack(const mozilla::fallible_t&,
|
||||
Args&&... aArgs) {
|
||||
return EmplaceBackInternal<FallibleAlloc, Args...>(
|
||||
std::forward<Args>(aArgs)...);
|
||||
MOZ_MUST_USE elem_type* EmplaceBack(Args&&... aArgs, mozilla::fallible_t&) {
|
||||
return EmplaceBack<Args..., FallibleAlloc>(std::forward<Args>(aArgs)...);
|
||||
}
|
||||
|
||||
// Append a new element, move constructing if possible.
|
||||
|
@ -2464,9 +2462,8 @@ auto nsTArray_Impl<E, Alloc>::AppendElement(Item&& aItem) -> elem_type* {
|
|||
}
|
||||
|
||||
template <typename E, class Alloc>
|
||||
template <typename ActualAlloc, class... Args>
|
||||
auto nsTArray_Impl<E, Alloc>::EmplaceBackInternal(Args&&... aArgs)
|
||||
-> elem_type* {
|
||||
template <class... Args, typename ActualAlloc>
|
||||
auto nsTArray_Impl<E, Alloc>::EmplaceBack(Args&&... aArgs) -> elem_type* {
|
||||
// Length() + 1 is guaranteed to not overflow, so EnsureCapacity is OK.
|
||||
if (!ActualAlloc::Successful(this->template EnsureCapacity<ActualAlloc>(
|
||||
Length() + 1, sizeof(elem_type)))) {
|
||||
|
@ -2547,13 +2544,6 @@ class nsTArray : public nsTArray_Impl<E, nsTArrayInfallibleAllocator> {
|
|||
using base_type::ReplaceElementsAt;
|
||||
using base_type::SetCapacity;
|
||||
using base_type::SetLength;
|
||||
|
||||
template <class... Args>
|
||||
typename base_type::elem_type* EmplaceBack(Args&&... aArgs) {
|
||||
return this
|
||||
->template EmplaceBackInternal<nsTArrayInfallibleAllocator, Args...>(
|
||||
std::forward<Args>(aArgs)...);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "nsDataHashtable.h"
|
||||
#include "nsInterfaceHashtable.h"
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISupports.h"
|
||||
|
@ -38,21 +37,6 @@ class TestUniChar // for nsClassHashtable
|
|||
uint32_t mWord;
|
||||
};
|
||||
|
||||
class TestUniCharRefCounted // for nsRefPtrHashtable
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(TestUniCharRefCounted);
|
||||
|
||||
explicit TestUniCharRefCounted(uint32_t aWord) { mWord = aWord; }
|
||||
|
||||
uint32_t GetChar() const { return mWord; }
|
||||
|
||||
private:
|
||||
~TestUniCharRefCounted() = default;
|
||||
|
||||
uint32_t mWord;
|
||||
};
|
||||
|
||||
struct EntityNode {
|
||||
const char* mStr; // never owns buffer
|
||||
uint32_t mUnicode;
|
||||
|
@ -673,38 +657,3 @@ TEST(Hashtables, ClassHashtable_LookupForAdd)
|
|||
}
|
||||
ASSERT_TRUE(0 == EntToUniClass.Count());
|
||||
}
|
||||
|
||||
TEST(Hashtables, RefPtrHashtable)
|
||||
{
|
||||
// check a RefPtr-hashtable
|
||||
nsRefPtrHashtable<nsCStringHashKey, TestUniCharRefCounted> EntToUniClass(
|
||||
ENTITY_COUNT);
|
||||
|
||||
for (auto& entity : gEntities) {
|
||||
EntToUniClass.Put(
|
||||
nsDependentCString(entity.mStr),
|
||||
mozilla::MakeRefPtr<TestUniCharRefCounted>(entity.mUnicode));
|
||||
}
|
||||
|
||||
TestUniCharRefCounted* myChar;
|
||||
|
||||
for (auto& entity : gEntities) {
|
||||
ASSERT_TRUE(EntToUniClass.Get(nsDependentCString(entity.mStr), &myChar));
|
||||
}
|
||||
|
||||
ASSERT_FALSE(EntToUniClass.Get(NS_LITERAL_CSTRING("xxxx"), &myChar));
|
||||
|
||||
uint32_t count = 0;
|
||||
for (auto iter = EntToUniClass.Iter(); !iter.Done(); iter.Next()) {
|
||||
count++;
|
||||
}
|
||||
ASSERT_EQ(count, ENTITY_COUNT);
|
||||
|
||||
EntToUniClass.Clear();
|
||||
|
||||
count = 0;
|
||||
for (auto iter = EntToUniClass.Iter(); !iter.Done(); iter.Next()) {
|
||||
count++;
|
||||
}
|
||||
ASSERT_EQ(count, uint32_t(0));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче