Closed
Bug 1355369
Opened 9 years ago
Closed 9 years ago
SlicedInputStream should be nsIAsyncInputStream only if the internal stream implements the that interface as well
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
(2 files)
|
4.59 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
|
7.67 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Currently, SlicedInputStream is always an nsIAsyncInputStream, also when the internal stream is not. In this case, CloseWithStatus() and AsyncWait() return NS_ERROR_FAILURE.
| Assignee | ||
Comment 1•9 years ago
|
||
Assignee: nobody → amarchesini
Attachment #8856852 -
Flags: review?(bugs)
| Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8856950 -
Flags: review?(bugs)
| Assignee | ||
Updated•9 years ago
|
Attachment #8856852 -
Attachment description: ipcBlob_7.patch → part 1 - the interface
Updated•9 years ago
|
Attachment #8856852 -
Flags: review?(bugs) → review+
Comment 3•9 years ago
|
||
Comment on attachment 8856950 [details] [diff] [review]
part 2 - AsyncWait
> SlicedInputStream::AsyncWait(nsIInputStreamCallback* aCallback,
> uint32_t aFlags,
> uint32_t aRequestedCount,
> nsIEventTarget* aEventTarget)
> {
> NS_ENSURE_STATE(mInputStream);
> NS_ENSURE_STATE(mWeakAsyncInputStream);
>
>- return mWeakAsyncInputStream->AsyncWait(aCallback, aFlags, aRequestedCount,
>+ // If we haven't start retrieving data, let's see if we can seek.
s/start/started/
>+ // If we cannot seek, we will do consecutive reads.
>+ if (mCurPos < mStart) {
>+ nsCOMPtr<nsISeekableStream> seekableStream =
>+ do_QueryInterface(mInputStream);
>+ if (seekableStream) {
Why you QI when we have mWeakSeekableInputStream ?
>+
>+ if (mAsyncWaitCallback && aCallback) {
>+ return NS_ERROR_FAILURE;
>+ }
>+
>+ mAsyncWaitCallback = aCallback;
>+
>+ if (!mAsyncWaitCallback) {
>+ return NS_OK;
>+ }
Odd to have this stuff after Seek. So, move Seek after this part?
This all needs tests!
Attachment #8856950 -
Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/11b1cea5a2e7
SlicedInputStream should expose nsIAsyncInputStream interface only when needed, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/4473199dca26
SlicedInputStream must implement AsyncWait correctly, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/cd7c31a01d5c
gtests for SlicedInputStream and ASyncWait, r=me
Comment 5•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/11b1cea5a2e7
https://hg.mozilla.org/mozilla-central/rev/4473199dca26
https://hg.mozilla.org/mozilla-central/rev/cd7c31a01d5c
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•