Closed Bug 1445692 Opened 7 years ago Closed 7 years ago

Remove UTF8InputStream

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(1 file)

UTF8InputStream is redundant with nsConverterInputStream initialized with UTF-8 and uses facilities that I want to remove as part of bug 1402247.
Comment on attachment 8958932 [details] Bug 1445692 - Remove UTF8InputStream. https://reviewboard.mozilla.org/r/227796/#review235092 ::: xpcom/io/nsUnicharInputStream.cpp:139 (Diff revision 3) > - RefPtr<UTF8InputStream> it = new UTF8InputStream(); > - nsresult rv = it->Init(aStreamToWrap); > + RefPtr<nsConverterInputStream> it = new nsConverterInputStream(); > + nsresult rv = > + it->Init(aStreamToWrap, > + "UTF-8", > + STRING_BUFFER_SIZE, > + 0); Would it be worth adding a comment here as to the meaning of `0`? Or, alternatively, WDYT about adding: ``` const char16_t THROW_EXCEPTIONS_ON_INVALID_BYTE_SEQUENCES = 0; ``` to `nsIConverterInputStream.idl` (name subject to bikeshedding), so we don't have these weird constants hanging out in `Init` calls?
Attachment #8958932 - Flags: review?(nfroyd) → review+
Comment on attachment 8958932 [details] Bug 1445692 - Remove UTF8InputStream. https://reviewboard.mozilla.org/r/227796/#review235092 > Would it be worth adding a comment here as to the meaning of `0`? Or, alternatively, WDYT about adding: > > ``` > const char16_t THROW_EXCEPTIONS_ON_INVALID_BYTE_SEQUENCES = 0; > ``` > > to `nsIConverterInputStream.idl` (name subject to bikeshedding), so we don't have these weird constants hanging out in `Init` calls? Introduced `nsIConverterInputStream::ERRORS_ARE_FATAL`.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: