Closed Bug 1748940 Opened 2 years ago Closed 2 years ago

nsImapBodyShell spring cleaning

Categories

(MailNews Core :: Networking: IMAP, task)

Tracking

(thunderbird_esr91 wontfix)

RESOLVED FIXED
98 Branch
Tracking Status
thunderbird_esr91 --- wontfix

People

(Reporter: benc, Assigned: benc)

References

Details

Attachments

(2 files)

Just following up a few rough edges I noticed during Bug 847356, in nsIMapBodyShell and adjacent code.

  • Some classes have pointer members which would be safer/clearer as embedded objects (eg there are a couple of classes with nsTArray<>* members).
  • nsIMapBodyShellCache does extra work it doesn't need in dtor and Clear().
  • some general minor tidying and cruft-removal
  • Add central definition for max size (kMaxEntries).
  • Ensure a free slot before adding new entry (rather than going oversize then trimming back).
  • Embed nsTArray<> rather than separate heap alloc.
  • Reduce work done during dtor and clear.
  • Ditch static Create() function and make ctor public.
  • Remove returncodes for fns which don't really need them.

Depends on D135191

Attachment #9257958 - Attachment description: Bug 1748940 - Assorted minor nsImapBodyShell tidying. r=mkmelin → Bug 1748940 - Assorted minor nsImapBodyShellCache tidying. r=mkmelin
Status: NEW → ASSIGNED
Target Milestone: --- → 97 Branch

I think that wraps up this one. There's some frustratingly opaque char* memory handling (mainly with partNum strings), but that's better covered in Bug 1727467.

See Also: → 1727467

Holding off until after beta.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/8a413ffc8acb
Assorted minor nsImapBodyShellCache tidying. r=mkmelin
https://hg.mozilla.org/comm-central/rev/5a54066d8cfd
Use nsTArray<> instead of nsTArray<>* for nsIMAPBodypartMultipart subpart list. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: 97 Branch → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: