Closed Bug 1692647 Opened 4 years ago Closed 4 years ago

Streamline Objective C exception handling in native menu code

Categories

(Core :: Widget: Cocoa, task, P3)

All
macOS
task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

In this bug I want to convert the menu code to use fatal exception guards (bug 1693389), and to use them consistently (bug 1693392).

Blocks: 1693389, 1693392

Fatal exceptions make it easier to reason about code, because early "abondonment"
reduces the number of failure states that the code needs to handle. None of the
Objective C calls we make in menu code is supposed to throw an exception; by
crashing eagerly, we can quickly find out which ones do.

Since this patch can introduce new crashes, I would like to get it patch into
Nightly as quickly as possible so that we can watch crash stats and find any
"expected" exceptions, and add custom handling for them.

Depends on D105516

This patch removes exception guards from a number of Objective C methods, and
introduces exception guards to a number of C++ methods. The goal is to guard the
"boundary" between the two worlds.

Depends on D105517

Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/eb723067be18 Make Objective C exceptions fatal in menu code. r=spohl https://hg.mozilla.org/integration/autoland/rev/b03a44019284 Apply new exception guard policy to the menu code: Non-throwing functions need to guard if they call throwing functions, see bug 1693392. r=spohl
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Regressions: 1699936
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: