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)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: baku, Assigned: baku)
References
Details
Attachments
(1 file, 2 obsolete files)
2.99 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•8 years ago
|
||
Assignee: nobody → amarchesini
Flags: needinfo?(bugs)
Comment 2•8 years ago
|
||
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)
Assignee | ||
Comment 3•8 years ago
|
||
Better comments.
Attachment #8861133 -
Attachment is obsolete: true
Flags: needinfo?(bugs)
Comment 4•8 years ago
|
||
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)
Assignee | ||
Comment 5•8 years ago
|
||
> 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)
Comment 6•8 years ago
|
||
(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 7•8 years ago
|
||
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+
Assignee | ||
Comment 8•8 years ago
|
||
Attachment #8861189 -
Attachment is obsolete: true
Attachment #8861368 -
Flags: review?(bugs)
Updated•8 years ago
|
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
Comment 10•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•