Closed Bug 330394 Opened 20 years ago Closed 14 years ago

LoadImage should not call nsILoadGroup::RemoveRequest

Categories

(Core :: Graphics: ImageLib, defect, P1)

defect

Tracking

()

RESOLVED WORKSFORME
mozilla1.9alpha1

People

(Reporter: darin.moz, Unassigned)

Details

(Keywords: arch)

Attachments

(1 file)

LoadImage should not call nsILoadGroup::RemoveRequest This results in all kinds of nastiness for the consumer of ImageLib. See, for example, bug 330089. We should make this call always happen asynchronously for consistency.
The call to RemoveRequest is indirect. It is a side-effect. See this stack trace: https://bugzilla.mozilla.org/attachment.cgi?id=214874
So this may sound silly... but if we're going to synchronously do the whole shebang here like we do now, could we just not call either AddRequest or RemoveRequest? I do think that doing it all async would be much better, though...
> So this may sound silly... but if we're going to synchronously do the whole > shebang here like we do now, could we just not call either AddRequest or > RemoveRequest? Maybe... are there cases where we would miss the WPL notifications?
We never send OnProgress here, right? I guess someone who's trying to keep track of all loads might care, though.... OK, let's just make this stuff async. ;)
Yeah, I think we should. It would help at least one extension that I've worked on that wants to inspect imgIRequest objects as they are loaded by the browser.
Status: NEW → ASSIGNED
Priority: -- → P1
Attached patch v1 patchSplinter Review
This is a candidate patch. I'm still in the process of running tests on it to determine perf impact. My theory is that it may be sufficient from a performance point of view to fire OnStartDecode and OnStartContainer synchronous, and then defer the rest of the notifications until a PLEvent runs. This patch implements that design, and I'll report back shortly with performance results.
Fwiw, if you have time to test doing it all async, that would be great too... I wouldn't be suprised if that has no perf hit (but I wouldn't be surprised if it has one too...)
Sure, I'll try that too.
OK, running the Tp test on my T41p thinkpad, I didn't see any markable difference in Tp results: median average baseline: 198 209 v1 patch: 196 214 full async: 198 210 Perhaps there'd be a measurable difference on a slower machine.
Comment on attachment 218240 [details] [diff] [review] v1 patch I'd like to go with this patch. I think there may be some testcases out there that might benefit (even slightly) from synchronous OnStartContainer since that would avoid some layout reflow.
Attachment #218240 - Flags: superreview?(bzbarsky)
Attachment #218240 - Flags: review?(pavlov)
Comment on attachment 218240 [details] [diff] [review] v1 patch I think more is needed. imgIRequest::Cancel triggers synchronous callbacks, which could result in ordering problems if those callbacks were followed by the callbacks generated from NotifyProxyListener.
Attachment #218240 - Flags: superreview?(bzbarsky)
Attachment #218240 - Flags: review?(pavlov)
-> defaults
Assignee: darin.moz → nobody
Status: ASSIGNED → NEW
QA Contact: imagelib
We should really fix this...
Flags: blocking1.9?
Flags: blocking1.9? → blocking1.9-
Whiteboard: [wanted-1.9]
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Do we still need this Boris?
imgIRequest::Cancel is asynchronous now; we have a synchronous variant, CancelAndForgetObserver, but even it removes from the load group asynchronously. This looks fine now.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: