Closed Bug 1928220 Opened 1 year ago Closed 4 days ago

Remove stopgap MOZ_RUNINIT use in nsImapProtocol.cpp

Categories

(Thunderbird :: General, task)

task

Tracking

(Not tracked)

RESOLVED FIXED
156 Branch

People

(Reporter: benc, Assigned: welpy-cw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

After Bug 1920718, global vars that require construction must be explicitly flagged, and that was done in Bug 1928157.
But we shouldn't really have any such variables - constructing things before main() is always a little fraught.
The patch in Bug 1928157, D227403 can be used as a roadmap of what needs changing.

For IMAP, it's all stuff that looks like it should already be constant (static ints that are initialised using the contents of other statically-initialised ints).

Blocks: 1945496

Remove the stopgap MOZ_RUNINIT annotation by making the IMAP wait durations
non-runtime-initialized constants. Store the durations as constexpr
second-based constants and convert them with PR_SecondsToInterval() at the
point of use.

  • Keep the 60-second IMAP sleep and two-second IDLE delay as file-level constexpr constants, making the IDLE delay available for reuse.
  • Convert the folder message and password waits through the same NSPR helper.

Also remove the unused FallbackToFetchWholeMsg() code left behind by the
nsImapBodyShell removal in Bug 1888569, along with an unused include and macro.

Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
Attachment #9630162 - Attachment description: Bug 1928220 - Make kImapSleepTime and kIdleWait compile-time constants. r=#thunderbird-reviewers → Bug 1928220 - Remove stopgap MOZ_RUNINIT use in nsImapProtocol.cpp. r=#thunderbird-reviewers
Target Milestone: --- → 156 Branch

Pushed by brendan@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/a31a077151c4
Remove stopgap MOZ_RUNINIT use in nsImapProtocol.cpp. r=BenC

Status: ASSIGNED → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: