Closed Bug 1542344 Opened 5 months ago Closed 5 months ago

fix API mismatches in ImageEncoder

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

No description provided.

ImageEncoder::ExtractDataInternal takes a const nsAString& for its
options, but flattens it into a null-terminated nsString so callees
can take a char16_t*. But nearly all of those callees eventually wind
up calling ImageEncoder::GetInputStream, which just constructs an
nsDependentString from the passed character pointer.

There's no reason to do all this extra work. We can just pass the
original options reference all the way through the stack and avoid
needless conversions.

How did you come across this, out of curiosity?

Priority: -- → P2

(In reply to Andrew McCreight [:mccr8] from comment #2)

How did you come across this, out of curiosity?

Searching for PromiseFlatString and wondering what uses that didn't call out to native code were for.

Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c0a3a443f97
fix API mismatches in ImageEncoder; r=mccr8
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.