Disable methods of nsIDownloadManager that are replaced by the JavaScript API

RESOLVED FIXED in mozilla26

Status

()

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Paolo, Assigned: Paolo)

Tracking

Trunk
mozilla26
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Methods of nsIDownloadManager that have a replacement in the JavaScript API
for downloads should output an error to the Console, but only for products in
which the JavaScript API is actually enabled.
(Assignee)

Comment 1

5 years ago
Actually, we should disable the old methods to ensure that the database is never
opened, something like NS_ENSURE_STATE(!mUseJSDownloads).
Summary: Add a deprecation warning to methods of nsIDownloadManager that are replaced by the JavaScript API → Disable methods of nsIDownloadManager that are replaced by the JavaScript API
It looks like the database is initialized simply by getting the old download manager, not by calling any of its methods. So disabling the methods wouldn't prevent the database from being opened.
(Assignee)

Comment 3

5 years ago
(In reply to Neil Deakin from comment #2)
> It looks like the database is initialized simply by getting the old download
> manager, not by calling any of its methods. So disabling the methods
> wouldn't prevent the database from being opened.

Yes, we should return early in the Init method if the preference is enabled,
and fail any methods that need to access the database.
(Assignee)

Comment 4

5 years ago
Created attachment 790108 [details] [diff] [review]
The patch
Assignee: nobody → paolo.mozmail
Status: NEW → ASSIGNED
Attachment #790108 - Flags: review?(enndeakin)
Attachment #790108 - Flags: review?(enndeakin) → review+
https://hg.mozilla.org/mozilla-central/rev/18ea4b3fb24f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.