Open Bug 1727467 Opened 4 years ago Updated 3 years ago

Replace some char* allocs with nsCString in nsImapBodyShell

Categories

(MailNews Core :: General, task)

Tracking

(Not tracked)

People

(Reporter: benc, Assigned: benc)

References

Details

(Keywords: leave-open)

Attachments

(2 files)

There's a bit of char* usage in nsImapBodyShell that'd benefit from using ns[A]CString instead.

Setting leave-open. It looks like the char* replacement could continue upward a layer or two up the callstack, so there'll probably be another patch or two to come.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/bb0d25b8f6d7
Use nsCString to store nsImapBodyShell folder name instead of allocating char buffer. r=mkmelin

Flags: needinfo?(benc)

(In reply to José M. Muñoz from comment #4)

Why not use nsDependentCString()?

Good point - thanks! Patch incoming.

Flags: needinfo?(benc)

That still doesn't follow the usual path that is taken when converting raw string to smart string, example here:
https://hg.mozilla.org/comm-central/rev/88afdfc38ae6#l2.49
You don't need the variables.

(In reply to José M. Muñoz from comment #7)

You don't need the variables.

Patch revised (Small enough change that I kept the existing r+) - thanks!

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/312205101b78
Some minor nsDependentCString fixups in nsImapHostSessionList. r=mkmelin

See Also: → 1748940

The partNum handling is a bit infuriating - it takes a little unpicking to figure out the ownership of the raw char*. So the next step here would be to use string objects instead. Changes would spread across nsImapBodyShell and nsImapUrl.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: