Closed Bug 1596562 Opened 3 months ago Closed 3 months ago

Add ParamTraits specializations for mozilla::Vector and std::vector

Categories

(Core :: IPC, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: aklotz, Assigned: aklotz)

References

Details

Attachments

(1 file)

While the need for adding mozilla::Vector is self-evident, we also need std::vector so that we can send some pre-existing telemetry data structures that use it.

There's already a specialization for std::vector in dom/media/webrtc/WebrtcIPCTraits.h that can (and should) be moved somewhere more central.

Also, note that there's ParamTraits and IPDLParamTraits (which includes an actor parameter for things that need to send out-of-band messages or otherwise access the channel), but I don't know if any types that are IPDLParamTraits-only would be the element type of a vector.

Yes, my patch creates a centralized std::vector specialization and changes webrtc to use it.

While the need for adding mozilla::Vector is self-evident, we also need
std::vector so that we can send some pre-existing telemetry data structures
that use it.

The new implementations are basically modified from the nsTArray
specializations. Note that the mozilla::Vector specialization does support
any type of allocator, so we still check for OOM failures in that case.

This patch also removes the specialization for std::vector that lives in
WebRTC in favour of the centralized implementation.

Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/855640e1c096
Add ParamTraits specializations for mozilla::Vector and std::vector; r=froydnj,bwc
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.