[DOM] Make IORunnable::mFilePickerParent into a RefPtr.

This commit is contained in:
Moonchild 2023-08-30 19:30:17 +02:00 committed by roytam1
commit 0359d8a9e7
2 changed files with 3 additions and 2 deletions

View file

@ -286,6 +286,7 @@ FilePickerParent::RecvOpen(const int16_t& aSelectedType,
} }
} }
MOZ_ASSERT(!mCallback);
mCallback = new FilePickerShownCallback(this); mCallback = new FilePickerShownCallback(this);
mFilePicker->Open(mCallback); mFilePicker->Open(mCallback);

View file

@ -69,7 +69,7 @@ class FilePickerParent : public PFilePickerParent
private: private:
virtual ~FilePickerShownCallback() {} virtual ~FilePickerShownCallback() {}
FilePickerParent* mFilePickerParent; RefPtr<FilePickerParent> mFilePickerParent;
}; };
private: private:
@ -78,7 +78,7 @@ class FilePickerParent : public PFilePickerParent
// This runnable is used to do some I/O operation on a separate thread. // This runnable is used to do some I/O operation on a separate thread.
class IORunnable : public Runnable class IORunnable : public Runnable
{ {
FilePickerParent* mFilePickerParent; RefPtr<FilePickerParent> mFilePickerParent;
nsTArray<nsCOMPtr<nsIFile>> mFiles; nsTArray<nsCOMPtr<nsIFile>> mFiles;
nsTArray<BlobImplOrString> mResults; nsTArray<BlobImplOrString> mResults;
nsCOMPtr<nsIEventTarget> mEventTarget; nsCOMPtr<nsIEventTarget> mEventTarget;