Open Bug 1458936 Opened 7 years ago Updated 3 years ago

make it easier to send StructuredCloneData to a worker thread

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: bkelly, Unassigned)

References

Details

In service worker code I have a need to send structured clone data across IPC and then pass it to the target SW thread. This is currently quite difficult to do efficiently. We have the StructuredCloneData helper class for IPC, but it uses non-threadsafe ref-counting internally. The StructuredCloneHolder is threadsafe, but there is no easy way that I see to convert a StructuredCloneData into a StructuredCloneHolder. As a short term work around I am unpacking the StructuredCloneData into a StructuredCloneHolder using a sandbox as a temporary global. This is really ugly and probably not great for perf. It would be nice if there was an efficient way to transfer stuff to a thread safe StructuredCloneHolder.
See Also: → 1456986
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.