Closed
Bug 384732
Opened 18 years ago
Closed 18 years ago
Download manager should use a transaction when importing from downloads.rdf
Categories
(Toolkit :: Downloads API, defect)
Toolkit
Downloads API
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha6
People
(Reporter: sdwilsh, Assigned: Mardak)
Details
Attachments
(1 file, 3 obsolete files)
|
2.39 KB,
patch
|
sdwilsh
:
review+
|
Details | Diff | Splinter Review |
We should start a transaction right before we start importing downloads to speed things up (especially with larger downloads.rdf). This will involve adding one line before this bit http://mxr.mozilla.org/seamonkey/source/toolkit/components/downloads/src/nsDownloadManager.cpp#263
mozStorageTransaction(mDBConn, PR_TRUE);
and of course, #include "mozStorageHelper.h" somewhere up top :)
| Assignee | ||
Comment 1•18 years ago
|
||
(void) the mozStorageTransaction return value from mozStorageTransaction's constructor
(void) the PRInt64 return value from AddDownloadToDB
| Assignee | ||
Comment 2•18 years ago
|
||
on second though, a constructor has no return value.. there's no return statements.....
(However, I suppose a new <class> would have a return type of <class>.)
Attachment #268659 -
Attachment is obsolete: true
Attachment #268660 -
Flags: review?(sdwilsh)
Attachment #268659 -
Flags: review?(sdwilsh)
| Reporter | ||
Comment 3•18 years ago
|
||
Comment on attachment 268660 [details] [diff] [review]
v2
>+ // Use a transaction to speed up INSERTs if we happen to be adding
>+ // a lot of downloads - commits the transaction when destructing.
nit: lose the comment - it is what the function is for.
Attachment #268660 -
Flags: review?(sdwilsh) → review+
| Assignee | ||
Comment 4•18 years ago
|
||
(In reply to comment #3)
> >+ // Use a transaction to speed up INSERTs if we happen to be adding
> >+ // a lot of downloads - commits the transaction when destructing.
> nit: lose the comment - it is what the function is for.
gone
Attachment #268660 -
Attachment is obsolete: true
| Reporter | ||
Updated•18 years ago
|
Attachment #268662 -
Flags: review+
| Reporter | ||
Updated•18 years ago
|
Whiteboard: [checkin needed]
| Reporter | ||
Comment 5•18 years ago
|
||
actually - does this even compile? It should be something like:
mozStorageTransaction transaction(mDBConn, PR_TRUE);
Sorry for the confusing initial comment....
Whiteboard: [checkin needed]
| Assignee | ||
Comment 6•18 years ago
|
||
It compiles. I looked through other code and they do something similar. That's why I originally put the comments about how the constructor/destructor works.
Without a name, it'll still construct a mozStorageTransaction object for the scope and it'll destruct at the end of the method.
| Assignee | ||
Comment 7•18 years ago
|
||
Oops, it /does/ compile but apparently without a name, it constructs and destructs on that same line.
Attachment #268662 -
Attachment is obsolete: true
| Reporter | ||
Updated•18 years ago
|
Attachment #268841 -
Flags: review+
| Reporter | ||
Comment 8•18 years ago
|
||
Checking in toolkit/components/downloads/src/nsDownloadManager.cpp;
new revision: 1.90; previous revision: 1.89
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
| Reporter | ||
Updated•18 years ago
|
Target Milestone: --- → Firefox 3 alpha6
Updated•18 years ago
|
Flags: in-testsuite-
Updated•17 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•