diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/components/uniffi-js/UniFFIPointer.h | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-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.h | 14 |
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 |