Closed
Bug 597368
Opened 15 years ago
Closed 15 years ago
nsScriptLoader should use nsRefPtr to hold nsScriptLoadRequest
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
People
(Reporter: hsivonen, Assigned: hsivonen)
References
Details
Attachments
(1 file)
|
6.34 KB,
patch
|
sicking
:
review+
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
nsScriptLoader should use nsRefPtr to hold nsScriptLoadRequest. It's currently using nsCOMPtr and nsCOMArray.
| Assignee | ||
Comment 1•15 years ago
|
||
Comment on attachment 476220 [details] [diff] [review]
Make nsScriptLoader use nsRefPtr/nsTArray for holding nsScriptLoadRequest
>+ while (mEnabled && i < mAsyncRequests.Length()) {
> if (!mAsyncRequests[i]->mLoading) {
>- request = mAsyncRequests[i];
>- mAsyncRequests.RemoveObjectAt(i);
>+ request.swap(mAsyncRequests[i]);
>+ mAsyncRequests.RemoveElementAt(i);
> ProcessRequest(request);
> continue;
> }
> ++i;
> }
This is somewhat odd since you're actually swapping in the old requests into the array before you remove it. I think it works, but it would IMHO be more understandable to do
request = mAsyncRequests[i].forget();
Same in the loop below.
r=me with that fixed.
Thanks for doing this cleanup.
Attachment #476220 -
Flags: review?(jonas) → review+
| Assignee | ||
Comment 3•15 years ago
|
||
Comment on attachment 476220 [details] [diff] [review]
Make nsScriptLoader use nsRefPtr/nsTArray for holding nsScriptLoadRequest
Requesting approval: This is low-risk cleanup. Taking this on the branch would make branch maintanance easier if we end up having to patch nsScriptLoader.
Attachment #476220 -
Flags: approval2.0?
Updated•15 years ago
|
Attachment #476220 -
Flags: approval2.0? → approval2.0+
| Assignee | ||
Comment 4•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Updated•15 years ago
|
Target Milestone: mozilla2.0b8 → mozilla2.0b7
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•