mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1167389 - Make FileList::mParent a smart pointer, and declare it to the cycle collector. r=ehsan
This commit is contained in:
parent
25c21aef08
commit
724e72569c
@ -1235,7 +1235,7 @@ BlobImplTemporaryBlob::GetInternalStream(nsIInputStream** aStream,
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// FileList implementation
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FileList, mFiles)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FileList, mFiles, mParent)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FileList)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
|
@ -989,11 +989,6 @@ public:
|
||||
return mParent;
|
||||
}
|
||||
|
||||
void Disconnect()
|
||||
{
|
||||
mParent = nullptr;
|
||||
}
|
||||
|
||||
bool Append(File *aFile) { return mFiles.AppendElement(aFile); }
|
||||
|
||||
bool Remove(uint32_t aIndex) {
|
||||
@ -1040,7 +1035,7 @@ public:
|
||||
|
||||
private:
|
||||
nsTArray<nsRefPtr<File>> mFiles;
|
||||
nsISupports *mParent;
|
||||
nsCOMPtr<nsISupports> mParent;
|
||||
};
|
||||
|
||||
} // dom namespace
|
||||
|
@ -36,10 +36,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(DataTransfer)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DataTransfer)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)
|
||||
if (tmp->mFiles) {
|
||||
tmp->mFiles->Disconnect();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFiles)
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFiles)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDragTarget)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDragImage)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
@ -139,11 +136,7 @@ DataTransfer::DataTransfer(nsISupports* aParent,
|
||||
}
|
||||
|
||||
DataTransfer::~DataTransfer()
|
||||
{
|
||||
if (mFiles) {
|
||||
mFiles->Disconnect();
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
||||
// static
|
||||
already_AddRefed<DataTransfer>
|
||||
|
@ -879,9 +879,6 @@ HTMLInputElement::HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
|
||||
HTMLInputElement::~HTMLInputElement()
|
||||
{
|
||||
if (mFileList) {
|
||||
mFileList->Disconnect();
|
||||
}
|
||||
if (mNumberControlSpinnerIsSpinning) {
|
||||
StopNumberControlSpinnerSpin();
|
||||
}
|
||||
@ -936,10 +933,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLInputElement,
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mControllers)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFiles)
|
||||
if (tmp->mFileList) {
|
||||
tmp->mFileList->Disconnect();
|
||||
tmp->mFileList = nullptr;
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFileList)
|
||||
if (tmp->IsSingleLineTextControl(false)) {
|
||||
tmp->mInputData.mState->Unlink();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user