Closed Bug 1798080 Opened 3 years ago Closed 3 years ago

Annotate some stack-only classes and const members in SVG-text-related layout code

Categories

(Core :: SVG, task)

task

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(2 files)

Building towards some minor refactoring in bug 1798048, I'm using this bug to add some trivial-ish annotations in svg text code to reflect reality and improve reasoning ability for this code.

This patch doesn't impact behavior; it's just adding an annotation to activate
a static analysis check for various classes.

The annotation gives us some confidence that these instances are tightly scoped
to a particular function-call. This helps reduce concerns about to-what-extent
the affected classes might need to worry about the lifetimes of the objects
pointed to by their member-vars.

The specific classes I'm annotating are:

  • gfxTextRunDrawCallbacks and PaintTextParams, both of which have multiple
    subclasses, all of which will automatically inherit this annotation and
    benefit from it.

  • TextFrameIterator and CharIterator, two local utility classes in
    SVGTextFrame.cpp.

This patch doesn't impact behavior.

The new const annotations will help to simplify reasoning about these various
helper classes & what states they could possibly be in.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d172c72030b9 part 1: Add MOZ_STACK_CLASS annotation to some text layout/painting classes, to reflect reality. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/c3adab330847 part 2: Add const annotation to some never-modified member-vars in SVGTextFrame's helper classes, to reflect reality. r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
No longer blocks: 1798048
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: