Open Bug 929391 Opened 8 years ago Updated 2 years ago

Use Downloads.getTemporaryDownloadsDirectory instead of GetDownloadDirectory in nsHelperAppService.cpp


(Toolkit :: Downloads API, task)

Not set




(Reporter: Paolo, Assigned: sahukariganesh2, Mentored)


(Blocks 1 open bug)


While this doesn't prevent us from decommissioning nsIDownloadManager, using Downloads.getTemporaryDownloadsDirectory instead of GetDownloadDirectory in nsHelperAppService.cpp will help in unifying the code paths.

We will need an XPCOM call to be able to use the function.
i would like to work on this bug. Can you assign me the bug
I wonder if paolo planned to mentor this bug
Assignee: nobody → sahukariganesh2
Flags: needinfo?(paolo.mozmail)
Yeah, glad to mentor!

Good choice Ganesh, as this builds upon the IDL skills. Since we want to remove nsIDownloadManager and nsDownloadManager.cpp from the tree, we'll need a new interface and component located in the "jsdownloads" folder. This will allow the getTemporaryDownloadsDirectory function to be called indirectly from C++. The component would be JavaScript-implemented, the reverse of the nsIDebug2 case. DownloadLegacy.js implementing nsITransfer is an example of this.

For simplicity on the C++ side, the IDL interface would be callback-based, while Downloads.getTemporaryDownloadsDirectory is Promise-based. mozIAsyncHistory.isURIVisited and mozIVisitedStatusCallback are examples of this callback-based pattern.

Feel free to start by taking a look at the code, and let me know if you have any questions!
Mentor: paolo.mozmail
Flags: needinfo?(paolo.mozmail)
Type: defect → task
You need to log in before you can comment on or make changes to this bug.