Closed Bug 1964793 Opened 7 months ago Closed 7 months ago

[ews] cleanup: Encapsulate update folder callbacks in a safe Rust interface.

Categories

(Thunderbird :: Account Manager, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
140 Branch

People

(Reporter: edicharry, Assigned: edicharry)

References

Details

Attachments

(1 file)

We have a number of unsafe calls in ews_xpcom::client, mostly to the callback functions we are accepting via the XPCOM interface. Each of these unsafe calls involves taking Rust-native types, converting them to XPCOM types, and then calling an unsafe XPCOM method with the converted types. I believe that the idiomatic safe Rust approach to an interface like this would be to create an opaque wrapper for the callback types that handles the conversion to-from unsafe XPCOM functions/types.

This issue covers handling this specifically for IEwsFolderCallbacks.

This was the result of a small refactor I did as part of https://bugzilla.mozilla.org/show_bug.cgi?id=1956568 , and Heather suggested I submit it as its own bug/patch in case we don't want this right now.

Attachment #9485822 - Attachment description: Bug 1964793 - Add memory-safe interface to EwsCallbacks. r=babolivier,heather,#thunderbird-back-end-reviewers → Bug 1964793 - Add memory-safe interface to IEwsFolderCallbacks. r=babolivier,heather,#thunderbird-back-end-reviewers

Pushed by arschmitz@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/760e7c0f8aff
Add memory-safe interface to IEwsFolderCallbacks. r=heather,babolivier

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
Blocks: 1983596
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: