Closed Bug 584316 Opened 15 years ago Closed 14 years ago

Fix DownloadManager usage of deprecated Storage binding APIs

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: timeless, Assigned: sdwilsh)

References

Details

Attachments

(2 files, 2 obsolete files)

bug 507414 declared deprecated a bunch of binding functions download manager uses, you should update to the new code. storage/public/mozIStorageBaseStatement.idl (View Hg log or Hg annotations) line 91 -- [deprecated] void bindStringParameter(in unsigned long aParamIndex, toolkit/components/downloads/src/nsDownloadManager.cpp (View Hg log or Hg annotations) line 742 -- rv = stmt->BindStringParameter(i++, aName); line 754 -- rv = stmt->BindStringParameter(i++, aTempPath); line 3008 -- nsresult rv = stmt->BindStringParameter(i++, tempPath);
Assignee: bugmail → nobody
Whiteboard: [good first bug]
Attached patch untested (obsolete) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #463347 - Flags: review?(sdwilsh)
Attachment #463347 - Flags: review?(sdwilsh) → review?(edilee)
Comment on attachment 463347 [details] [diff] [review] untested >- "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10)"), getter_AddRefs(stmt)); Woohoo!
Attachment #463347 - Flags: review?(edilee) → review+
Blocks: 645049
Keywords: checkin-needed
actually, we need to fix the UI here too...
Keywords: checkin-needed
Attachment #521875 - Flags: review?(edilee)
(In reply to comment #4) > Created attachment 521875 [details] [diff] [review] The other patch for this bug switches to binding by name instead of index, but it doesn't really make much sense here as the names would probably be state_notstarted, state_downloading; or state0, state1. Probably not too much of an overhead, but couldn't we just hardcode the values into the query instead of dynamically binding each time? At least only reference nsIDM.DOWNLOAD_NOTSTARTED at query creation time? [Side note.. turns out gStmt is only used in downloads.js ! :p]
(In reply to comment #5) > Probably not too much of an overhead, but couldn't we just hardcode the values > into the query instead of dynamically binding each time? At least only > reference nsIDM.DOWNLOAD_NOTSTARTED at query creation time? We could, but I don't see much value to doing so. The general practice is to *always* bind so you are always safe. In places, we enforce that whenever possible.
Comment on attachment 521875 [details] [diff] [review] ui v1.0 (checked in) Just checking, there isn't any magic for binding an array of ints for bindParameters?
Attachment #521875 - Flags: review?(edilee) → review+
(In reply to comment #7) > Just checking, there isn't any magic for binding an array of ints for > bindParameters? Not quite, but it's something I'd like to make happen.
Keywords: checkin-needed
Comment on attachment 521875 [details] [diff] [review] ui v1.0 (checked in) I forgot there were two patches to this bug...I landed this patch: http://hg.mozilla.org/mozilla-central/rev/a76f473d9f99
Attachment #521875 - Attachment description: ui v1.0 → ui v1.0 (checked in)
Keywords: checkin-needed
Whiteboard: [good first bug] → fixed-in-cedar
(In reply to comment #11) > Backed out due to orange: > http://hg.mozilla.org/projects/cedar/rev/9b459316a572 > http://hg.mozilla.org/projects/cedar/rev/7edef9fb11df What was the orange? Linking to logs when something is backed out is often helpful...
(In reply to comment #12) > (In reply to comment #11) > > Backed out due to orange: > > http://hg.mozilla.org/projects/cedar/rev/9b459316a572 > > http://hg.mozilla.org/projects/cedar/rev/7edef9fb11df > What was the orange? Linking to logs when something is backed out is often > helpful... http://tbpl.mozilla.org/?tree=Cedar&rev=bbd0f34afe0f
Looks to me like nsDownloadManager::CancelDownload is broken in this patch
i won't be able to fix this up. sorry. my guess is that it's relatively easy for someone else to adopt.
Assignee: timeless → nobody
Assignee: nobody → sdwilsh
Attached patch tested (obsolete) — Splinter Review
Attachment #463347 - Attachment is obsolete: true
Comment on attachment 531167 [details] [diff] [review] tested Review of attachment 531167 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/components/downloads/nsDownloadManager.cpp @@ +1666,3 @@ > NS_ENSURE_SUCCESS(rv, rv); > for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(states); ++i) { > + rv = stmt->BindInt32ByIndex(0, states[i]); sometimes I'm an idiot...
Attachment #531167 - Flags: review-
Attached patch tested for realzSplinter Review
Now that I've run all the tests that were failing before on try locally, all the errors have been fixed. This is ready to go.
Attachment #531167 - Attachment is obsolete: true
Attachment #531340 - Flags: review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: