Closed Bug 1359172 Opened 8 years ago Closed 8 years ago

RemoteInputStream doesn't create a correct inputStream when used in a separate process

Categories

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

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(1 file, 2 obsolete files)

When RemoteBlobImpl::GetInternalStream is called from a non-owning thread, we create a PBlobChild actor on PBackground. In case this RemoteBlobImpl is a slice of another one, we create such PBlobChild actor of the parent blobImpl, but then, we return the inputStream of the parent, instead a slice of it. This code has been buggy for a while, but it appears now because we are moving away from PBlob and now it's easier to recreate this scenario than before.
Blocks: 1353629
Attached patch fix.patch (obsolete) — Splinter Review
Assignee: nobody → amarchesini
Flags: needinfo?(bugs)
Why blobImpl::GetInternalStream doesn't do the wrapping? Why this caller needs to know to use sliced stream? The comment doesn't explain why sliced stream is needed. s/strem/stream/
Flags: needinfo?(bugs)
Attached patch fix.patch (obsolete) — Splinter Review
Better comments.
Attachment #8861133 - Attachment is obsolete: true
Flags: needinfo?(bugs)
I'm still missing the reasoning. _why_ we need to slice the input stream? Why 'PBackgroundChild* manager = mozilla::ipc::BackgroundChild::GetForCurrentThread()' is so special case that in that case we need to slice the input stream? Sorry, I'm lazy here to read all the relevant code to understand this.
Flags: needinfo?(bugs)
> I'm still missing the reasoning. > _why_ we need to slice the input stream? > Why 'PBackgroundChild* manager = > mozilla::ipc::BackgroundChild::GetForCurrentThread()' is so special case > that in that case we need to slice the input stream? This is actually written in the comments: + // In case we are on a PBackground thread and this is not the owning thread, + // we need to create a new actor here. This actor must be created for the + // baseRemoteBlobImpl, which can be the current blobImpl or the parent one, + // in case we are dealing with a sliced blob. ... + // InputStream is the stream of the baseRemoteBlobImpl. If the current + // blobImpl is a slice of this baseRemoteBlobImpl, here we need to slice the + // inputStream.
Flags: needinfo?(bugs)
(In reply to Andrea Marchesini [:baku] from comment #5) > > I'm still missing the reasoning. > > _why_ we need to slice the input stream? > > Why 'PBackgroundChild* manager = > > mozilla::ipc::BackgroundChild::GetForCurrentThread()' is so special case > > that in that case we need to slice the input stream? > > This is actually written in the comments: > > + // In case we are on a PBackground thread and this is not the owning > thread, > + // we need to create a new actor here. This actor must be created for > the > + // baseRemoteBlobImpl, which can be the current blobImpl or the parent > one, > + // in case we are dealing with a sliced blob. > This doesn't explain my question at all > ... > > + // InputStream is the stream of the baseRemoteBlobImpl. If the current > + // blobImpl is a slice of this baseRemoteBlobImpl, here we need to > slice the > + // inputStream. This doesn't still explain why we need sliced stream
Flags: needinfo?(bugs)
Comment on attachment 8861189 [details] [diff] [review] fix.patch >+ // InputStream is the stream of the baseRemoteBlobImpl. If the current >+ // blobImpl is a slice of this baseRemoteBlobImpl, here we need to slice the >+ // inputStream. >+ if (mRemoteBlobImpl->IsSlice()) { The comment is still very confusing. The comment talks about blobImpl being slice, but then code doesn't use blobImpl at all, but mRemoteBlobImpl Please clarify
Attachment #8861189 - Flags: review+
Attached patch fix.patchSplinter Review
Attachment #8861189 - Attachment is obsolete: true
Attachment #8861368 - Flags: review?(bugs)
Attachment #8861368 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/cf6065f64f9a RemoteInputStream must create a correct inputStream when used and sliced in a separate process, r=smaug
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Depends on: 1383518
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: