summaryrefslogtreecommitdiffstats
path: root/toolkit/components/uniffi-js/UniFFIPointer.h
diff options
context:
space:
mode:
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