Closed Bug 463882 Opened 13 years ago Closed 13 years ago

nsDownloadManager::Init is not safe for multiple calls

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b3

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

(Keywords: fixed1.9.1)

Attachments

(2 files, 2 obsolete files)

Attached patch Patch (v1) (obsolete) — Splinter Review
Bug 457110 made it possible to call nsDownloadManager::Init multiple times to switch the database engine.  Some parts of this method are not safe for multiple calls, for example switching the database can cause multiple copies of each observer being registered, which at best can waste memory and processing power, and at worst might manifest itself through other bugs.

The patch is simple enough.  We need to take this because any user who switches to/from the private browsing mode is going to trigger this.
Attachment #347135 - Flags: review?(sdwilsh)
Attachment #347135 - Flags: review?(sdwilsh) → review-
Comment on attachment 347135 [details] [diff] [review]
Patch (v1)

I would be more inclined to make a new method that does the database switching work, and keep Init as it is.
Attached patch Patch (v2)Splinter Review
OK, I did that in this patch.  I made sure that all the unit tests pass successfully with this patch applied.
Attachment #347135 - Attachment is obsolete: true
Attachment #348051 - Flags: review?(sdwilsh)
Comment on attachment 348051 [details] [diff] [review]
Patch (v2)

hg generated a very unuseful patch there...

r=sdwilsh
Attachment #348051 - Flags: review?(sdwilsh) → review+
Attachment #348051 - Flags: approval1.9.1?
Comment on attachment 348051 [details] [diff] [review]
Patch (v2)

a191=beltzner
Attachment #348051 - Flags: approval1.9.1? → approval1.9.1+
Attached patch mq patch for check-in (obsolete) — Splinter Review
Attachment #350511 - Attachment is obsolete: true
Please make sure you attach a patch that has the username in it next time.  I almost pushed this as me.

http://hg.mozilla.org/mozilla-central/rev/73d9cfe0174c
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b3
Attachment #350515 - Attachment is patch: true
Attachment #350515 - Attachment mime type: application/octet-stream → text/plain
Keywords: fixed1.9.1
You need to log in before you can comment on or make changes to this bug.