Closed
Bug 197745
Opened 21 years ago
Closed 21 years ago
nsExternalAppHandler needs to be able to support auto-saving and auto-dispatching of downloaded files
Categories
(Core Graveyard :: File Handling, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: sfraser_bugs, Assigned: law)
References
Details
Attachments
(1 file)
2.40 KB,
patch
|
sdagley
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Camino needs to be able to provide to the user a streamlined downloading experience, where the download is automatically saved into their system-specified download folder, and the download is auto-dispatched to the helper app when done (as controlled by a pref, off by default). We hacked nsExternalHelperAppService.cpp on the chimera branch to do this. We now need a cleaner way to do it on the trunk.
Reporter | ||
Comment 1•21 years ago
|
||
*struggles through the morass of downloading APIs* So you'd think that an embedder could just run a 'save to disk'-type download, and launch the file themselves at the end of it. But no! There's logic in nsExternalAppHandler::MoveFile that assumes that if the file is a 'save to disk' download, then it will already have a unique name so we don't need to uniquify the name. It assumes that if the file exists, the user had hit 'Replace' in the file picker, so if a similarly named file exists when done (which might be hours later), we can happily go ahead and replace it with our downloaded file. This is wrong. Here's what I think should happen. Implementors of 'PromptForSaveToFile' should, if the user hits 'Replace' in the file picker, promptly delete that file. Then, nsExternalAppHandler::MoveFile() should always uniquify the name, never replacing existing files. Of course, the real fix would be to remove the name salting altogether. Only then do users get what they really expect (specify a file location to save to, then way data being accumulated into that file).
not that camino cares, but don't forget that a user might want to use mozilla to resume a download into a file on disk (which mozilla didn't download).
Comment 3•21 years ago
|
||
So... is this a memo-to-self bug? Or rather, do we plan to try and fix this before fixing the general pre-downloading mess?
Reporter | ||
Comment 4•21 years ago
|
||
This is a "we have fix regressions in downloading in trunk-based camino builds". Patches coming.
Reporter | ||
Comment 5•21 years ago
|
||
This change allows an embedder to call nsExternalAppHandler::SaveToDisk, providing a file to download to. It ensures that CreateProgressListener() and ProcessAnyRefreshTags() are called in this case.
Reporter | ||
Comment 6•21 years ago
|
||
Associated Camino changes are in the patch in bug 192461.
Comment 7•21 years ago
|
||
Comment on attachment 117439 [details] [diff] [review] Fix nsExternalAppHandler::SaveToDisk when aNewFileLocation is non-null this looks fine to me. Let me know whether you want an r or an sr.... And I'd really like to clean up these interfaces to make them actually useful to embeddors. Feedback is very welcome (someone else doing the changing is even more welcome.... ;) ). Interface elimination, creation, heavy modification, all are fair game here.
Reporter | ||
Comment 8•21 years ago
|
||
Comment on attachment 117439 [details] [diff] [review] Fix nsExternalAppHandler::SaveToDisk when aNewFileLocation is non-null I lxr'd, and no-one currently calls SaveToDisk with a non-null aNewFileLocation. So this won't break anything.
Attachment #117439 -
Flags: superreview?(bzbarsky)
Attachment #117439 -
Flags: review?(sdagley)
Updated•21 years ago
|
Attachment #117439 -
Flags: superreview?(bzbarsky) → superreview+
Updated•21 years ago
|
Attachment #117439 -
Flags: review?(sdagley) → review+
Reporter | ||
Comment 9•21 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•