summaryrefslogtreecommitdiff
path: root/dom/ipc
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-09-01 15:44:29 +0200
committerMoonchild <moonchild@palemoon.org>2023-09-01 15:44:29 +0200
commit2d48de9998d5c4f768af051ce997777be126f8cd (patch)
treec6023db91bfadaa8e1d7c4c12d90ad63bf810454 /dom/ipc
parent3b029cdfe482e5097ee09fa1998591faf9c1005b (diff)
parentee97a5dad40fb8d207b717cb2a0d487f54dd5f1d (diff)
downloaduxp-2d48de9998d5c4f768af051ce997777be126f8cd.tar.gz
Merge branch 'master' into releaseRC_20230901RB_20230904
Diffstat (limited to 'dom/ipc')
-rw-r--r--dom/ipc/FilePickerParent.cpp1
-rw-r--r--dom/ipc/FilePickerParent.h8
2 files changed, 7 insertions, 2 deletions
diff --git a/dom/ipc/FilePickerParent.cpp b/dom/ipc/FilePickerParent.cpp
index 1438e374fe..0271890758 100644
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -286,6 +286,7 @@ FilePickerParent::RecvOpen(const int16_t& aSelectedType,
}
}
+ MOZ_ASSERT(!mCallback);
mCallback = new FilePickerShownCallback(this);
mFilePicker->Open(mCallback);
diff --git a/dom/ipc/FilePickerParent.h b/dom/ipc/FilePickerParent.h
index 332007a715..89c472cb8a 100644
--- a/dom/ipc/FilePickerParent.h
+++ b/dom/ipc/FilePickerParent.h
@@ -27,8 +27,12 @@ class FilePickerParent : public PFilePickerParent
, mMode(aMode)
{}
+ private:
virtual ~FilePickerParent();
+ public:
+ NS_INLINE_DECL_REFCOUNTING(FilePickerParent)
+
void Done(int16_t aResult);
struct BlobImplOrString
@@ -69,7 +73,7 @@ class FilePickerParent : public PFilePickerParent
private:
virtual ~FilePickerShownCallback() {}
- FilePickerParent* mFilePickerParent;
+ RefPtr<FilePickerParent> mFilePickerParent;
};
private:
@@ -78,7 +82,7 @@ class FilePickerParent : public PFilePickerParent
// This runnable is used to do some I/O operation on a separate thread.
class IORunnable : public Runnable
{
- FilePickerParent* mFilePickerParent;
+ RefPtr<FilePickerParent> mFilePickerParent;
nsTArray<nsCOMPtr<nsIFile>> mFiles;
nsTArray<BlobImplOrString> mResults;
nsCOMPtr<nsIEventTarget> mEventTarget;