Open Bug 837195 Opened 11 years ago Updated 2 years ago

"Save Link As" should go through BackgroundFileSaver

Categories

(Firefox :: File Handling, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: mmc, Unassigned)

References

(Blocks 1 open bug)

Details

Assignee: nobody → mmc
Component: Networking: File → File Handling
Hi Paolo,

Do you know the code path for this? Also, do you know why this didn't also hit the same blocking IO badness as in bug 789932? Last, do you know if anyone will object to unifying this codepath?

Thanks,
Monica
Flags: needinfo?(paolo.mozmail)
(In reply to Monica Chew from comment #1)
> Also, do you know why this didn't also hit the same blocking IO badness as in
> bug 789932?

The peculiarity of this code path is that, while we often go through
nsIExternalHelperAppService (and thus BackgroundFileSaver), sometimes we use
nsIWebBrowserPersist instead. This depends on how fast your network is and
how fast the server is in replying, so it's totally non-deterministic!

> Last, do you know if anyone will object to unifying this codepath?

The "Save As" and "Save Link As" code is definitely in need of some refactoring!
That's something we've been thinking about for quite some time. While nothing
stops us from doing a small refactoring when easy and appropriate, I think most
of this is better handled in the wider context of streamlining the download
process, to enable several proposed user experience improvements:

https://wiki.mozilla.org/User:P.A./Download_user_experience_improvements

I'm currently working on a new JavaScript API for downloads, built from
the ground up (you've come across one of its modules that is using
BackgroundFileSaver), whose immediate goal is to gain a performance win,
but will eventually allow us to unify several of the code paths we have.
Some more context, at a very high level, can be found here:

https://wiki.mozilla.org/User:P.A./Download_architecture_improvements

This is why I'd recommend handling this bug and bug 837194 after you have
finished working on the other items in bug 662819 comment 35. There's also
an advantage in getting the application reputation feature into the tree
earlier, experimentally, even if only for the most common cases at first.
Flags: needinfo?(paolo.mozmail)
I am in complete agreement about the incremental progress. For your amusement, I found this ancient wiki: https://developer.mozilla.org/en-US/docs/Overview_of_how_downloads_work

and a snapshot of that page with unbroken images here:
https://dev.mozilla.jp/localmdc/localmdc_5193.html#index-mozilla_005fdownloads_005fpath2_002edia
Product: Core → Firefox

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: mmc.bugzilla → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.