Closed
Bug 1116176
Opened 9 years ago
Closed 9 years ago
Create DownloadsHistoryDataItem and HistoryDownload objects
Categories
(Firefox :: Downloads Panel, defect)
Firefox
Downloads Panel
Tracking
()
Tracking | Status | |
---|---|---|
firefox38 | --- | fixed |
People
(Reporter: Paolo, Assigned: Paolo)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
52.39 KB,
patch
|
Paolo
:
review+
mak
:
feedback+
jaws
:
feedback+
smacleod
:
feedback+
|
Details | Diff | Splinter Review |
53.39 KB,
patch
|
Details | Diff | Splinter Review |
This simplifies the Library code as mentioned in bug 1115983.
Assignee | ||
Comment 1•9 years ago
|
||
I'm also thinking that, again in the spirit of simplifying the code, we may want to remove the check for the file size on disk for very old downloads without Places metadata, and just assume they succeeded.
Assignee | ||
Comment 2•9 years ago
|
||
I didn't test this extensively yet, but it seems to work fine with recent downloads. Might require a little bit of cleanup.
Updated•9 years ago
|
Flags: qe-verify-
Flags: firefox-backlog+
Assignee | ||
Comment 3•9 years ago
|
||
Comment 4•9 years ago
|
||
Comment on attachment 8542583 [details] [diff] [review] Initial patch Review of attachment 8542583 [details] [diff] [review]: ----------------------------------------------------------------- As discussed over IRC, with the scope of unblocking this work, I'm going through these patches with feedback, someone else will do the deep line by line review. once all of the queue of patches has been reviewed, I'll be available for a last pass on the coalesced patch (with so many patches removing changes done by the previous one, it's very hard to figure what survives and what doesn't) ::: browser/components/downloads/DownloadsCommon.jsm @@ +7,5 @@ > "use strict"; > > this.EXPORTED_SYMBOLS = [ > "DownloadsCommon", > + "DownloadsDataItem", I don't like having modules exposing more than one object, they kill the defineLazyModuleGetter functionality and are more confusing for global scope pollution (I import DownloadsCommon and I get a DownloadsDataItem symbol) We could either move it to a separate module, or make DownloadsCommon expose it through a property, like DownloadsCommon.newDataItem() or new DownloadsCommon.DataItem() @@ +27,5 @@ > * > * DownloadsDataItem > + * Represents a single item in the list of downloads. This object wraps the > + * Download object from the JavaScript API for downloads. A specialized version > + * of this object is implemented in the Places front-end view. would be nice to point out where that view code lives. ::: browser/components/downloads/content/allDownloadsViewOverlay.js @@ +59,5 @@ > + */ > + start() { > + // In future we may try to download into the same original target uri, when > + // we have it. Though that requires verifying the path is still valid and > + // may surprise the user if he wants to be requested every time. the last phrase could likely be clarified (wants to be requested what? it's the path, but it's not well expressed) @@ +78,5 @@ > + * > + * @param aPlacesNode > + * The Places node for the history download. > + */ > +function DownloadsHistoryDataItem(aPlacesNode) { Maybe just HistoryDataItem (would cope better with HistoryDownload) @@ +139,4 @@ > * > + * The shell may contain a session download, a history download, or both. When > + * both a history and a current download are present, the current download gets > + * priority and its information is displayed. please unify the notation between "session download" and "current download", I think the former is better. @@ +220,5 @@ > + _historyDataItem: null, > + get historyDataItem() this._historyDataItem, > + set historyDataItem(aValue) { > + if (this._historyDataItem != aValue) { > + if (!aValue && !this._sessionDataItem) { you are sometimes using ._sessionDataItem and sometimes .sessionDataItem... please unify notation. The same for _historyDataItem. @@ +247,1 @@ > }, hm, looks like some of the lazy getters could use defineLazyGetter? @@ +465,3 @@ > case "downloadsCmd_retry": > + console.log(this.dataItem); > + return this.dataItem.canRetry; debug spew @@ +595,5 @@ > + }, > + > + _checkTargetFileOnSelect: Task.async(function* () { > + try { > + this._targetFileExists = yield OS.File.exists(this.download.target.path); could pass the path as argument or merge with onSelect (the only call point) ::: browser/components/downloads/content/downloads.js @@ +1060,5 @@ > // is reloaded, we must change the URI used by the XUL image element, for > // example by adding a query parameter. Since this URI has a "moz-icon" > // scheme, this only works if we add one of the parameters explicitly > // supported by the nsIMozIconURI interface. > + if (this.dataItem.state == Ci.nsIDownloadManager.DOWNLOAD_FINISHED) { hm, I don't remember why we needed to filter on aOldState. maybe onStateChanged was notifying progress changes when actually the state didn't change at all? btw, you should probably remove it as an argument if unused.
Attachment #8542583 -
Flags: review?(mak77) → feedback+
Comment 5•9 years ago
|
||
Hi Paolo, can you provide a point value.
Iteration: --- → 38.2 - 9 Feb
Flags: needinfo?(paolo.mozmail)
Assignee | ||
Updated•9 years ago
|
Points: --- → 3
Flags: needinfo?(paolo.mozmail)
Updated•9 years ago
|
Iteration: 38.2 - 9 Feb → 38.3 - 23 Feb
Assignee | ||
Updated•9 years ago
|
Attachment #8542583 -
Flags: feedback?(smacleod)
Attachment #8542583 -
Flags: feedback?(jaws)
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8542583 [details] [diff] [review] Initial patch Review comments addressed in bug 1129896.
Attachment #8542583 -
Flags: review+
Assignee | ||
Comment 7•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/44c72cf73a97
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/44c72cf73a97
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox38:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Updated•9 years ago
|
Attachment #8542583 -
Flags: feedback?(jaws) → feedback+
Updated•9 years ago
|
Attachment #8542583 -
Flags: feedback?(smacleod) → feedback+
You need to log in
before you can comment on or make changes to this bug.
Description
•