Closed Bug 813800 Opened 13 years ago Closed 13 years ago

ShouldRevalidateEntry() in imgLoader.cpp should return false for any data URI

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: seth, Assigned: seth)

Details

Attachments

(1 file)

Currently data URIs end up getting revalidated in imagelib, which doesn't make much sense as they're immutable. Due to unfortunate details of the way validation is performed, a new imgRequest is created every time a data URI is revalidated, which is even more wasteful. We can avoid the problem entirely by returning |false| from ShouldRevalidateEntry() whenever we're dealing with a data URI.
CC'ing Jason Duell on this just to make sure there isn't some hidden necko reason why revalidating data URIs is necessary.
Proposed patch. Requesting review.
Attachment #683809 - Flags: review?(joe)
(Ended up putting the check in ValidateEntry() instead of ShouldRevalidateEntry() since we have the URI available there and there are lots of similar checks in that spot.)
Comment on attachment 683809 [details] [diff] [review] Never revalidate data URIs. Review of attachment 683809 [details] [diff] [review]: ----------------------------------------------------------------- I'm not sure whether it makes more sense for this to be nearer the file:/// section above, but w/e.
Attachment #683809 - Flags: review?(joe) → review+
I was nervous to move it above the CORS/principal check without being really sure as to what I was doing. =)
Try job looks OK. Requesting checkin.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Try run for 74be7412b31a is complete. Detailed breakdown of the results available here: https://tbpl.mozilla.org/?tree=Try&rev=74be7412b31a Results (out of 256 total builds): success: 246 warnings: 9 failure: 1 Builds (or logs if builds failed) available at: http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/mfowler@mozilla.com-74be7412b31a
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: