Closed
Bug 584316
Opened 15 years ago
Closed 14 years ago
Fix DownloadManager usage of deprecated Storage binding APIs
Categories
(Toolkit :: Downloads API, defect)
Toolkit
Downloads API
Tracking
()
RESOLVED
FIXED
mozilla6
People
(Reporter: timeless, Assigned: sdwilsh)
References
Details
Attachments
(2 files, 2 obsolete files)
1.13 KB,
patch
|
Mardak
:
review+
|
Details | Diff | Splinter Review |
14.47 KB,
patch
|
sdwilsh
:
review+
|
Details | Diff | Splinter Review |
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);
Updated•15 years ago
|
Assignee: bugmail → nobody
Assignee | ||
Updated•15 years ago
|
Whiteboard: [good first bug]
Assignee | ||
Updated•15 years ago
|
Attachment #463347 -
Flags: review?(sdwilsh) → review?(edilee)
Comment 2•15 years ago
|
||
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+
Assignee | ||
Updated•14 years ago
|
Blocks: 645049
Keywords: checkin-needed
Assignee | ||
Comment 3•14 years ago
|
||
actually, we need to fix the UI here too...
Keywords: checkin-needed
Assignee | ||
Comment 4•14 years ago
|
||
Attachment #521875 -
Flags: review?(edilee)
Comment 5•14 years ago
|
||
(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]
Assignee | ||
Comment 6•14 years ago
|
||
(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 7•14 years ago
|
||
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+
Assignee | ||
Comment 8•14 years ago
|
||
(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.
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 9•14 years ago
|
||
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)
Comment 10•14 years ago
|
||
Part 1 landed on cedar: http://hg.mozilla.org/projects/cedar/rev/9e9e1e3a05a1
Keywords: checkin-needed
Whiteboard: [good first bug] → fixed-in-cedar
Backed out due to orange:
http://hg.mozilla.org/projects/cedar/rev/9b459316a572
http://hg.mozilla.org/projects/cedar/rev/7edef9fb11df
Whiteboard: fixed-in-cedar
Assignee | ||
Comment 12•14 years ago
|
||
(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...
Comment 13•14 years ago
|
||
(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
Assignee | ||
Comment 14•14 years ago
|
||
Looks to me like nsDownloadManager::CancelDownload is broken in this patch
Reporter | ||
Comment 15•14 years ago
|
||
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 | ||
Updated•14 years ago
|
Assignee: nobody → sdwilsh
Assignee | ||
Comment 16•14 years ago
|
||
Pushed to try server: http://tbpl.mozilla.org/?tree=Try&rev=8bd5fcabd486
Attachment #463347 -
Attachment is obsolete: true
Assignee | ||
Comment 17•14 years ago
|
||
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-
Assignee | ||
Comment 18•14 years ago
|
||
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+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Comment 19•14 years ago
|
||
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.
Description
•