summaryrefslogtreecommitdiffstats
path: root/toolkit/components/uniffi-js/UniFFIPointer.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/components/uniffi-js/UniFFIPointer.h
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/uniffi-js/UniFFIPointer.h')
-rw-r--r--toolkit/components/uniffi-js/UniFFIPointer.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/toolkit/components/uniffi-js/UniFFIPointer.h b/toolkit/components/uniffi-js/UniFFIPointer.h
index 59acc0ca66..f9a95c309e 100644
--- a/toolkit/components/uniffi-js/UniFFIPointer.h
+++ b/toolkit/components/uniffi-js/UniFFIPointer.h
@@ -36,15 +36,13 @@ class UniFFIPointer final : public nsISupports, public nsWrapperCache {
nsISupports* GetParentObject() { return nullptr; }
/**
- * returns the raw pointer `UniFFIPointer` holds
- * This is safe because:
- * - The pointer was allocated in Rust as a reference counted `Arc<T>`
- * - Rust cloned the pointer without destructing it when passed into C++
- * - Eventually, when the destructor of `UniFFIPointer` runs, we return
- * ownership to Rust, which then decrements the count and deallocates the
- * memory the pointer points to.
+ * Clone the raw pointer that `UniFFIPointer` holds
+ *
+ * Use this when lowering the pointer to pass it across the FFI, for example:
+ * - When calling a method
+ * - When passing the object as an argument to a function
*/
- void* GetPtr() const;
+ void* ClonePtr() const;
/**
* Returns true if the pointer type `this` holds is the same as the argument