Closed
Bug 830271
Opened 12 years ago
Closed 12 years ago
nsIDownloadManagerUI uses obsolete download id
Categories
(Toolkit :: Downloads API, defect)
Toolkit
Downloads API
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: neil, Assigned: jdm)
References
Details
(Keywords: addon-compat)
Attachments
(1 file)
10.55 KB,
patch
|
mak
:
review+
mossop
:
superreview+
|
Details | Diff | Splinter Review |
nsIDownloadManagerUI's show() method takes an (optional) id, however ids are deprecated and make no sense for private downloads in per-window PB mode.
My preference would be for it to be changed to take an nsIDownload instead.
Assignee | ||
Comment 1•12 years ago
|
||
Assignee | ||
Comment 2•12 years ago
|
||
Comment on attachment 701743 [details] [diff] [review]
Make download UI notification take an nsIDownload.
Marco, how do you feel about this?
Attachment #701743 -
Flags: review?(mak77)
Comment 3•12 years ago
|
||
Comment on attachment 701743 [details] [diff] [review]
Make download UI notification take an nsIDownload.
Review of attachment 701743 [details] [diff] [review]:
-----------------------------------------------------------------
This needs a superreview for the API change (Mossop maybe?), I went back in history to check the original implementation, but I couldn't find any valid reason to pass an id instead of the download.
r=me with the following comments addressed.
::: mobile/android/components/DownloadManagerUI.js
@@ +21,5 @@
> aReason = Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED;
>
> let browser = Services.wm.getMostRecentWindow("navigator:browser");
> if (browser)
> + browser.showDownloadManager(aWindowContext, aDownload, aReason);
you should also fix showDownloadManager
http://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/browser.js#2746
::: toolkit/components/downloads/nsDownloadProxy.h
@@ +69,5 @@
>
> if (visible && !focusWhenStarting)
> return NS_OK;
>
> + return dmui->Show(nullptr, mInner, nsIDownloadManagerUI::REASON_NEW_DOWNLOAD, aIsPrivate);
looks like these are no more useful and should be removed:
55 uint32_t id;
56 mInner->GetId(&id);
Attachment #701743 -
Flags: review?(mak77) → review+
Updated•12 years ago
|
Assignee: nobody → josh
Keywords: addon-compat
Reporter | ||
Comment 4•12 years ago
|
||
Comment on attachment 701743 [details] [diff] [review]
Make download UI notification take an nsIDownload.
JFTR this is f=me, it's just what I need, thanks!
Reporter | ||
Comment 5•12 years ago
|
||
Comment on attachment 701743 [details] [diff] [review]
Make download UI notification take an nsIDownload.
It's ages since I set one of these, I wonder whether it will stick ;-)
Attachment #701743 -
Flags: superreview+
Reporter | ||
Comment 6•12 years ago
|
||
(In reply to Marco Bonardo from comment #3)
> you should also fix showDownloadManager
> http://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/browser.js#2746
Isn't mobile/xul dead yet?
Comment 7•12 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #6)
> (In reply to Marco Bonardo from comment #3)
> > you should also fix showDownloadManager
> > http://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/browser.js#2746
> Isn't mobile/xul dead yet?
it is, but since nobody removed the code we keep updating it...
Assignee | ||
Comment 8•12 years ago
|
||
Comment on attachment 701743 [details] [diff] [review]
Make download UI notification take an nsIDownload.
Sorry, Neil, but it feels subversive to let the person who originally proposed the interface change declare it to be a good one :)
Attachment #701743 -
Flags: superreview+ → superreview?(dtownsend+bugmail)
Comment 9•12 years ago
|
||
Comment on attachment 701743 [details] [diff] [review]
Make download UI notification take an nsIDownload.
Review of attachment 701743 [details] [diff] [review]:
-----------------------------------------------------------------
Tentatively yes, the API looks saner this way, my only concern is add-on bustage and making it easy for add-ons to support both old and new forms for a time. I'm seeing just 20 or so add-ons using this function on AMO (no idea how many of those are even compatible with current Firefox) so hopefully this isn't much of a problem, but jorge can tell us otherwise. Presumably we could support both old and new APIs if needs be, either with two methods (one deprecated) or by making that parameter an nsIVariant or something so you could pass either.
I do note that both flashgot and r2d2b2g seem to use it but those should be easy to get updated.
Attachment #701743 -
Flags: superreview?(dtownsend+bugmail) → superreview+
Comment 10•12 years ago
|
||
It appears to have low impact, so I don't have any objections to it.
Assignee | ||
Comment 11•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/f57f7c12b6dc
How much uplift is desirable here?
Comment 12•12 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #11)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/f57f7c12b6dc
>
> How much uplift is desirable here?
API change, likely none for Firefox (We don't use this param yet in the new manager), not sure if Seamonkey needs it.
Reporter | ||
Comment 13•12 years ago
|
||
It only affects per-window-pb builds, which aren't the default yet.
Assignee | ||
Comment 14•12 years ago
|
||
Well, those are on aurora right now.
Comment 15•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•