Closed Bug 1779326 Opened 4 years ago Closed 4 years ago

Improve Rust codegen for nsIInputStream and nsIOutputStream

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox-esr102 --- fixed
firefox105 --- fixed

People

(Reporter: fabrice, Assigned: nika)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Currently some methods are not generated (eg. read() and readSegments() for nsIInputStream) because of complexity with mapping of c++ native types.

However there's hope, since Nika said: "nsIInputStream and nsIOutputStream may be foundational enough we could justify adding a special case for it, but I don't think there's enough demand for full custom support especially as it's a bit more complicated for Rust than C++ due to types both being used in the xpcom crate and in macros."

Flags: needinfo?(nika)

This makes the logic for the rust type line up a bit more with the C++
logic for existing types, and adds support for 'char' and 'char16_t'
native types (for 'charPtr').

This specifically enables nsIInputStream::Read to be used from Rust.

Assignee: nobody → nika
Status: NEW → ASSIGNED
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d4dae48f386a Handle a few more `native` types in rust-xpidl, r=xpcom-reviewers,kmag
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c480ca374be9 Handle a few more `native` types in rust-xpidl, r=xpcom-reviewers,kmag
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Flags: needinfo?(nika)

Comment on attachment 9286995 [details]
Bug 1779326 - Handle a few more native types in rust-xpidl, r=#xpcom-reviewers

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Required for bug 1834862
  • User impact if declined: See bug 1834862
  • Fix Landed on Version: 105
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Changes to FFI type declarations, which largely allows some methods to be used in Rust which wouldn't otherwise.
Attachment #9286995 - Flags: approval-mozilla-esr102?

Comment on attachment 9286995 [details]
Bug 1779326 - Handle a few more native types in rust-xpidl, r=#xpcom-reviewers

Approved for 102.13esr.

Attachment #9286995 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: