Open Bug 1127531 Opened 10 years ago Updated 2 years ago

consider supporting nsICloneableInputStream for file streams under some conditions

Categories

(Core :: Networking, defect, P5)

defect

Tracking

()

People

(Reporter: bkelly, Unassigned)

References

Details

(Whiteboard: [necko-would-take])

In bug 1100398 I am adding the nsICloneableInputStream interface. This allows streams to Clone() themselves in the most efficient way possible. For file streams I had originally planned to use dup(2) for this, but later realized this was not feasible due to the file cursor being shared by the fds. One possible way to still support Clone() of file streams would be to only allow it in the parent process. Basically the file stream's GetCloneable() method would check to see if a file path was set. If so, then return true. Then in Clone() do a new Open() and seek to the correct offset in the file. Of course, if the stream has gone through IPC, then it will only have an fd without a file path. In this case GetCloneable() would return false. This would allow file streams to be Clone()'d efficiently in the parent process. This is not useful for my case (SW Cache API), but may be for other code. For example, would imglib benefit from this? If so, we may want to implement it.
Whiteboard: [necko-would-take]
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.