Closed
Bug 129921
Opened 23 years ago
Closed 18 years ago
nsIWebBrowserPersist should support resume
Categories
(Core Graveyard :: Embedding: APIs, defect)
Core Graveyard
Embedding: APIs
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: bugzilla, Assigned: tom.germeau)
References
()
Details
Attachments
(2 files, 2 obsolete files)
10.47 KB,
patch
|
Details | Diff | Splinter Review | |
1.23 KB,
patch
|
Biesinger
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
nsIResumableChannel was added recently to facilitate cross-session resuming
(something of a replacement for the hackish
nsIRequest::Pause/nsIRequest::Resume). Since nsIWebBrowserPersist takes care of
the downloading, I think it should offer a resume method that takes the url and
the offset in bytes as parameters. That would really help us out in download
manager land...
Comment 1•23 years ago
|
||
TestProtocols has a hackish example of using this interface. Currently only ftp
supports it.
Reporter | ||
Comment 2•23 years ago
|
||
Adam, can you comment on this? I think this should be really easy for you since
you know the code well. With minimal hacking, I think I've almost hooked it up,
I'm just running into one problem that I can't solve. I added an offset
parameter to saveURI and then called asyncOpenAt instead of asyncOpen if it was
non-zero. Is there a chance you can get this done by 1.0?
Marking future. Resume would be nice but I will have to investigate it further.
Reporter | ||
Comment 4•23 years ago
|
||
This makes the download manager next to useless. According to bbaetz and
TestProtocols.cpp, this is pretty easy to hookup. It entails calling AsyncOpenAt
on channels that implement nsIResumableChannel, rather than AsyncOpen.
Updated•23 years ago
|
QA Contact: mdunn → depstein
Comment 5•23 years ago
|
||
changed qa contact to Dharma. Web Browser persist is his area.
QA Contact: depstein → dsirnapalli
Patch demonstrates how resume might be supported. Patch is still work in
progress. Still need to figure my way around the file stream interfaces to open
an output stream seeked to the right place.
Comment 7•23 years ago
|
||
That looks about right, from a quick glance through.
Sample URL points to a file on an FTP site that supports resume.
A functioning patch. Tested it with the URL above, cancelling and resuming
several times and file downloaded correctly.
The UI needs to be updated and there are also some issues with the progress
notification. Netwerk should give progress notifications that start at 30% or
wherever we're resuming from but it starts from 0.
I don't know of an ftp site that doesn't support resume so I have only
simulated the condition by jumping into the right code in OnStartRequest to
handle an NS_ERROR_NOT_RESUMABLE error. JS will need to catch these errors
because it doesn't at the moment.
Attachment #77070 -
Attachment is obsolete: true
Comment 10•23 years ago
|
||
You need to keep track of how many bytes you have - just grab the size of the
file you are resuming the download to.
You should also get the entity ID from the nsIResumableChannel, and the d/l
manager should store that info, and then pass it in to asyncOpenAt. That will
allow you to pop up an alert if the new data isn't the same as the old one.
Try downoading a directory - those aren't resumable. Ignore any assertions you
get from ftp about that - resuming directory downloads isn't something which is
supported.
Comment 11•23 years ago
|
||
I shouldn't need to expose any of the entity stuff since the download manager
will be notified via OnStateChange call when I receive my OnStartRequest. It can
save the stuff for itself and popup a warning there.
Re my progress problems. If I resume 30k into a 100k file, netwerk sends me
OnProgress notifications that start from 0k and go up to 70k. This looks really
odd. It should start from 30k and go up to 100k. While I could add on the
missing 30k for myself, it requires me to assume that progress & progressmax
args in OnProgress actually represent number of bytes. They might for one
protocol but another might use them for percentage complete or some other
measure of completeness. So it would be better and safer if progress
notifications were correct when they got to me.
I will use the downloading a dir trick to test out the resume error code in
OnStartRequest.
Target Milestone: --- → mozilla1.1alpha
Reporter | ||
Comment 12•23 years ago
|
||
How's this coming?
Comment 13•23 years ago
|
||
Patch development is on hold while 1.0 schedule is so tight. My last patch is
more or less complete except for the entity checking. After review/checkin a new
bug will have to be raised against the download manager to actually use this
functionality.
Comment 14•22 years ago
|
||
Setting target milestone to 'Future' since 'mozilla1.1alpha' has already passed.
Target Milestone: mozilla1.1alpha → Future
Comment 15•22 years ago
|
||
Is there a problem checking this in now ? It was more or less finished in April...
Comment 16•22 years ago
|
||
Is there a problem checking this in now ? It was more or less finished in April...
Assignee | ||
Comment 17•18 years ago
|
||
Inspired by http://developer.mozilla.org/en/docs/Implementing_Download_Resuming
With this patch one can create a nsIResumableChannel, optionally handle entityID and resumeAt and ask the nsIWebBrowserPersist to append instead of overwrite.
Attachment #265517 -
Flags: review?
Comment 18•18 years ago
|
||
Tom: You need to request a reviewer, bz, biesi or bsmedberg could probably review this for you.
Assignee | ||
Updated•18 years ago
|
Attachment #265517 -
Flags: review? → review?(cbiesinger)
Comment 19•18 years ago
|
||
I'm ok with the new patch (attachment 265517 [details] [diff] [review]) r=brade
Updated•18 years ago
|
Assignee: adamlock → tom.germeau
Flags: blocking1.9?
Target Milestone: Future → mozilla1.9alpha6
Comment 20•18 years ago
|
||
Comment on attachment 265517 [details] [diff] [review]
Add flag to nsIWebBrowserPersist making it possible to append to a file
you don't need to change the IID when you're just adding a new constant
also, you should document that this flag will only be used when saving to a local file (as opposed to a URI). and perhaps use "target file" instead of "target stream".
Attachment #265517 -
Flags: review?(cbiesinger) → review+
Comment 21•18 years ago
|
||
Comment on attachment 265517 [details] [diff] [review]
Add flag to nsIWebBrowserPersist making it possible to append to a file
jst kindly review this patch as it is blocking my work. (Bug 377243)
Regards
Brahmana
Attachment #265517 -
Flags: superreview?(jst)
Assignee | ||
Comment 22•18 years ago
|
||
Attachment #265517 -
Attachment is obsolete: true
Attachment #270146 -
Flags: review?(cbiesinger)
Attachment #265517 -
Flags: superreview?(jst)
Comment 23•18 years ago
|
||
Tom, if your reviewer marks your patch as r+ but asks you to make a few changes you don't need to ask them to review those changes. If they had wanted to review your changes they would have marked it r-. (You can _choose_ to re-request review if you're not sure your changes meet their request of course.) What you do need before this patch can be checked in is sr. I'm not sure if biesi could also give you sr in this simple case or if you need a second reviewer.
Updated•18 years ago
|
Target Milestone: mozilla1.9alpha6 → mozilla1.9beta1
Updated•18 years ago
|
Attachment #270146 -
Flags: review?(cbiesinger) → review+
Updated•18 years ago
|
Attachment #270146 -
Flags: superreview+
Updated•18 years ago
|
Keywords: checkin-needed
Comment 24•18 years ago
|
||
Checking in embedding/components/webbrowserpersist/public/nsIWebBrowserPersist.idl;
/cvsroot/mozilla/embedding/components/webbrowserpersist/public/nsIWebBrowserPersist.idl,v <-- nsIWebBrowserPersist.idl
new revision: 1.18; previous revision: 1.17
done
Checking in embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp;
/cvsroot/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp,v <-- nsWebBrowserPersist.cpp
new revision: 1.129; previous revision: 1.128
done
Updated•18 years ago
|
Flags: in-testsuite?
Updated•17 years ago
|
Flags: blocking1.9?
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•