Closed Bug 1485319 Opened 6 years ago Closed 4 years ago

Write the FILE_AS_BINARY case of FileReader::DoReadData in terms of SetCapacity and AppendASCIItoUTF16

Categories

(Core :: DOM: File, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: hsivonen, Assigned: ssengupta)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

FileReader::DoReadData calls nsTSubstring::GetMutableData, which is a rarely used redundant API that would be nice to remove as a clean-up (bug 1485026).

Also, the code does low-level writes via a pointer to mResult's buffer. This code could be written more cleanly with SetCapacity() and AppendASCIItoUTF16(). (Although the latter says "ASCII", it actually performs the Latin1 to UTF-16 conversion, i.e. zero-extends each byte to a char16_t.)

Subhamoy, do you have time to work on this?

Flags: needinfo?(ssengupta)
Assignee: nobody → ssengupta
Status: NEW → ASSIGNED
Flags: needinfo?(ssengupta)
Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/66b62186b533
P1 - Call to nsTSubstring::GetMutableData removed r=baku
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: