Closed Bug 895403 Opened 11 years ago Closed 11 years ago

Disable methods of nsIDownloadManager that are replaced by the JavaScript API

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: Paolo, Assigned: Paolo)

References

Details

Attachments

(1 file)

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.
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.
(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.
Attached patch The patchSplinter Review
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
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: