In order to do this, I'd need to move nsISafeOutputStream into xpcom/io and out of necko.
Created attachment 392771 [details] [diff] [review] v1.0 This does the trick, and I'm pretty sure it's right. I added some comments to make what is going on in nsAStreamCopier::Process a little bit clearer since it wasn't obvious to me what was going on at first. bsmedberg can review the changes to xpcom/, and bz the unit test I've added in netwerk/.
Comment on attachment 392771 [details] [diff] [review] v1.0 r=bzbarsky
I thought this had passed tests locally, but tinderbox really doesn't like it.
This bug appears to have been wrongfully blamed (and I hadn't backed it out yet). Closing again.