Closed Bug 1407458 Opened 8 years ago Closed 8 years ago

Use nsString for Observation filenames

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

Attachments

(1 file, 1 obsolete file)

This avoids some char16_t*/nsString mismatches.
Attachment #8917202 - Flags: review?(erahm)
Comment on attachment 8917202 [details] [diff] [review] Use nsString for Observation filenames Review of attachment 8917202 [details] [diff] [review]: ----------------------------------------------------------------- Overall looks good. Can you change the commit message? Something like "avoid unnecessary string copies" instead of "mismatches" would be clearer. AFAICT you need to do `PoisonIOInterposerWin` [1] as well. Just return an `nsString&` seems clear to me, but I don't feel too strongly about that. [1] http://searchfox.org/mozilla-central/rev/ed1d5223adcdc07e9a2589ee20f4e5ee91b4df10/xpcom/build/PoisonIOInterposerWin.cpp#198-216 ::: xpcom/build/IOInterposer.h @@ +95,5 @@ > */ > const char* Reference() const { return mReference; } > > + /** Request filename associated with the I/O operation, empty if unknown */ > + virtual void Filename(nsAString& aString) { aString.Truncate(); } It might be cleaner to just return a ref. In this case you could use EmptyString.
Attachment #8917202 - Flags: review?(erahm) → review-
I added the Windows support. I left the outparam because that's the standard way of returning nsString values.
Attachment #8919684 - Flags: review?(erahm)
Attachment #8917202 - Attachment is obsolete: true
(In reply to Nicholas Nethercote [:njn] from comment #3) > Created attachment 8919684 [details] [diff] [review] > Use nsString for Observation filenames > > I added the Windows support. I left the outparam because that's the standard > way of returning nsString values. I'm not convinced that's true, but meh.
Attachment #8919684 - Flags: review?(erahm) → review+
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: