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:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /toolkit/components/uniffi-js/UniFFIPointer.h
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/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